winex11: Directly use ntdll in display_device_init mutex.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
db9b7b0f51
commit
12cb04fd2f
|
@ -29,17 +29,21 @@ struct x11drv_display_device_handler desktop_handler;
|
|||
|
||||
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',0};
|
||||
HANDLE mutex = CreateMutexW(NULL, FALSE, init_mutexW);
|
||||
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 };
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
HANDLE mutex = 0;
|
||||
|
||||
WaitForSingleObject(mutex, INFINITE);
|
||||
InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL );
|
||||
NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE );
|
||||
if (mutex) NtWaitForSingleObject( mutex, FALSE, NULL );
|
||||
return mutex;
|
||||
}
|
||||
|
||||
void release_display_device_init_mutex(HANDLE mutex)
|
||||
{
|
||||
ReleaseMutex(mutex);
|
||||
CloseHandle(mutex);
|
||||
NtReleaseMutant( mutex, NULL );
|
||||
NtClose( mutex );
|
||||
}
|
||||
|
||||
POINT virtual_screen_to_root(INT x, INT y)
|
||||
|
|
Loading…
Reference in New Issue