Signed-off-by: Jacek Caban jacek@codeweavers.com --- v2: Fixed null driver handling.
dlls/user32/driver.c | 167 ++++++++++--------- dlls/user32/user32.spec | 1 + dlls/wineandroid.drv/android.h | 27 +++ dlls/wineandroid.drv/init.c | 132 ++++----------- dlls/wineandroid.drv/wineandroid.drv.spec | 24 --- dlls/winemac.drv/gdi.c | 148 ++++++----------- dlls/winemac.drv/macdrv.h | 52 ++++++ dlls/winemac.drv/mouse.c | 2 +- dlls/winemac.drv/winemac.drv.spec | 39 ----- dlls/winex11.drv/display.c | 1 - dlls/winex11.drv/event.c | 2 - dlls/winex11.drv/init.c | 194 +++++++++++----------- dlls/winex11.drv/winex11.drv.spec | 41 ----- dlls/winex11.drv/x11drv.h | 50 ++++++ dlls/winex11.drv/x11drv_main.c | 1 + dlls/winex11.drv/xim.c | 2 - include/wine/gdi_driver.h | 2 + 17 files changed, 403 insertions(+), 482 deletions(-)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=101645
Your paranoid android.
=== debiant2 (32 bit report) ===
user32: win.c:10437: Test failed: Expected foreground window 000D0126, got 00C500D2 win.c:10439: Test failed: GetActiveWindow() = 00000000 win.c:10439: Test failed: GetFocus() = 00000000 win.c:10440: Test failed: Received WM_ACTIVATEAPP(1), did not expect it. win.c:10441: Test failed: Received WM_ACTIVATEAPP(0), did not expect it. win.c:10449: Test failed: Expected foreground window 000D0126, got 00000000 win.c:10451: Test failed: GetActiveWindow() = 00000000 win.c:10451: Test failed: GetFocus() = 00000000 win.c:10459: Test failed: Received WM_ACTIVATEAPP(1), did not expect it.
On Wed, Nov 10, 2021 at 01:33:32PM +0100, Jacek Caban wrote:
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 7b51823014d..ed7cc5c72ba 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -59,9 +59,16 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module ) size = sizeof(path); if (!RegQueryValueExW( hkey, L"GraphicsDriver", NULL, NULL, (BYTE *)path, &size )) {
if ((ret = !wcscmp( path, L"null" ))) *module = NULL;
else ret = (*module = LoadLibraryW( path )) != NULL;
if (!ret) ERR( "failed to load %s\n", debugstr_w(path) );
if (wcscmp( path, L"null" ))
{
ret = LoadLibraryW( path ) != NULL;
if (!ret) ERR( "failed to load %s\n", debugstr_w(path) );
}
else
{
__wine_set_user_driver( &null_driver, WINE_GDI_DRIVER_VERSION );
ret = TRUE;
} TRACE( "%s %p\n", debugstr_w(path), *module );
This doesn't look quite right as "module" is now unused (I realise it's eliminated in the next patch, but it would be nice to have this patch make sense too).
This leads to: i686-w64-mingw32-gcc -c -o dlls/user32/driver.cross.o dlls/user32/driver.c -Idlls/user32 -Iinclude -Iinclude/msvcrt -I./libs/png \ -D__WINESRC__ -D_USER32_ -D_WINABLE_ -D_UCRT -D__WINE_PE_BUILD -Wall -fno-strict-aliasing \ -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -Wabsolute-value \ -fno-omit-frame-pointer -gdwarf-2 -gstrict-dwarf -g -O2 In file included from dlls/user32/driver.c:27: dlls/user32/driver.c: In function ‘load_driver’: include/wine/debug.h:89:5: warning: ‘module’ may be used uninitialized in this function [-Wmaybe-uninitialized] 89 | wine_dbg_log( __dbcl, __dbch, __FUNCTION__, args); } } while(0) | ^~~~~~~~~~~~
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 3148e28afdd..db5cd1b8810 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -57,7 +57,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug = static CRITICAL_SECTION device_data_section = { &critsect_debug, -1, 0, 0, 0, 0 };
-static const struct gdi_dc_funcs macdrv_funcs; +static const struct user_driver_funcs macdrv_funcs;
/***********************************************************************
compute_desktop_rect
@@ -184,7 +184,7 @@ static BOOL CDECL macdrv_CreateDC(PHYSDEV *pdev, LPCWSTR device, LPCWSTR output,
if (!physDev) return FALSE;
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs.dc_funcs); return TRUE;
}
@@ -201,7 +201,7 @@ static BOOL CDECL macdrv_CreateCompatibleDC(PHYSDEV orig, PHYSDEV *pdev)
if (!physDev) return FALSE;
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs.dc_funcs); return TRUE;
}
You forgot to change macdrv_get_gdi_driver() to avoid this:
gcc -m32 -c -o dlls/winemac.drv/gdi.o dlls/winemac.drv/gdi.c -Idlls/winemac.drv -Iinclude -D__WINESRC__ -fPIC \ -fasynchronous-unwind-tables -Wall -pipe -fno-stack-protector -fno-strict-aliasing \ -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self -Wno-pragma-pack \ -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-2 -gstrict-dwarf \ -fno-omit-frame-pointer -O2 -g -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 dlls/winemac.drv/gdi.c:324:12: warning: incompatible pointer types returning 'const struct user_driver_funcs *' from a function with result type 'const struct gdi_dc_funcs *' [-Wincompatible-pointer-types] return &macdrv_funcs;
(I'd have fixed this up myself, if that had been the only issue).
Thanks, Huw.
On 11/11/21 9:44 AM, Huw Davies wrote:
On Wed, Nov 10, 2021 at 01:33:32PM +0100, Jacek Caban wrote:
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 7b51823014d..ed7cc5c72ba 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -59,9 +59,16 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module ) size = sizeof(path); if (!RegQueryValueExW( hkey, L"GraphicsDriver", NULL, NULL, (BYTE *)path, &size )) {
if ((ret = !wcscmp( path, L"null" ))) *module = NULL;
else ret = (*module = LoadLibraryW( path )) != NULL;
if (!ret) ERR( "failed to load %s\n", debugstr_w(path) );
if (wcscmp( path, L"null" ))
{
ret = LoadLibraryW( path ) != NULL;
if (!ret) ERR( "failed to load %s\n", debugstr_w(path) );
}
else
{
__wine_set_user_driver( &null_driver, WINE_GDI_DRIVER_VERSION );
ret = TRUE;
} TRACE( "%s %p\n", debugstr_w(path), *module );
This doesn't look quite right as "module" is now unused (I realise it's eliminated in the next patch, but it would be nice to have this patch make sense too).
This leads to: i686-w64-mingw32-gcc -c -o dlls/user32/driver.cross.o dlls/user32/driver.c -Idlls/user32 -Iinclude -Iinclude/msvcrt -I./libs/png \ -D__WINESRC__ -D_USER32_ -D_WINABLE_ -D_UCRT -D__WINE_PE_BUILD -Wall -fno-strict-aliasing \ -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \ -Wno-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits \ -Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op -Wabsolute-value \ -fno-omit-frame-pointer -gdwarf-2 -gstrict-dwarf -g -O2 In file included from dlls/user32/driver.c:27: dlls/user32/driver.c: In function ‘load_driver’: include/wine/debug.h:89:5: warning: ‘module’ may be used uninitialized in this function [-Wmaybe-uninitialized] 89 | wine_dbg_log( __dbcl, __dbch, __FUNCTION__, args); } } while(0) | ^~~~~~~~~~~~
diff --git a/dlls/winemac.drv/gdi.c b/dlls/winemac.drv/gdi.c index 3148e28afdd..db5cd1b8810 100644 --- a/dlls/winemac.drv/gdi.c +++ b/dlls/winemac.drv/gdi.c @@ -57,7 +57,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug = static CRITICAL_SECTION device_data_section = { &critsect_debug, -1, 0, 0, 0, 0 };
-static const struct gdi_dc_funcs macdrv_funcs; +static const struct user_driver_funcs macdrv_funcs;
/***********************************************************************
compute_desktop_rect
@@ -184,7 +184,7 @@ static BOOL CDECL macdrv_CreateDC(PHYSDEV *pdev, LPCWSTR device, LPCWSTR output,
if (!physDev) return FALSE;
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs.dc_funcs); return TRUE; }
@@ -201,7 +201,7 @@ static BOOL CDECL macdrv_CreateCompatibleDC(PHYSDEV orig, PHYSDEV *pdev)
if (!physDev) return FALSE;
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
- push_dc_driver(pdev, &physDev->dev, &macdrv_funcs.dc_funcs); return TRUE; }
You forgot to change macdrv_get_gdi_driver() to avoid this:
gcc -m32 -c -o dlls/winemac.drv/gdi.o dlls/winemac.drv/gdi.c -Idlls/winemac.drv -Iinclude -D__WINESRC__ -fPIC \ -fasynchronous-unwind-tables -Wall -pipe -fno-stack-protector -fno-strict-aliasing \ -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self -Wno-pragma-pack \ -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-2 -gstrict-dwarf \ -fno-omit-frame-pointer -O2 -g -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 dlls/winemac.drv/gdi.c:324:12: warning: incompatible pointer types returning 'const struct user_driver_funcs *' from a function with result type 'const struct gdi_dc_funcs *' [-Wincompatible-pointer-types] return &macdrv_funcs;
(I'd have fixed this up myself, if that had been the only issue).
I messed merging mac changes, sorry about that. I sent v3 with mac and uninitialized module fixes.
Thanks,
Jacek