The mutex is also used in user32, gdi32, and winevulkan, where it is opened through kernel32, which opens it from the session directory.
I believe this will fix the d3drm spurious errors, and hopefully the ddraw ones too, but I haven't investigated these as the test takes much longer to run.
From: Rémi Bernon rbernon@codeweavers.com
The mutex is also used in user32, gdi32, and winevulkan, where it is opened through kernel32, which opens it from the session directory. --- dlls/win32u/sysparams.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 6b5a6f65aef..498ed386386 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -406,14 +406,16 @@ void user_check_not_lock(void)
static HANDLE get_display_device_init_mutex( void ) { - static const WCHAR display_device_initW[] = - {'\','B','a','s','e','N','a','m','e','d','O','b','j','e','c','t','s', - '\','d','i','s','p','l','a','y','_','d','e','v','i','c','e','_','i','n','i','t'}; - UNICODE_STRING name = { sizeof(display_device_initW), sizeof(display_device_initW), - (WCHAR *)display_device_initW }; + WCHAR bufferW[256]; + UNICODE_STRING name = {.Buffer = bufferW}; OBJECT_ATTRIBUTES attr; + char buffer[256]; HANDLE mutex;
+ snprintf( buffer, ARRAY_SIZE(buffer), "\Sessions\%u\BaseNamedObjects\display_device_init", + NtCurrentTeb()->Peb->SessionId ); + name.Length = name.MaximumLength = asciiz_to_unicode( bufferW, buffer ); + InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL ); if (NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ) < 0) return 0; NtWaitForSingleObject( mutex, FALSE, NULL );
From: Rémi Bernon rbernon@codeweavers.com
The mutex is also used in user32, gdi32, and winevulkan, where it is opened through kernel32, which opens it from the session directory.
Note that this was also not even using the global BaseNamedObjects and was silently failing to open the mutex. --- dlls/winex11.drv/x11drv_main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 7f9ada291a0..497e270ee8a 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -1009,14 +1009,19 @@ NTSTATUS CDECL X11DRV_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDP
static HANDLE get_display_device_init_mutex(void) { - static const WCHAR init_mutexW[] = {'d','i','s','p','l','a','y','_','d','e','v','i','c','e','_','i','n','i','t'}; - UNICODE_STRING name = { sizeof(init_mutexW), sizeof(init_mutexW), (WCHAR *)init_mutexW }; + WCHAR bufferW[256]; + UNICODE_STRING name = {.Buffer = bufferW}; OBJECT_ATTRIBUTES attr; - HANDLE mutex = 0; + char buffer[256]; + HANDLE mutex; + + snprintf( buffer, ARRAY_SIZE(buffer), "\Sessions\%u\BaseNamedObjects\display_device_init", + NtCurrentTeb()->Peb->SessionId ); + name.Length = name.MaximumLength = asciiz_to_unicode( bufferW, buffer );
InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL ); - NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ); - if (mutex) NtWaitForSingleObject( mutex, FALSE, NULL ); + if (NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ) < 0) return 0; + NtWaitForSingleObject( mutex, FALSE, NULL ); return mutex; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=125108
Your paranoid android.
=== debian11 (32 bit report) ===
ddraw: ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x1000. ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x3000.
=== debian11 (build log) ===
0568:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0568:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0568:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this.
=== debian11 (build log) ===
Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24752. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24752. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24752.
On Wed Oct 19 00:16:00 2022 +0000, **** wrote:
Marvin replied on the mailing list:
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=125108 Your paranoid android. === debian11 (32 bit report) === ddraw: ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x1000. ddraw7.c:15663: Test failed: Expected unsynchronised map for flags 0x3000. === debian11 (build log) === 0568:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0568:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. 0568:err:winediag:d3d_device_create The application wants to create a Direct3D device, but the current DirectDrawRenderer does not support this. === debian11 (build log) === Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24752. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24752. Use of uninitialized value $Flaky in addition (+) at /home/testbot/lib/WineTestBot/LogUtils.pm line 720, <$LogFile> line 24752.
I guess that answers the question about ddraw...