From: Rémi Bernon rbernon@codeweavers.com
--- programs/explorer/desktop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 96673adc254..81eb0d1d01b 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -876,7 +876,7 @@ static BOOL get_default_enable_shell( const WCHAR *name ) return result; }
-static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid ) +static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid ) { static const WCHAR device_keyW[] = { 'S','y','s','t','e','m','\', @@ -921,6 +921,7 @@ static HMODULE load_graphics_driver( const WCHAR *driver, const GUID *guid )
if (!wcscmp( name, L"null" )) { + memset( guid, 0, sizeof(*guid) ); TRACE( "display %s using null driver\n", debugstr_guid(guid) ); wcscpy( libname, L"null" ); null_driver = TRUE;
From: Rémi Bernon rbernon@codeweavers.com
When using nulldrv, there's no module to call __wine_set_user_driver and the user driver is still lazy_load_driver when get_display_driver gets called during desktop windows creation.
Then, load_desktop_driver fails as it cannot find the not-yet-created desktop window atom, and fails later explorer.exe window creations such as the systray window.
Other processes don't suffer from this as they wait for the desktop window to be fully created, and its atom will be eventually set.
This change makes sure that we succeed in the case nulldrv was selected by explorer.exe, while still failing in case of error with another user driver as it would fail to open the right display device GUID. --- dlls/win32u/driver.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 1c0708461a1..866975a802d 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -923,6 +923,8 @@ static const WCHAR guid_key_suffixW[] = {'}','\','0','0','0','0'};
static BOOL load_desktop_driver( HWND hwnd ) { + static const WCHAR guid_nullW[] = {'0','0','0','0','0','0','0','0','-','0','0','0','0','-','0','0','0','0','-', + '0','0','0','0','-','0','0','0','0','0','0','0','0','0','0','0','0',0}; WCHAR key[ARRAYSIZE(guid_key_prefixW) + 40 + ARRAYSIZE(guid_key_suffixW)], *ptr; char buf[4096]; KEY_VALUE_PARTIAL_INFORMATION *info = (void *)buf; @@ -946,9 +948,15 @@ static BOOL load_desktop_driver( HWND hwnd ) memcpy( key, guid_key_prefixW, sizeof(guid_key_prefixW) ); ptr = key + ARRAYSIZE(guid_key_prefixW); if (NtQueryInformationAtom( guid_atom, AtomBasicInformation, buf, sizeof(buf), NULL )) - return FALSE; - memcpy( ptr, abi->Name, abi->NameLength ); - ptr += abi->NameLength / sizeof(WCHAR); + { + wcscpy( ptr, guid_nullW ); + ptr += ARRAY_SIZE(guid_nullW) - 1; + } + else + { + memcpy( ptr, abi->Name, abi->NameLength ); + ptr += abi->NameLength / sizeof(WCHAR); + } memcpy( ptr, guid_key_suffixW, sizeof(guid_key_suffixW) ); ptr += ARRAY_SIZE(guid_key_suffixW);
This merge request was approved by Huw Davies.