winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
770 discussions
Start a n
N
ew thread
Francois Gouget : net: Add a WriteConsole() fall back so things still works on Windows if the output is redirected.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: 0b2a67cffbb8995104d13ee6d47ad694b123f68c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0b2a67cffbb8995104d13ee6d…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Aug 3 19:44:16 2011 +0200 net: Add a WriteConsole() fall back so things still works on Windows if the output is redirected. --- programs/net/net.c | 34 +++++++++++++++++++++++++++++----- 1 files changed, 29 insertions(+), 5 deletions(-) diff --git a/programs/net/net.c b/programs/net/net.c index 0761571..559ef5c 100644 --- a/programs/net/net.c +++ b/programs/net/net.c @@ -25,18 +25,44 @@ #define NET_START 0001 #define NET_STOP 0002 +static int output_write(WCHAR* str, int len) +{ + DWORD ret, count; + ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &count, NULL); + if (!ret) + { + DWORD lenA; + char* strA; + + /* On Windows WriteConsoleW() fails if the output is redirected. So fall + * back to WriteFile(), assuming the console encoding is still the right + * one in that case. + */ + lenA = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, len, + NULL, 0, NULL, NULL); + strA = HeapAlloc(GetProcessHeap(), 0, lenA); + if (!strA) + return 0; + + WideCharToMultiByte(GetConsoleOutputCP(), 0, str, len, strA, lenA, + NULL, NULL); + WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), strA, len, &count, FALSE); + HeapFree(GetProcessHeap(), 0, strA); + } + return count; +} + static int output_string(int msg, ...) { WCHAR fmt[8192]; WCHAR str[8192]; int len; - DWORD count; va_list arguments; LoadStringW(GetModuleHandleW(NULL), msg, fmt, sizeof(fmt)); va_start(arguments, msg); len = vsprintfW(str, fmt, arguments); - WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &count, NULL); + output_write(str, len); va_end(arguments); return 0; } @@ -48,9 +74,7 @@ static BOOL output_error_string(DWORD error) FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error, 0, (LPWSTR)&pBuffer, 0, NULL)) { - DWORD count; - int len = lstrlenW(pBuffer); - WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, len, &count, NULL); + output_write(pBuffer, lstrlenW(pBuffer)); LocalFree(pBuffer); return TRUE; }
1
0
0
0
Francois Gouget : net: Convert to Unicode.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: d8624c0445d947a3d4e8e3f0014219f1a9a9d9dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8624c0445d947a3d4e8e3f00…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Aug 5 12:19:06 2011 +0200 net: Convert to Unicode. --- po/ar.po | 2 +- po/bg.po | 2 +- po/ca.po | 2 +- po/cs.po | 2 +- po/da.po | 4 +- po/de.po | 4 +- po/el.po | 2 +- po/en.po | 4 +- po/en_US.po | 4 +- po/eo.po | 2 +- po/es.po | 2 +- po/fa.po | 2 +- po/fi.po | 2 +- po/fr.po | 4 +- po/he.po | 4 +- po/hi.po | 2 +- po/hu.po | 2 +- po/it.po | 4 +- po/ja.po | 4 +- po/ko.po | 4 +- po/lt.po | 4 +- po/ml.po | 2 +- po/nb_NO.po | 4 +- po/nl.po | 4 +- po/or.po | 2 +- po/pa.po | 2 +- po/pl.po | 4 +- po/pt_BR.po | 4 +- po/pt_PT.po | 4 +- po/rm.po | 2 +- po/ro.po | 4 +- po/ru.po | 4 +- po/sk.po | 2 +- po/sl.po | 4 +- po/sr_RS(a)cyrillic.po | 2 +- po/sr_RS(a)latin.po | 2 +- po/sv.po | 4 +- po/te.po | 2 +- po/th.po | 2 +- po/tr.po | 2 +- po/uk.po | 4 +- po/wa.po | 2 +- po/wine.pot | 2 +- po/zh_CN.po | 2 +- po/zh_TW.po | 2 +- programs/net/Makefile.in | 2 +- programs/net/net.c | 65 ++++++++++++++++++++++++++++----------------- programs/net/net.rc | 2 +- 48 files changed, 107 insertions(+), 92 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=d8624c0445d947a3d4e8e…
1
0
0
0
Hans Leidekker : winhttp: Don't depend on shlwapi for decoding a URL.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: 9432b8e796d237e98392f8be14add1fb262079bb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9432b8e796d237e98392f8be1…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Aug 5 15:00:19 2011 +0200 winhttp: Don't depend on shlwapi for decoding a URL. --- dlls/winhttp/Makefile.in | 2 +- dlls/winhttp/url.c | 53 ++++++++++++++++++++++++--------------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/dlls/winhttp/Makefile.in b/dlls/winhttp/Makefile.in index d64cd70..f89cdab 100644 --- a/dlls/winhttp/Makefile.in +++ b/dlls/winhttp/Makefile.in @@ -1,6 +1,6 @@ MODULE = winhttp.dll IMPORTLIB = winhttp -IMPORTS = uuid shlwapi user32 advapi32 +IMPORTS = uuid user32 advapi32 DELAYIMPORTS = oleaut32 crypt32 EXTRALIBS = @SOCKETLIBS@ diff --git a/dlls/winhttp/url.c b/dlls/winhttp/url.c index 6ead33c..a662855 100644 --- a/dlls/winhttp/url.c +++ b/dlls/winhttp/url.c @@ -61,12 +61,32 @@ static BOOL set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len, return TRUE; } -static BOOL decode_url( LPCWSTR url, LPWSTR buffer, LPDWORD buflen ) +static WCHAR *decode_url( LPCWSTR url, DWORD *len ) { - HRESULT hr = UrlCanonicalizeW( url, buffer, buflen, URL_WININET_COMPATIBILITY | URL_UNESCAPE ); - if (hr == E_POINTER) set_last_error( ERROR_INSUFFICIENT_BUFFER ); - if (hr == E_INVALIDARG) set_last_error( ERROR_INVALID_PARAMETER ); - return (SUCCEEDED(hr)) ? TRUE : FALSE; + const WCHAR *p = url; + WCHAR hex[3], *q, *ret; + + if (!(ret = heap_alloc( *len * sizeof(WCHAR) ))) return NULL; + q = ret; + while (*len > 0) + { + if (p[0] == '%' && isxdigitW( p[1] ) && isxdigitW( p[2] )) + { + hex[0] = p[1]; + hex[1] = p[2]; + hex[2] = 0; + *q++ = strtolW( hex, NULL, 16 ); + p += 3; + *len -= 3; + } + else + { + *q++ = *p++; + *len -= 1; + } + } + *len = q - ret; + return ret; } /*********************************************************************** @@ -75,8 +95,7 @@ static BOOL decode_url( LPCWSTR url, LPWSTR buffer, LPDWORD buflen ) BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW uc ) { BOOL ret = FALSE; - WCHAR *p, *q, *r; - WCHAR *url_decoded = NULL; + WCHAR *p, *q, *r, *url_decoded = NULL; TRACE("%s, %d, %x, %p\n", debugstr_w(url), len, flags, uc); @@ -91,28 +110,12 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN if (flags & ICU_DECODE) { - WCHAR *url_tmp; - DWORD url_len = len + 1; - - if (!(url_tmp = HeapAlloc( GetProcessHeap(), 0, url_len * sizeof(WCHAR) ))) - { - set_last_error( ERROR_OUTOFMEMORY ); - return FALSE; - } - memcpy( url_tmp, url, len * sizeof(WCHAR) ); - url_tmp[len] = 0; - if (!(url_decoded = HeapAlloc( GetProcessHeap(), 0, url_len * sizeof(WCHAR) ))) + if (!(url_decoded = decode_url( url, &len ))) { - HeapFree( GetProcessHeap(), 0, url_tmp ); set_last_error( ERROR_OUTOFMEMORY ); return FALSE; } - if (decode_url( url_tmp, url_decoded, &url_len )) - { - len = url_len; - url = url_decoded; - } - HeapFree( GetProcessHeap(), 0, url_tmp ); + url = url_decoded; } if (!(p = strchrW( url, ':' ))) {
1
0
0
0
Huw Davies : gdi32: Simplify dibdrv_GetImage by merging the stand-alone and selected bitmap cases .
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: c5f484597f4660b5b71c3a84122d9baf69236127 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5f484597f4660b5b71c3a841…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Aug 5 13:20:32 2011 +0100 gdi32: Simplify dibdrv_GetImage by merging the stand-alone and selected bitmap cases. --- dlls/gdi32/dibdrv/dc.c | 74 +++++++++++++++++------------------------------- 1 files changed, 26 insertions(+), 48 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index b0fe47f..6ffb554 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -380,6 +380,9 @@ static void set_color_info( const dib_info *dib, BITMAPINFO *info ) static DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, struct gdi_image_bits *bits, struct bitblt_coords *src ) { + DWORD ret = ERROR_SUCCESS; + dib_info *dib, stand_alone; + TRACE( "%p %p %p\n", dev, hbitmap, info ); info->bmiHeader.biSize = sizeof(info->bmiHeader); @@ -397,64 +400,39 @@ static DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, if (!bmp) return ERROR_INVALID_HANDLE; assert(bmp->dib); - info->bmiHeader.biWidth = bmp->dib->dsBmih.biWidth; - info->bmiHeader.biHeight = bmp->dib->dsBmih.biHeight; - info->bmiHeader.biBitCount = bmp->dib->dsBmih.biBitCount; - info->bmiHeader.biSizeImage = get_dib_image_size( (BITMAPINFO *)&bmp->dib->dsBmih ); - - switch (info->bmiHeader.biBitCount) - { - case 1: - case 4: - case 8: - if (bmp->color_table) - { - info->bmiHeader.biClrUsed = min( bmp->nb_colors, 1 << info->bmiHeader.biBitCount ); - memcpy( info->bmiColors, bmp->color_table, info->bmiHeader.biClrUsed * sizeof(RGBQUAD) ); - } - break; - case 16: - info->bmiHeader.biCompression = BI_BITFIELDS; - memcpy( info->bmiColors, bmp->dib->dsBitfields, sizeof(bmp->dib->dsBitfields) ); - break; - case 32: - if (bmp->dib->dsBmih.biCompression == BI_BITFIELDS && - memcmp( bmp->dib->dsBitfields, bit_fields_888, sizeof(bmp->dib->dsBitfields) )) - { - info->bmiHeader.biCompression = BI_BITFIELDS; - memcpy( info->bmiColors, bmp->dib->dsBitfields, sizeof(bmp->dib->dsBitfields) ); - } - break; - } - if (bits) + if (!init_dib_info( &stand_alone, &bmp->dib->dsBmih, bmp->dib->dsBitfields, + bmp->color_table, bmp->nb_colors, bmp->dib->dsBm.bmBits, 0 )) { - bits->ptr = bmp->dib->dsBm.bmBits; - bits->is_copy = FALSE; - bits->free = NULL; + ret = ERROR_BAD_FORMAT; + goto done; } - GDI_ReleaseObj( hbitmap ); + dib = &stand_alone; } else { dibdrv_physdev *pdev = get_dibdrv_pdev(dev); + dib = &pdev->dib; + } - info->bmiHeader.biWidth = pdev->dib.width; - info->bmiHeader.biHeight = pdev->dib.stride > 0 ? -pdev->dib.height : pdev->dib.height; - info->bmiHeader.biBitCount = pdev->dib.bit_count; - info->bmiHeader.biSizeImage = pdev->dib.height * abs(pdev->dib.stride); + info->bmiHeader.biWidth = dib->width; + info->bmiHeader.biHeight = dib->stride > 0 ? -dib->height : dib->height; + info->bmiHeader.biBitCount = dib->bit_count; + info->bmiHeader.biSizeImage = dib->height * abs( dib->stride ); - set_color_info( &pdev->dib, info ); + set_color_info( dib, info ); - if (bits) - { - bits->ptr = pdev->dib.bits; - if (pdev->dib.stride < 0) - bits->ptr = (char *)bits->ptr + (pdev->dib.height - 1) * pdev->dib.stride; - bits->is_copy = FALSE; - bits->free = NULL; - } + if (bits) + { + bits->ptr = dib->bits; + if (dib->stride < 0) + bits->ptr = (char *)bits->ptr + (dib->height - 1) * dib->stride; + bits->is_copy = FALSE; + bits->free = NULL; } - return ERROR_SUCCESS; + +done: + if (hbitmap) GDI_ReleaseObj( hbitmap ); + return ret; } static BOOL matching_color_info( const dib_info *dib, const BITMAPINFO *info )
1
0
0
0
Huw Davies : gdi32: Fix dibdrv_PutImage for the selected bitmap case.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: 37423cec7c7d8d651c28485968f3006270f6acb1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37423cec7c7d8d651c2848596…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Aug 5 13:20:31 2011 +0100 gdi32: Fix dibdrv_PutImage for the selected bitmap case. --- dlls/gdi32/dibdrv/dc.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index b5f4f2b..b0fe47f 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -542,7 +542,10 @@ static DWORD dibdrv_PutImage( PHYSDEV dev, HBITMAP hbitmap, HRGN clip, BITMAPINF dib = &stand_alone; } else + { + pdev = get_dibdrv_pdev( dev ); dib = &pdev->dib; + } if (info->bmiHeader.biPlanes != 1) goto update_format; if (info->bmiHeader.biBitCount != dib->bit_count) goto update_format;
1
0
0
0
Michael Stefaniuc : dpnet: COM cleanup for the IDirectPlay8LobbiedApplication iface.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: 3a9fa9025701a52fcb5a66a7c22cc0654bffd995 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a9fa9025701a52fcb5a66a7c…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Aug 5 13:14:21 2011 +0200 dpnet: COM cleanup for the IDirectPlay8LobbiedApplication iface. --- dlls/dpnet/dpnet_private.h | 6 +-- dlls/dpnet/lobbiedapp.c | 117 ++++++++++++++++++++++--------------------- 2 files changed, 62 insertions(+), 61 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=3a9fa9025701a52fcb5a6…
1
0
0
0
Michael Stefaniuc : dpnet: COM cleanup for the IDirectPlay8ThreadPool iface .
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: 41059e1606a46bd8a52285d7eb24d5b837620b61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41059e1606a46bd8a52285d7e…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Fri Aug 5 13:12:43 2011 +0200 dpnet: COM cleanup for the IDirectPlay8ThreadPool iface. --- dlls/dpnet/dpnet_private.h | 5 ++--- dlls/dpnet/threadpool.c | 39 +++++++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/dlls/dpnet/dpnet_private.h b/dlls/dpnet/dpnet_private.h index 8207a67..9254295 100644 --- a/dlls/dpnet/dpnet_private.h +++ b/dlls/dpnet/dpnet_private.h @@ -93,9 +93,8 @@ struct IDirectPlay8PeerImpl */ struct IDirectPlay8ThreadPoolImpl { - /* IUnknown fields */ - const IDirectPlay8ThreadPoolVtbl *lpVtbl; - LONG ref; + IDirectPlay8ThreadPool IDirectPlay8ThreadPool_iface; + LONG ref; }; /** diff --git a/dlls/dpnet/threadpool.c b/dlls/dpnet/threadpool.c index f94a3fa..274789d 100644 --- a/dlls/dpnet/threadpool.c +++ b/dlls/dpnet/threadpool.c @@ -37,11 +37,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(dpnet); -/* IUnknown interface follows */ +static inline IDirectPlay8ThreadPoolImpl *impl_from_IDirectPlay8ThreadPool(IDirectPlay8ThreadPool *iface) +{ + return CONTAINING_RECORD(iface, IDirectPlay8ThreadPoolImpl, IDirectPlay8ThreadPool_iface); +} -static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_QueryInterface(PDIRECTPLAY8THREADPOOL iface, REFIID riid, LPVOID *ppobj) +/* IUnknown interface follows */ +static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_QueryInterface(IDirectPlay8ThreadPool *iface, + REFIID riid, void **ppobj) { - IDirectPlay8ThreadPoolImpl *This = (IDirectPlay8ThreadPoolImpl*)iface; + IDirectPlay8ThreadPoolImpl *This = impl_from_IDirectPlay8ThreadPool(iface); if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectPlay8ThreadPool)) @@ -55,17 +60,17 @@ static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_QueryInterface(PDIRECTPLAY8THRE return E_NOINTERFACE; } -static ULONG WINAPI IDirectPlay8ThreadPoolImpl_AddRef(PDIRECTPLAY8THREADPOOL iface) +static ULONG WINAPI IDirectPlay8ThreadPoolImpl_AddRef(IDirectPlay8ThreadPool *iface) { - IDirectPlay8ThreadPoolImpl* This = (IDirectPlay8ThreadPoolImpl*)iface; + IDirectPlay8ThreadPoolImpl* This = impl_from_IDirectPlay8ThreadPool(iface); ULONG RefCount = InterlockedIncrement(&This->ref); return RefCount; } -static ULONG WINAPI IDirectPlay8ThreadPoolImpl_Release(PDIRECTPLAY8THREADPOOL iface) +static ULONG WINAPI IDirectPlay8ThreadPoolImpl_Release(IDirectPlay8ThreadPool *iface) { - IDirectPlay8ThreadPoolImpl* This = (IDirectPlay8ThreadPoolImpl*)iface; + IDirectPlay8ThreadPoolImpl* This = impl_from_IDirectPlay8ThreadPool(iface); ULONG RefCount = InterlockedDecrement(&This->ref); if(!RefCount) @@ -75,31 +80,36 @@ static ULONG WINAPI IDirectPlay8ThreadPoolImpl_Release(PDIRECTPLAY8THREADPOOL if } /* IDirectPlay8ThreadPool interface follows */ -static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Initialize(PDIRECTPLAY8THREADPOOL iface, PVOID CONST pvUserContext, CONST PFNDPNMESSAGEHANDLER pfn, CONST DWORD dwFlags) +static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Initialize(IDirectPlay8ThreadPool *iface, + void * const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) { FIXME("(%p)->(%p,%p,%x): stub\n", iface, pvUserContext, pfn, dwFlags); return DPN_OK; } -static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Close(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwFlags) +static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_Close(IDirectPlay8ThreadPool *iface, + const DWORD dwFlags) { return DPN_OK; } -static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_GetThreadCount(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwProcessorNum, DWORD* CONST pdwNumThreads, CONST DWORD dwFlags) +static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_GetThreadCount(IDirectPlay8ThreadPool *iface, + const DWORD dwProcessorNum, DWORD * const pdwNumThreads, const DWORD dwFlags) { FIXME("(%p)->(%x,%p,%x): stub\n", iface, dwProcessorNum, pdwNumThreads, dwFlags); *pdwNumThreads = 0; return DPN_OK; } -static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_SetThreadCount(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwProcessorNum, CONST DWORD dwNumThreads, CONST DWORD dwFlags) +static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_SetThreadCount(IDirectPlay8ThreadPool *iface, + const DWORD dwProcessorNum, const DWORD dwNumThreads, const DWORD dwFlags) { FIXME("(%p)->(%x,%x,%x): stub\n", iface, dwProcessorNum, dwNumThreads, dwFlags); return DPN_OK; } -static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_DoWork(PDIRECTPLAY8THREADPOOL iface, CONST DWORD dwAllowedTimeSlice, CONST DWORD dwFlags) +static HRESULT WINAPI IDirectPlay8ThreadPoolImpl_DoWork(IDirectPlay8ThreadPool *iface, + const DWORD dwAllowedTimeSlice, const DWORD dwFlags) { static BOOL Run = FALSE; @@ -136,8 +146,9 @@ HRESULT DPNET_CreateDirectPlay8ThreadPool(LPCLASSFACTORY iface, LPUNKNOWN punkOu return E_OUTOFMEMORY; } - Client->lpVtbl = &DirectPlay8ThreadPool_Vtbl; + Client->IDirectPlay8ThreadPool_iface.lpVtbl = &DirectPlay8ThreadPool_Vtbl; Client->ref = 0; - return IDirectPlay8ThreadPoolImpl_QueryInterface((PDIRECTPLAY8THREADPOOL)Client, riid, ppobj); + return IDirectPlay8ThreadPoolImpl_QueryInterface(&Client->IDirectPlay8ThreadPool_iface, riid, + ppobj); }
1
0
0
0
Jörg Höhle : winmm: Remove redundant code.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: 2e01ea4bda091cad35b851b269887cff007502eb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e01ea4bda091cad35b851b26…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Jul 27 23:44:09 2011 +0200 winmm: Remove redundant code. --- dlls/winmm/waveform.c | 43 ------------------------------------------- 1 files changed, 0 insertions(+), 43 deletions(-) diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c index bdac0a8..820d228 100644 --- a/dlls/winmm/waveform.c +++ b/dlls/winmm/waveform.c @@ -940,7 +940,6 @@ static LRESULT WOD_Open(WINMM_OpenInfo *info) { WINMM_MMDevice *mmdevice; WINMM_Device *device = NULL; - WINMM_CBInfo cb_info; LRESULT ret = MMSYSERR_ERROR; HRESULT hr; @@ -980,8 +979,6 @@ static LRESULT WOD_Open(WINMM_OpenInfo *info) goto error; } - memcpy(&cb_info, &device->cb_info, sizeof(cb_info)); - LeaveCriticalSection(&device->lock); return MMSYSERR_NOERROR; @@ -1016,7 +1013,6 @@ static LRESULT WID_Open(WINMM_OpenInfo *info) { WINMM_MMDevice *mmdevice; WINMM_Device *device = NULL; - WINMM_CBInfo cb_info; LRESULT ret = MMSYSERR_ERROR; HRESULT hr; @@ -1049,8 +1045,6 @@ static LRESULT WID_Open(WINMM_OpenInfo *info) goto error; } - memcpy(&cb_info, &device->cb_info, sizeof(cb_info)); - LeaveCriticalSection(&device->lock); return MMSYSERR_NOERROR; @@ -1106,7 +1100,6 @@ static HRESULT WINMM_CloseDevice(WINMM_Device *device) static LRESULT WOD_Close(HWAVEOUT hwave) { WINMM_Device *device = WINMM_GetDeviceFromHWAVE((HWAVE)hwave); - WINMM_CBInfo cb_info; TRACE("(%p)\n", hwave); @@ -1121,8 +1114,6 @@ static LRESULT WOD_Close(HWAVEOUT hwave) IAudioStreamVolume_Release(device->volume); device->volume = NULL; - memcpy(&cb_info, &device->cb_info, sizeof(cb_info)); - LeaveCriticalSection(&device->lock); return MMSYSERR_NOERROR; @@ -1131,7 +1122,6 @@ static LRESULT WOD_Close(HWAVEOUT hwave) static LRESULT WID_Close(HWAVEIN hwave) { WINMM_Device *device = WINMM_GetDeviceFromHWAVE((HWAVE)hwave); - WINMM_CBInfo cb_info; TRACE("(%p)\n", hwave); @@ -1143,8 +1133,6 @@ static LRESULT WID_Close(HWAVEIN hwave) IAudioCaptureClient_Release(device->capture); device->capture = NULL; - memcpy(&cb_info, &device->cb_info, sizeof(cb_info)); - LeaveCriticalSection(&device->lock); return MMSYSERR_NOERROR; @@ -1637,8 +1625,6 @@ static HRESULT WINMM_BeginPlaying(WINMM_Device *device) TRACE("(%p)\n", device->handle); - EnterCriticalSection(&device->lock); - if(device->render) /* prebuffer data before starting */ WOD_PushData(device); @@ -1649,14 +1635,11 @@ static HRESULT WINMM_BeginPlaying(WINMM_Device *device) hr = IAudioClient_Start(device->client); if(FAILED(hr) && hr != AUDCLNT_E_NOT_STOPPED){ device->stopped = TRUE; - LeaveCriticalSection(&device->lock); ERR("Start failed: %08x\n", hr); return hr; } } - LeaveCriticalSection(&device->lock); - return S_OK; } @@ -2304,7 +2287,6 @@ MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, DWORD_PTR dwInstance, DWORD dwFlags) { LRESULT res; - HRESULT hr; WINMM_OpenInfo info; WINMM_CBInfo cb_info; @@ -2317,11 +2299,6 @@ MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, if(!lphWaveOut && !(dwFlags & WAVE_FORMAT_QUERY)) return MMSYSERR_INVALPARAM; - hr = WINMM_StartDevicesThread(); - if(FAILED(hr)){ - ERR("Couldn't start the device thread: %08x\n", hr); - return MMSYSERR_ERROR; - } res = WINMM_CheckCallback(dwCallback, dwFlags, FALSE); if(res != MMSYSERR_NOERROR) return res; @@ -2955,7 +2932,6 @@ MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID, DWORD_PTR dwInstance, DWORD dwFlags) { LRESULT res; - HRESULT hr; WINMM_OpenInfo info; WINMM_CBInfo cb_info; @@ -2968,11 +2944,6 @@ MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID, if(!lphWaveIn && !(dwFlags & WAVE_FORMAT_QUERY)) return MMSYSERR_INVALPARAM; - hr = WINMM_StartDevicesThread(); - if(FAILED(hr)){ - ERR("Couldn't start the device thread: %08x\n", hr); - return MMSYSERR_ERROR; - } res = WINMM_CheckCallback(dwCallback, dwFlags, FALSE); if(res != MMSYSERR_NOERROR) return res; @@ -3409,7 +3380,6 @@ UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW DWORD fdwDetails) { WINMM_ControlDetails details; - HRESULT hr; TRACE("(%p, %p, %x)\n", hmix, lpmcdW, fdwDetails); @@ -3421,12 +3391,6 @@ UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW TRACE("dwControlID: %u\n", lpmcdW->dwControlID); - hr = WINMM_StartDevicesThread(); - if(FAILED(hr)){ - ERR("Couldn't start the device thread: %08x\n", hr); - return MMSYSERR_ERROR; - } - details.hmix = hmix; details.details = lpmcdW; details.flags = fdwDetails; @@ -3944,7 +3908,6 @@ UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails) { WINMM_ControlDetails details; - HRESULT hr; TRACE("(%p, %p, %x)\n", hmix, lpmcd, fdwDetails); @@ -3960,12 +3923,6 @@ UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, TRACE("dwControlID: %u\n", lpmcd->dwControlID); - hr = WINMM_StartDevicesThread(); - if(FAILED(hr)){ - ERR("Couldn't start the device thread: %08x\n", hr); - return MMSYSERR_ERROR; - } - details.hmix = hmix; details.details = lpmcd; details.flags = fdwDetails;
1
0
0
0
Jörg Höhle : winmm: Restore checking of callback flags.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: 547f4cace9e654e4cdd3db2949337a5df4285322 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=547f4cace9e654e4cdd3db294…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Jul 27 23:44:09 2011 +0200 winmm: Restore checking of callback flags. --- dlls/winmm/waveform.c | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c index a571fb8..bdac0a8 100644 --- a/dlls/winmm/waveform.c +++ b/dlls/winmm/waveform.c @@ -300,19 +300,11 @@ static WINMM_Device *WINMM_GetDeviceFromHWAVE(HWAVE hwave) /* Note: NotifyClient should never be called while holding the device lock * since the client may call wave* functions from within the callback. */ -static DWORD WINMM_NotifyClient(WINMM_CBInfo *info, WORD msg, DWORD_PTR param1, +static inline void WINMM_NotifyClient(WINMM_CBInfo *info, WORD msg, DWORD_PTR param1, DWORD_PTR param2) { - TRACE("(%p, %u, %lx, %lx)\n", info->hwave, msg, param1, param2); - - if((info->flags & DCB_TYPEMASK) == DCB_NULL) - return MMSYSERR_NOERROR; - - if(!DriverCallback(info->callback, info->flags, (HDRVR)info->hwave, - msg, info->user, param1, param2)) - return MMSYSERR_ERROR; - - return MMSYSERR_NOERROR; + DriverCallback(info->callback, info->flags, (HDRVR)info->hwave, + msg, info->user, param1, param2); } static HRESULT WINMM_GetFriendlyName(IMMDevice *device, WCHAR *out, @@ -2330,6 +2322,9 @@ MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, ERR("Couldn't start the device thread: %08x\n", hr); return MMSYSERR_ERROR; } + res = WINMM_CheckCallback(dwCallback, dwFlags, FALSE); + if(res != MMSYSERR_NOERROR) + return res; info.format = (WAVEFORMATEX*)lpFormat; info.callback = dwCallback; @@ -2978,6 +2973,9 @@ MMRESULT WINAPI waveInOpen(HWAVEIN* lphWaveIn, UINT uDeviceID, ERR("Couldn't start the device thread: %08x\n", hr); return MMSYSERR_ERROR; } + res = WINMM_CheckCallback(dwCallback, dwFlags, FALSE); + if(res != MMSYSERR_NOERROR) + return res; info.format = (WAVEFORMATEX*)lpFormat; info.callback = dwCallback; @@ -3347,13 +3345,13 @@ UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, if(!lphMix) return MMSYSERR_INVALPARAM; - if(uDeviceID >= g_outmmdevices_count + g_inmmdevices_count) - return MMSYSERR_BADDEVICEID; - mr = WINMM_CheckCallback(dwCallback, fdwOpen, TRUE); if(mr != MMSYSERR_NOERROR) return mr; + if(uDeviceID >= g_outmmdevices_count + g_inmmdevices_count) + return MMSYSERR_BADDEVICEID; + if(uDeviceID < g_outmmdevices_count){ mmdevice = &g_out_mmdevices[uDeviceID]; *lphMix = (HMIXER)WINMM_MakeHWAVE(uDeviceID, TRUE,
1
0
0
0
Jörg Höhle : winmm: Fix logic conditions.
by Alexandre Julliard
05 Aug '11
05 Aug '11
Module: wine Branch: master Commit: b9de906ac10176f956333dadb3a18d03690085df URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b9de906ac10176f956333dadb…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed Jul 27 23:44:09 2011 +0200 winmm: Fix logic conditions. --- dlls/winmm/waveform.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c index 160395c..a571fb8 100644 --- a/dlls/winmm/waveform.c +++ b/dlls/winmm/waveform.c @@ -706,9 +706,9 @@ static MMRESULT WINMM_MapDevice(WINMM_OpenInfo *info, BOOL is_out) } /* no direct match, so set up the ACM stream */ - if(info->format->wFormatTag != WAVE_FORMAT_PCM || - (info->format->wFormatTag == WAVE_FORMAT_EXTENSIBLE && - !IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))){ + if(info->format->wFormatTag != WAVE_FORMAT_PCM && + !(info->format->wFormatTag == WAVE_FORMAT_EXTENSIBLE && + IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))){ /* convert to PCM format if it's not already */ mr = WINMM_TryDeviceMapping(info, info->format->nChannels, info->format->nSamplesPerSec, 16, is_out); @@ -889,6 +889,8 @@ static LRESULT WINMM_OpenDevice(WINMM_Device *device, WINMM_MMDevice *mmdevice, goto error; } + /* As the devices thread is waiting on g_device_handles, it can + * only be modified from within this same thread. */ if(g_device_handles){ g_device_handles = HeapReAlloc(GetProcessHeap(), 0, g_device_handles, sizeof(HANDLE) * (g_devhandle_count + 1)); @@ -2087,11 +2089,11 @@ static DWORD WINAPI WINMM_DevicesThreadProc(void *arg) DWORD wait; wait = MsgWaitForMultipleObjects(g_devhandle_count, g_device_handles, FALSE, INFINITE, QS_ALLINPUT); - if(wait == g_devhandle_count - WAIT_OBJECT_0){ + if(wait == g_devhandle_count + WAIT_OBJECT_0){ MSG msg; if(PeekMessageW(&msg, g_devices_hwnd, 0, 0, PM_REMOVE)) ERR("Unexpected message: 0x%x\n", msg.message); - }else if(wait < g_devhandle_count){ + }else if(wait < g_devhandle_count + WAIT_OBJECT_0){ WINMM_Device *device = g_handle_devices[wait - WAIT_OBJECT_0]; if(device->render) WOD_PushData(device); @@ -2149,7 +2151,7 @@ static BOOL WINMM_StartDevicesThread(void) wait = WaitForMultipleObjects(2, events, FALSE, INFINITE); CloseHandle(events[0]); if(wait != WAIT_OBJECT_0){ - if(wait == 1 - WAIT_OBJECT_0){ + if(wait == 1 + WAIT_OBJECT_0){ CloseHandle(g_devices_thread); g_devices_thread = NULL; g_devices_hwnd = NULL;
1
0
0
0
← Newer
1
...
51
52
53
54
55
56
57
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200