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
July 2017
----- 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
632 discussions
Start a n
N
ew thread
Stefan Dösinger : msvcp140: Implement _Stat and _Lstat.
by Alexandre Julliard
17 Jul '17
17 Jul '17
Module: wine Branch: master Commit: 621e96bfdb55182dbaf89a1500971ebcf547c0b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=621e96bfdb55182dbaf89a150…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Jul 17 14:23:50 2017 +0200 msvcp140: Implement _Stat and _Lstat. Signed-off-by: Stefan Dösinger <stefan(a)codeweavers.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcp140/msvcp140.spec | 4 +- dlls/msvcp140/tests/msvcp140.c | 149 +++++++++++++++++++++++++++++++++++++++++ dlls/msvcp90/ios.c | 59 +++++++++++++++- 3 files changed, 207 insertions(+), 5 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=621e96bfdb55182dbaf89…
1
0
0
0
Nikolay Sivov : msacm32/tests: Fix a memory leak in tests (Valgrind).
by Alexandre Julliard
17 Jul '17
17 Jul '17
Module: wine Branch: master Commit: f03b8a42f97f87bfaac1e30a37e6e18b9bd48c81 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f03b8a42f97f87bfaac1e30a3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jul 14 08:23:37 2017 +0300 msacm32/tests: Fix a memory leak in tests (Valgrind). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msacm32/tests/msacm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/msacm32/tests/msacm.c b/dlls/msacm32/tests/msacm.c index 337e20c..959ec7f 100644 --- a/dlls/msacm32/tests/msacm.c +++ b/dlls/msacm32/tests/msacm.c @@ -1272,6 +1272,8 @@ static void test_acmFormatChoose(void) rc = acmFormatChooseW(&afc); ok(rc == MMSYSERR_INVALPARAM, "expected 0xb, got 0x%x\n", rc); afc.pwfx = pwfx; + + HeapFree(GetProcessHeap(), 0, pwfx); } static struct
1
0
0
0
Alexandre Julliard : winex11: Store the process name at startup to avoid grabbing the loader lock again.
by Alexandre Julliard
17 Jul '17
17 Jul '17
Module: wine Branch: master Commit: fc21a83a91c527d85a7b7be1d54700b9b88058d4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fc21a83a91c527d85a7b7be1d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 17 11:12:48 2017 +0200 winex11: Store the process name at startup to avoid grabbing the loader lock again. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/window.c | 33 --------------------------------- dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 21 ++++++++++++++------- 3 files changed, 15 insertions(+), 40 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index eaf6dcf..d35328c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -803,38 +803,6 @@ static void set_style_hints( struct x11drv_win_data *data, DWORD style, DWORD ex /*********************************************************************** - * get_process_name - * - * get the name of the current process for setting class hints - */ -static char *get_process_name(void) -{ - static char *name; - - if (!name) - { - WCHAR module[MAX_PATH]; - DWORD len = GetModuleFileNameW( 0, module, MAX_PATH ); - if (len && len < MAX_PATH) - { - char *ptr; - WCHAR *p, *appname = module; - - if ((p = strrchrW( appname, '/' ))) appname = p + 1; - if ((p = strrchrW( appname, '\\' ))) appname = p + 1; - len = WideCharToMultiByte( CP_UNIXCP, 0, appname, -1, NULL, 0, NULL, NULL ); - if ((ptr = HeapAlloc( GetProcessHeap(), 0, len ))) - { - WideCharToMultiByte( CP_UNIXCP, 0, appname, -1, ptr, len, NULL, NULL ); - name = ptr; - } - } - } - return name; -} - - -/*********************************************************************** * set_initial_wm_hints * * Set the window manager hints that don't change over the lifetime of a window. @@ -845,7 +813,6 @@ static void set_initial_wm_hints( Display *display, Window window ) Atom protocols[3]; Atom dndVersion = WINE_XDND_VERSION; XClassHint *class_hints; - char *process_name = get_process_name(); /* wm protocols */ i = 0; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index f125289..721c082 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -395,6 +395,7 @@ extern int copy_default_colors DECLSPEC_HIDDEN; extern int alloc_system_colors DECLSPEC_HIDDEN; extern int xrender_error_base DECLSPEC_HIDDEN; extern HMODULE x11drv_module DECLSPEC_HIDDEN; +extern char *process_name DECLSPEC_HIDDEN; extern Display *clipboard_display DECLSPEC_HIDDEN; /* atoms */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 2127df4..65ef59b 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -49,6 +49,7 @@ #include "x11drv.h" #include "xcomposite.h" #include "wine/server.h" +#include "wine/unicode.h" #include "wine/debug.h" #include "wine/library.h" @@ -84,6 +85,7 @@ int alloc_system_colors = 256; DWORD thread_data_tls_index = TLS_OUT_OF_INDEXES; int xrender_error_base = 0; HMODULE x11drv_module = 0; +char *process_name = NULL; static x11drv_error_callback err_callback; /* current callback for error */ static Display *err_callback_display; /* display callback is set for */ @@ -323,7 +325,9 @@ static inline DWORD get_config_key( HKEY defkey, HKEY appkey, const char *name, */ static void setup_options(void) { - char buffer[MAX_PATH+16]; + static const WCHAR x11driverW[] = {'\\','X','1','1',' ','D','r','i','v','e','r',0}; + char buffer[64]; + WCHAR bufferW[MAX_PATH+16]; HKEY hkey, appkey = 0; DWORD len; @@ -332,18 +336,21 @@ static void setup_options(void) /* open the app-specific key */ - len = (GetModuleFileNameA( 0, buffer, MAX_PATH )); + len = (GetModuleFileNameW( 0, bufferW, MAX_PATH )); if (len && len < MAX_PATH) { HKEY tmpkey; - char *p, *appname = buffer; - if ((p = strrchr( appname, '/' ))) appname = p + 1; - if ((p = strrchr( appname, '\\' ))) appname = p + 1; - strcat( appname, "\\X11 Driver" ); + WCHAR *p, *appname = bufferW; + if ((p = strrchrW( appname, '/' ))) appname = p + 1; + if ((p = strrchrW( appname, '\\' ))) appname = p + 1; + len = WideCharToMultiByte( CP_UNIXCP, 0, appname, -1, NULL, 0, NULL, NULL ); + if ((process_name = HeapAlloc( GetProcessHeap(), 0, len ))) + WideCharToMultiByte( CP_UNIXCP, 0, appname, -1, process_name, len, NULL, NULL ); + strcatW( appname, x11driverW ); /* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\X11 Driver */ if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\AppDefaults", &tmpkey )) { - if (RegOpenKeyA( tmpkey, appname, &appkey )) appkey = 0; + if (RegOpenKeyW( tmpkey, appname, &appkey )) appkey = 0; RegCloseKey( tmpkey ); } }
1
0
0
0
Alexandre Julliard : user32/tests: Add some tests for WindowFromDC and destroyed windows.
by Alexandre Julliard
17 Jul '17
17 Jul '17
Module: wine Branch: master Commit: 52d90e3ce0ed5a35bcb10723379a1702f8706cc8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=52d90e3ce0ed5a35bcb107233…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 17 09:54:45 2017 +0200 user32/tests: Add some tests for WindowFromDC and destroyed windows. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/dce.c | 103 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 87 insertions(+), 16 deletions(-) diff --git a/dlls/user32/tests/dce.c b/dlls/user32/tests/dce.c index 382d10a..25b0153 100644 --- a/dlls/user32/tests/dce.c +++ b/dlls/user32/tests/dce.c @@ -52,11 +52,14 @@ static void test_dc_attributes(void) rop = GetROP2( hdc ); ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( hdc ) == hwnd_cache, "wrong window\n" ); ReleaseDC( hwnd_cache, hdc ); + ok( WindowFromDC( hdc ) == 0, "wrong window\n" ); hdc = GetDC( hwnd_cache ); rop = GetROP2( hdc ); ok( rop == def_rop, "wrong ROP2 %d after release\n", rop ); SetROP2( hdc, R2_WHITE ); + ok( WindowFromDC( hdc ) == hwnd_cache, "wrong window\n" ); ReleaseDC( hwnd_cache, hdc ); old_hdc = hdc; @@ -115,6 +118,7 @@ static void test_dc_attributes(void) ok( rop == 0, "got %d\n", rop ); rop = GetROP2( old_hdc ); ok( rop == 0, "got %d\n", rop ); + ok( WindowFromDC( old_hdc ) == 0, "wrong window\n" ); /* test own DC */ @@ -124,11 +128,14 @@ static void test_dc_attributes(void) ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); old_hdc = hdc; + ok( WindowFromDC( hdc ) == hwnd_owndc, "wrong window\n" ); ReleaseDC( hwnd_owndc, hdc ); + ok( WindowFromDC( hdc ) == hwnd_owndc, "wrong window\n" ); hdc = GetDC( hwnd_owndc ); ok( old_hdc == hdc, "didn't get same DC %p/%p\n", old_hdc, hdc ); rop = GetROP2( hdc ); ok( rop == R2_WHITE, "wrong ROP2 %d after release\n", rop ); + ok( WindowFromDC( hdc ) == hwnd_owndc, "wrong window\n" ); ReleaseDC( hwnd_owndc, hdc ); rop = GetROP2( hdc ); ok( rop == R2_WHITE, "wrong ROP2 %d after second release\n", rop ); @@ -141,11 +148,14 @@ static void test_dc_attributes(void) ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); old_hdc = hdc; + ok( WindowFromDC( hdc ) == hwnd_classdc, "wrong window\n" ); ReleaseDC( hwnd_classdc, hdc ); + ok( WindowFromDC( hdc ) == hwnd_classdc, "wrong window\n" ); hdc = GetDC( hwnd_classdc ); ok( old_hdc == hdc, "didn't get same DC %p/%p\n", old_hdc, hdc ); rop = GetROP2( hdc ); ok( rop == R2_WHITE, "wrong ROP2 %d after release\n", rop ); + ok( WindowFromDC( hdc ) == hwnd_classdc, "wrong window\n" ); ReleaseDC( hwnd_classdc, hdc ); rop = GetROP2( hdc ); ok( rop == R2_WHITE, "wrong ROP2 %d after second release\n", rop ); @@ -154,12 +164,15 @@ static void test_dc_attributes(void) old_hdc = GetDC( hwnd_classdc ); SetROP2( old_hdc, R2_BLACK ); + ok( WindowFromDC( old_hdc ) == hwnd_classdc, "wrong window\n" ); hdc = GetDC( hwnd_classdc2 ); ok( old_hdc == hdc, "didn't get same DC %p/%p\n", old_hdc, hdc ); rop = GetROP2( hdc ); ok( rop == R2_BLACK, "wrong ROP2 %d for other window\n", rop ); + ok( WindowFromDC( hdc ) == hwnd_classdc2, "wrong window\n" ); ReleaseDC( hwnd_classdc, old_hdc ); ReleaseDC( hwnd_classdc, hdc ); + ok( WindowFromDC( hdc ) == hwnd_classdc2, "wrong window\n" ); rop = GetROP2( hdc ); ok( rop == R2_BLACK, "wrong ROP2 %d after release\n", rop ); } @@ -597,19 +610,83 @@ static void test_dc_layout(void) static void test_destroyed_window(void) { - HDC dc; + HDC dc, old_dc; + HDC hdcs[30]; + int i, rop; - dc = GetDCEx(hwnd_cache, 0, DCX_USESTYLE); - ok(!dc, "Got a non-NULL DC (%p) for a destroyed window.\n", dc); + dc = GetDC( hwnd_cache ); + SetROP2( dc, R2_WHITE ); + rop = GetROP2( dc ); + ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == hwnd_cache, "wrong window\n" ); + old_dc = dc; + + DestroyWindow( hwnd_cache ); + rop = GetROP2( dc ); + todo_wine ok( rop == 0, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == 0, "wrong window\n" ); + ok( !ReleaseDC( hwnd_cache, dc ), "ReleaseDC succeeded\n" ); + dc = GetDC( hwnd_cache ); + ok( !dc, "Got a non-NULL DC (%p) for a destroyed window\n", dc ); + + for (i = 0; i < 30; i++) + { + dc = hdcs[i] = GetDCEx( hwnd_parent, 0, DCX_CACHE | DCX_USESTYLE ); + if (dc == old_dc) break; + } + ok( i < 30, "DC for destroyed window not reused\n" ); + while (i > 0) ReleaseDC( hwnd_parent, hdcs[--i] ); + + dc = GetDC( hwnd_classdc ); + SetROP2( dc, R2_WHITE ); + rop = GetROP2( dc ); + ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == hwnd_classdc, "wrong window\n" ); + old_dc = dc; + + dc = GetDC( hwnd_classdc2 ); + ok( old_dc == dc, "wrong DC\n" ); + rop = GetROP2( dc ); + ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == hwnd_classdc2, "wrong window\n" ); + DestroyWindow( hwnd_classdc2 ); - dc = GetDCEx(hwnd_owndc, 0, DCX_USESTYLE); - ok(!dc, "Got a non-NULL DC (%p) for a destroyed window.\n", dc); + rop = GetROP2( dc ); + ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == 0, "wrong window\n" ); + todo_wine ok( !ReleaseDC( hwnd_classdc2, dc ), "ReleaseDC succeeded\n" ); + dc = GetDC( hwnd_classdc2 ); + ok( !dc, "Got a non-NULL DC (%p) for a destroyed window\n", dc ); + + dc = GetDC( hwnd_classdc ); + ok( dc != 0, "Got NULL DC\n" ); + rop = GetROP2( dc ); + todo_wine ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == hwnd_classdc, "wrong window\n" ); + DestroyWindow( hwnd_classdc ); + + rop = GetROP2( dc ); + todo_wine ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == 0, "wrong window\n" ); + todo_wine ok( !ReleaseDC( hwnd_classdc, dc ), "ReleaseDC succeeded\n" ); + dc = GetDC( hwnd_classdc ); + ok( !dc, "Got a non-NULL DC (%p) for a destroyed window\n", dc ); + + dc = GetDC( hwnd_owndc ); + ok( dc != 0, "Got NULL DC\n" ); + rop = GetROP2( dc ); + ok( rop == R2_WHITE, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == hwnd_owndc, "wrong window\n" ); + DestroyWindow( hwnd_owndc ); - dc = GetDCEx(hwnd_classdc, 0, DCX_USESTYLE); - ok(!dc, "Got a non-NULL DC (%p) for a destroyed window.\n", dc); + rop = GetROP2( dc ); + ok( rop == 0, "wrong ROP2 %d\n", rop ); + ok( WindowFromDC( dc ) == 0, "wrong window\n" ); + ok( !ReleaseDC( hwnd_owndc, dc ), "ReleaseDC succeeded\n" ); + dc = GetDC( hwnd_owndc ); + ok( !dc, "Got a non-NULL DC (%p) for a destroyed window\n", dc ); - dc = GetDCEx(hwnd_classdc2, 0, DCX_USESTYLE); - ok(!dc, "Got a non-NULL DC (%p) for a destroyed window.\n", dc); + DestroyWindow( hwnd_parent ); } START_TEST(dce) @@ -661,12 +738,6 @@ START_TEST(dce) test_scroll_window(); test_invisible_create(); test_dc_layout(); - - DestroyWindow(hwnd_parent); - DestroyWindow(hwnd_classdc2); - DestroyWindow(hwnd_classdc); - DestroyWindow(hwnd_owndc); - DestroyWindow(hwnd_cache); - + /* this should be last */ test_destroyed_window(); }
1
0
0
0
Marcus Meissner : gameux: Avoid freeing uninitialized interfaces (Coverity ).
by Alexandre Julliard
17 Jul '17
17 Jul '17
Module: wine Branch: master Commit: 08193ed72b2b134a2079d261944f456438460c8d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08193ed72b2b134a2079d2619…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Sat Jul 15 10:16:12 2017 +0200 gameux: Avoid freeing uninitialized interfaces (Coverity). Signed-off-by: Marcus Meissner <marcus(a)jet.franken.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gameux/gamestatistics.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c index b9e913e..0ee449a 100644 --- a/dlls/gameux/gamestatistics.c +++ b/dlls/gameux/gamestatistics.c @@ -111,9 +111,9 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) static const WCHAR sValue[] = {'V','a','l','u','e',0}; HRESULT hr = S_OK; - IXMLDOMDocument *document; - IXMLDOMElement *root, *statisticsElement; - IXMLDOMNode *categoryNode, *statisticsNode; + IXMLDOMDocument *document = NULL; + IXMLDOMElement *root = NULL, *statisticsElement = NULL; + IXMLDOMNode *categoryNode = NULL, *statisticsNode = NULL; VARIANT vStatsFilePath, vValue; BSTR bstrStatistics = NULL, bstrCategory = NULL, bstrIndex = NULL, bstrStatistic = NULL, bstrName = NULL, bstrValue = NULL; @@ -209,8 +209,7 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) hr = IXMLDOMElement_setAttribute(categoryElement, bstrName, vValue); } - if (categoryElement) - IXMLDOMElement_Release(categoryElement); + if (categoryElement) IXMLDOMElement_Release(categoryElement); SysFreeString(V_BSTR(&vValue)); @@ -266,15 +265,16 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) if(SUCCEEDED(hr)) hr = IXMLDOMNode_appendChild(categoryNode, statisticsNode, NULL); - IXMLDOMElement_Release(statisticsElement); - IXMLDOMNode_Release(statisticsNode); + if (statisticsElement) IXMLDOMElement_Release(statisticsElement); + if (statisticsNode) IXMLDOMNode_Release(statisticsNode); } } if(SUCCEEDED(hr)) hr = IXMLDOMElement_appendChild(root, categoryNode, &categoryNode); - IXMLDOMNode_Release(categoryNode); + if (categoryNode) + IXMLDOMNode_Release(categoryNode); if(FAILED(hr)) break; @@ -283,7 +283,7 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) if(SUCCEEDED(hr)) hr = IXMLDOMDocument_putref_documentElement(document, root); - IXMLDOMElement_Release(root); + if (root) IXMLDOMElement_Release(root); TRACE("saving game statistics in %s file\n", debugstr_w(stats->sStatsFile)); if(SUCCEEDED(hr)) @@ -292,7 +292,7 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats) if(SUCCEEDED(hr)) hr = IXMLDOMDocument_save(document, vStatsFilePath); - IXMLDOMDocument_Release(document); + if (document) IXMLDOMDocument_Release(document); SysFreeString(bstrValue); SysFreeString(bstrName); @@ -426,9 +426,9 @@ static HRESULT GAMEUX_loadStatisticsFromFile(struct GAMEUX_STATS *data) HRESULT hr = S_OK; IXMLDOMDocument *document = NULL; - IXMLDOMElement *root = NULL, *categoryElement, *statisticElement; - IXMLDOMNode *categoryNode, *statisticNode; - IXMLDOMNodeList *rootChildren = NULL, *categoryChildren; + IXMLDOMElement *root = NULL, *categoryElement = NULL, *statisticElement = NULL; + IXMLDOMNode *categoryNode = NULL, *statisticNode = NULL; + IXMLDOMNodeList *rootChildren = NULL, *categoryChildren = NULL; VARIANT vStatsFilePath, vValue; BSTR bstrStatistics = NULL, bstrCategory = NULL, bstrIndex = NULL, bstrStatistic = NULL, bstrName = NULL, bstrValue = NULL; @@ -571,22 +571,22 @@ static HRESULT GAMEUX_loadStatisticsFromFile(struct GAMEUX_STATS *data) debugstr_w(data->categories[i].stats[j].sName), debugstr_w(data->categories[i].stats[j].sValue)); } - IXMLDOMElement_Release(statisticElement); + if (statisticElement) IXMLDOMElement_Release(statisticElement); } - IXMLDOMNode_Release(statisticNode); + if (statisticNode) IXMLDOMNode_Release(statisticNode); } } - IXMLDOMNodeList_Release(categoryChildren); + if (categoryChildren) IXMLDOMNodeList_Release(categoryChildren); if(SUCCEEDED(hr)) hr = S_OK; } - IXMLDOMElement_Release(categoryElement); + if (categoryElement) IXMLDOMElement_Release(categoryElement); } - IXMLDOMNode_Release(categoryNode); + if (categoryNode) IXMLDOMNode_Release(categoryNode); } } if(SUCCEEDED(hr))
1
0
0
0
Alistair Leslie-Hughes : wmvcore: Support IWMReaderPlaylistBurn interface in IWMReader.
by Alexandre Julliard
17 Jul '17
17 Jul '17
Module: wine Branch: master Commit: 73f80669c6c6012e185b844c1a462473c1307403 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=73f80669c6c6012e185b844c1…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Sun Jul 16 09:49:09 2017 +0000 wmvcore: Support IWMReaderPlaylistBurn interface in IWMReader. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmvcore/tests/wmvcore.c | 6 ++++ dlls/wmvcore/wmvcore_main.c | 69 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 83c19da9..7099549 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -81,6 +81,7 @@ static void test_wmreader_interfaces(void) IWMDRMReader *drmreader; IWMDRMReader2 *drmreader2; IWMDRMReader3 *drmreader3; + IWMReaderPlaylistBurn *playlist; hr = WMCreateReader( NULL, 0, &reader ); ok(hr == S_OK, "WMCreateReader failed 0x%08x\n", hr); @@ -147,6 +148,9 @@ static void test_wmreader_interfaces(void) hr = IWMReader_QueryInterface(reader, &IID_IWMDRMReader3, (void **)&drmreader3); ok(hr == E_NOINTERFACE, "Failed 0x%08x\n", hr); + hr = IWMReader_QueryInterface(reader, &IID_IWMReaderPlaylistBurn, (void **)&playlist); + ok(hr == S_OK, "Failed 0x%08x\n", hr); + if(packet) IWMPacketSize_Release(packet); if(packet2) @@ -179,6 +183,8 @@ static void test_wmreader_interfaces(void) IWMReaderStreamClock_Release(clock); if(negotiation) IWMReaderTypeNegotiation_Release(negotiation); + if(playlist) + IWMReaderPlaylistBurn_Release(playlist); IWMReader_Release(reader); } diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c index f048b9b..980d51e 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c @@ -71,6 +71,7 @@ typedef struct { IWMReaderStreamClock IWMReaderStreamClock_iface; IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface; IWMReaderTimecode IWMReaderTimecode_iface; + IWMReaderPlaylistBurn IWMReaderPlaylistBurn_iface; LONG ref; } WMReader; @@ -125,6 +126,9 @@ static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID riid, voi }else if(IsEqualGUID(riid, &IID_IWMReaderTimecode)) { TRACE("(%p)->(IWMReaderTimecode %p)\n", This, ppv); *ppv = &This->IWMReaderTimecode_iface; + }else if(IsEqualGUID(riid, &IID_IWMReaderPlaylistBurn)) { + TRACE("(%p)->(IWMReaderPlaylistBurn %p)\n", This, ppv); + *ppv = &This->IWMReaderPlaylistBurn_iface; }else { *ppv = NULL; FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); @@ -1283,6 +1287,70 @@ static const IWMReaderTimecodeVtbl WMReaderTimecodeVtbl = timecode_GetTimecodeRangeBounds }; + +static inline WMReader *impl_from_IWMReaderPlaylistBurn(IWMReaderPlaylistBurn *iface) +{ + return CONTAINING_RECORD(iface, WMReader, IWMReaderPlaylistBurn_iface); +} + +static HRESULT WINAPI playlist_QueryInterface(IWMReaderPlaylistBurn *iface, REFIID riid, void **ppv) +{ + WMReader *This = impl_from_IWMReaderPlaylistBurn(iface); + return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); +} + +static ULONG WINAPI playlist_AddRef(IWMReaderPlaylistBurn *iface) +{ + WMReader *This = impl_from_IWMReaderPlaylistBurn(iface); + return IWMReader_AddRef(&This->IWMReader_iface); +} + +static ULONG WINAPI playlist_Release(IWMReaderPlaylistBurn *iface) +{ + WMReader *This = impl_from_IWMReaderPlaylistBurn(iface); + return IWMReader_Release(&This->IWMReader_iface); +} + +static HRESULT WINAPI playlist_InitPlaylistBurn(IWMReaderPlaylistBurn *iface, DWORD count, + LPCWSTR_WMSDK_TYPE_SAFE *filenames, IWMStatusCallback *callback, void *context) +{ + WMReader *This = impl_from_IWMReaderPlaylistBurn(iface); + FIXME("%p, %d, %p, %p, %p\n", This, count, filenames, callback, context); + return E_NOTIMPL; +} + +static HRESULT WINAPI playlist_GetInitResults(IWMReaderPlaylistBurn *iface, DWORD count, HRESULT *stat) +{ + WMReader *This = impl_from_IWMReaderPlaylistBurn(iface); + FIXME("%p, %d, %p\n", This, count, stat); + return E_NOTIMPL; +} + +static HRESULT WINAPI playlist_Cancel(IWMReaderPlaylistBurn *iface) +{ + WMReader *This = impl_from_IWMReaderPlaylistBurn(iface); + FIXME("%p\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI playlist_EndPlaylistBurn(IWMReaderPlaylistBurn *iface, HRESULT result) +{ + WMReader *This = impl_from_IWMReaderPlaylistBurn(iface); + FIXME("%p, 0x%08x\n", This, result); + return E_NOTIMPL; +} + +static const IWMReaderPlaylistBurnVtbl WMReaderPlaylistBurnVtbl = +{ + playlist_QueryInterface, + playlist_AddRef, + playlist_Release, + playlist_InitPlaylistBurn, + playlist_GetInitResults, + playlist_Cancel, + playlist_EndPlaylistBurn +}; + HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_reader) { WMReader *reader; @@ -1300,6 +1368,7 @@ HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_ reader->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; reader->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; reader->IWMReaderTimecode_iface.lpVtbl = &WMReaderTimecodeVtbl; + reader->IWMReaderPlaylistBurn_iface.lpVtbl = &WMReaderPlaylistBurnVtbl; reader->ref = 1; *ret_reader = &reader->IWMReader_iface;
1
0
0
0
Alistair Leslie-Hughes : wmvcore: Support IWMReaderTimecode interface in IWMReader.
by Alexandre Julliard
17 Jul '17
17 Jul '17
Module: wine Branch: master Commit: b15c39855b42b022eff82a0639f523af86723226 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b15c39855b42b022eff82a063…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Sun Jul 16 09:49:00 2017 +0000 wmvcore: Support IWMReaderTimecode interface in IWMReader. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmvcore/tests/wmvcore.c | 2 +- dlls/wmvcore/wmvcore_main.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 4369748..83c19da9 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -124,7 +124,7 @@ static void test_wmreader_interfaces(void) ok(hr == S_OK, "Failed 0x%08x\n", hr); hr = IWMReader_QueryInterface(reader, &IID_IWMReaderTimecode, (void **)&timecode); - todo_wine ok(hr == S_OK, "Failed 0x%08x\n", hr); + ok(hr == S_OK, "Failed 0x%08x\n", hr); hr = IWMReader_QueryInterface(reader, &IID_IWMReaderNetworkConfig, (void **)&netconfig); ok(hr == S_OK, "Failed 0x%08x\n", hr); diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c index 2969668..f048b9b 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c @@ -70,6 +70,7 @@ typedef struct { IWMReaderNetworkConfig2 IWMReaderNetworkConfig2_iface; IWMReaderStreamClock IWMReaderStreamClock_iface; IWMReaderTypeNegotiation IWMReaderTypeNegotiation_iface; + IWMReaderTimecode IWMReaderTimecode_iface; LONG ref; } WMReader; @@ -121,6 +122,9 @@ static HRESULT WINAPI WMReader_QueryInterface(IWMReader *iface, REFIID riid, voi }else if(IsEqualGUID(riid, &IID_IWMReaderTypeNegotiation)) { TRACE("(%p)->(IWMReaderTypeNegotiation %p)\n", This, ppv); *ppv = &This->IWMReaderTypeNegotiation_iface; + }else if(IsEqualGUID(riid, &IID_IWMReaderTimecode)) { + TRACE("(%p)->(IWMReaderTimecode %p)\n", This, ppv); + *ppv = &This->IWMReaderTimecode_iface; }else { *ppv = NULL; FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); @@ -1232,6 +1236,53 @@ static const IWMReaderTypeNegotiationVtbl WMReaderTypeNegotiationVtbl = negotiation_TryOutputProps }; +static inline WMReader *impl_from_IWMReaderTimecode(IWMReaderTimecode *iface) +{ + return CONTAINING_RECORD(iface, WMReader, IWMReaderTimecode_iface); +} + +static HRESULT WINAPI timecode_QueryInterface(IWMReaderTimecode *iface, REFIID riid, void **ppv) +{ + WMReader *This = impl_from_IWMReaderTimecode(iface); + return IWMReader_QueryInterface(&This->IWMReader_iface, riid, ppv); +} + +static ULONG WINAPI timecode_AddRef(IWMReaderTimecode *iface) +{ + WMReader *This = impl_from_IWMReaderTimecode(iface); + return IWMReader_AddRef(&This->IWMReader_iface); +} + +static ULONG WINAPI timecode_Release(IWMReaderTimecode *iface) +{ + WMReader *This = impl_from_IWMReaderTimecode(iface); + return IWMReader_Release(&This->IWMReader_iface); +} + +static HRESULT WINAPI timecode_GetTimecodeRangeCount(IWMReaderTimecode *iface, WORD num, WORD *count) +{ + WMReader *This = impl_from_IWMReaderTimecode(iface); + FIXME("%p, %d, %p\n", This, num, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI timecode_GetTimecodeRangeBounds(IWMReaderTimecode *iface, WORD stream, WORD range, + DWORD *start_timecode, DWORD *end_timecode) +{ + WMReader *This = impl_from_IWMReaderTimecode(iface); + FIXME("%p, %d, %d, %p, %p\n", This, stream, range, start_timecode, end_timecode); + return E_NOTIMPL; +} + +static const IWMReaderTimecodeVtbl WMReaderTimecodeVtbl = +{ + timecode_QueryInterface, + timecode_AddRef, + timecode_Release, + timecode_GetTimecodeRangeCount, + timecode_GetTimecodeRangeBounds +}; + HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_reader) { WMReader *reader; @@ -1248,6 +1299,7 @@ HRESULT WINAPI WMCreateReader(IUnknown *reserved, DWORD rights, IWMReader **ret_ reader->IWMReaderNetworkConfig2_iface.lpVtbl = &WMReaderNetworkConfig2Vtbl; reader->IWMReaderStreamClock_iface.lpVtbl = &WMReaderStreamClockVtbl; reader->IWMReaderTypeNegotiation_iface.lpVtbl = &WMReaderTypeNegotiationVtbl; + reader->IWMReaderTimecode_iface.lpVtbl = &WMReaderTimecodeVtbl; reader->ref = 1; *ret_reader = &reader->IWMReader_iface;
1
0
0
0
Jacek Caban : winhttp: Get rid of no longer needed netconn_init.
by Alexandre Julliard
14 Jul '17
14 Jul '17
Module: wine Branch: master Commit: c2f464decb8c44fbbc08e7f694c89d6aa758a754 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c2f464decb8c44fbbc08e7f69…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jul 14 15:58:00 2017 +0200 winhttp: Get rid of no longer needed netconn_init. Spotted by Hans. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/net.c | 7 ------- dlls/winhttp/winhttp_private.h | 1 - 2 files changed, 8 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index c6cc698..d9f81de 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -289,13 +289,6 @@ static BOOL ensure_cred_handle(void) return ret; } -BOOL netconn_init( netconn_t *conn ) -{ - memset(conn, 0, sizeof(*conn)); - conn->socket = -1; - return TRUE; -} - void netconn_unload( void ) { if(cred_handle_initialized) diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index eba20c9..636bae9 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -284,7 +284,6 @@ void close_connection( request_t * ) DECLSPEC_HIDDEN; BOOL netconn_close( netconn_t * ) DECLSPEC_HIDDEN; BOOL netconn_connect( netconn_t *, const struct sockaddr *, unsigned int, int ) DECLSPEC_HIDDEN; netconn_t *netconn_create( int, int, int ) DECLSPEC_HIDDEN; -BOOL netconn_init( netconn_t * ) DECLSPEC_HIDDEN; void netconn_unload( void ) DECLSPEC_HIDDEN; ULONG netconn_query_data_available( netconn_t * ) DECLSPEC_HIDDEN; BOOL netconn_recv( netconn_t *, void *, size_t, int, int * ) DECLSPEC_HIDDEN;
1
0
0
0
Jacek Caban : winhttp/tests: Make sure that all notifications were called before the end of a test.
by Alexandre Julliard
14 Jul '17
14 Jul '17
Module: wine Branch: master Commit: 4620bcf8062545306adfba8f564c4c9a172ac2b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4620bcf8062545306adfba8f5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jul 14 15:43:52 2017 +0200 winhttp/tests: Make sure that all notifications were called before the end of a test. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/tests/notification.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index dc36b88..e9de152 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -163,6 +163,12 @@ static void setup_test( struct info *info, enum api function, unsigned int line info->test[info->index].function, function); } +static void end_test( struct info *info, unsigned int line ) +{ + ok_(__FILE__,line)(info->index == info->count, "some notifications were missing: %x\n", + info->test[info->index].status); +} + static void test_connection_cache( void ) { HANDLE ses, con, req, event; @@ -364,6 +370,7 @@ done: WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); CloseHandle( info.wait ); + end_test( &info, __LINE__ ); if (unload) { @@ -456,6 +463,7 @@ done: WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); CloseHandle( info.wait ); + end_test( &info, __LINE__ ); } static const struct notification async_test[] = @@ -593,6 +601,7 @@ static void test_async( void ) } WinHttpCloseHandle( ses ); WaitForSingleObject( info.wait, INFINITE ); + end_test( &info, __LINE__ ); if (unload) {
1
0
0
0
Jacek Caban : winhttp: Use notification flags to explicitly mark notifications that should signal an event.
by Alexandre Julliard
14 Jul '17
14 Jul '17
Module: wine Branch: master Commit: 8c9df5b774beb58f1bb4b44fc43ddb1cb405a000 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c9df5b774beb58f1bb4b44fc…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Jul 14 15:43:45 2017 +0200 winhttp: Use notification flags to explicitly mark notifications that should signal an event. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winhttp/tests/notification.c | 53 ++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 3af35cf..dc36b88 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -52,6 +52,7 @@ struct notification #define NF_ALLOW 0x0001 /* notification may or may not happen */ #define NF_WINE_ALLOW 0x0002 /* wine sends notification when it should not */ +#define NF_SIGNAL 0x0004 /* signal wait handle when notified */ struct info { @@ -88,9 +89,8 @@ static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DW function_ok = (info->test[info->index].function == info->function); ok(status_ok, "%u: expected status 0x%08x got 0x%08x\n", info->line, info->test[info->index].status, status); ok(function_ok, "%u: expected function %u got %u\n", info->line, info->test[info->index].function, info->function); - if (status_ok && function_ok) info->index++; - if (status & (WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING)) + if (status_ok && function_ok && info->test[info->index++].flags & NF_SIGNAL) { SetEvent( info->wait ); } @@ -110,7 +110,7 @@ static const struct notification cache_test[] = { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, @@ -121,8 +121,8 @@ static const struct notification cache_test[] = { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_connect, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, NF_WINE_ALLOW }, @@ -135,7 +135,7 @@ static const struct notification cache_test[] = { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, @@ -146,12 +146,13 @@ static const struct notification cache_test[] = { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING } + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void setup_test( struct info *info, enum api function, unsigned int line ) { + if (info->wait) ResetEvent( info->wait ); info->function = function; info->line = line; while (info->index < info->count && info->test[info->index].function != function @@ -251,11 +252,9 @@ static void test_connection_cache( void ) ResetEvent( info.wait ); setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); - WaitForSingleObject( info.wait, INFINITE ); - - setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); + WaitForSingleObject( info.wait, INFINITE ); if (unload) { @@ -263,12 +262,13 @@ static void test_connection_cache( void ) ok(status == WAIT_TIMEOUT, "got %08x\n", status); } + setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( ses ); + WaitForSingleObject( info.wait, INFINITE ); - Sleep(2000); /* make sure connection is evicted from cache */ if (unload) { - status = WaitForSingleObject( event, 0 ); + status = WaitForSingleObject( event, 100 ); ok(status == WAIT_OBJECT_0, "got %08x\n", status); } @@ -351,9 +351,8 @@ static void test_connection_cache( void ) setup_test( &info, winhttp_close_handle, __LINE__ ); done: WinHttpCloseHandle( req ); - WaitForSingleObject( info.wait, INFINITE ); WinHttpCloseHandle( con ); - CloseHandle( info.wait ); + WaitForSingleObject( info.wait, INFINITE ); if (unload) { @@ -361,12 +360,14 @@ done: ok(status == WAIT_TIMEOUT, "got %08x\n", status); } + setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( ses ); + WaitForSingleObject( info.wait, INFINITE ); + CloseHandle( info.wait ); - Sleep(2000); /* make sure connection is evicted from cache */ if (unload) { - status = WaitForSingleObject( event, 0 ); + status = WaitForSingleObject( event, 100 ); ok(status == WAIT_OBJECT_0, "got %08x\n", status); } @@ -398,7 +399,7 @@ static const struct notification redirect_test[] = { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING } + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void test_redirect( void ) @@ -411,7 +412,7 @@ static void test_redirect( void ) info.test = redirect_test; info.count = sizeof(redirect_test) / sizeof(redirect_test[0]); info.index = 0; - info.wait = NULL; + info.wait = CreateEventW( NULL, FALSE, FALSE, NULL ); ses = WinHttpOpen( user_agent, 0, NULL, NULL, 0 ); ok(ses != NULL, "failed to open session %u\n", GetLastError()); @@ -453,6 +454,8 @@ done: WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); + WaitForSingleObject( info.wait, INFINITE ); + CloseHandle( info.wait ); } static const struct notification async_test[] = @@ -465,19 +468,19 @@ static const struct notification async_test[] = { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, NF_WINE_ALLOW }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST }, { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT }, - { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE, NF_SIGNAL }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE }, { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED }, - { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE }, - { winhttp_query_data, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE, NF_SIGNAL }, + { winhttp_query_data, WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE, NF_SIGNAL }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, NF_ALLOW }, { winhttp_read_data, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, NF_ALLOW }, - { winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE }, + { winhttp_read_data, WINHTTP_CALLBACK_STATUS_READ_COMPLETE, NF_SIGNAL }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, NF_WINE_ALLOW }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING }, - { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING } + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, NF_SIGNAL } }; static void test_async( void ) @@ -581,7 +584,6 @@ static void test_async( void ) setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); - WaitForSingleObject( info.wait, INFINITE ); WinHttpCloseHandle( con ); if (unload) @@ -590,7 +592,6 @@ static void test_async( void ) ok(status == WAIT_TIMEOUT, "got %08x\n", status); } WinHttpCloseHandle( ses ); - WaitForSingleObject( info.wait, INFINITE ); if (unload)
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
64
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
Results per page:
10
25
50
100
200