mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 18:07:21 +00:00
win32u: Use the correct length for kernel object names in object attributes.
This commit is contained in:
parent
a5463c88e2
commit
d76f5b4ab9
|
@ -450,7 +450,8 @@ static HANDLE get_display_device_init_mutex( void )
|
|||
|
||||
snprintf( buffer, ARRAY_SIZE(buffer), "\\Sessions\\%u\\BaseNamedObjects\\display_device_init",
|
||||
(int)NtCurrentTeb()->Peb->SessionId );
|
||||
name.Length = name.MaximumLength = asciiz_to_unicode( bufferW, buffer );
|
||||
name.MaximumLength = asciiz_to_unicode( bufferW, buffer );
|
||||
name.Length = name.MaximumLength - sizeof(WCHAR);
|
||||
|
||||
InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL );
|
||||
if (NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ) < 0) return 0;
|
||||
|
|
|
@ -554,7 +554,8 @@ static HANDLE get_winstations_dir_handle(void)
|
|||
|
||||
sprintf( bufferA, "\\Sessions\\%u\\Windows\\WindowStations", (int)NtCurrentTeb()->Peb->SessionId );
|
||||
str.Buffer = buffer;
|
||||
str.Length = str.MaximumLength = asciiz_to_unicode( buffer, bufferA ) - sizeof(WCHAR);
|
||||
str.MaximumLength = asciiz_to_unicode( buffer, bufferA );
|
||||
str.Length = str.MaximumLength - sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &str, 0, 0, NULL );
|
||||
status = NtOpenDirectoryObject( &dir, DIRECTORY_CREATE_OBJECT | DIRECTORY_TRAVERSE, &attr );
|
||||
return status ? 0 : dir;
|
||||
|
|
|
@ -1008,7 +1008,8 @@ static HANDLE get_display_device_init_mutex(void)
|
|||
|
||||
snprintf( buffer, ARRAY_SIZE(buffer), "\\Sessions\\%u\\BaseNamedObjects\\display_device_init",
|
||||
(int)NtCurrentTeb()->Peb->SessionId );
|
||||
name.Length = name.MaximumLength = asciiz_to_unicode( bufferW, buffer );
|
||||
name.MaximumLength = asciiz_to_unicode( bufferW, buffer );
|
||||
name.Length = name.MaximumLength - sizeof(WCHAR);
|
||||
|
||||
InitializeObjectAttributes( &attr, &name, OBJ_OPENIF, NULL, NULL );
|
||||
if (NtCreateMutant( &mutex, MUTEX_ALL_ACCESS, &attr, FALSE ) < 0) return 0;
|
||||
|
|
Loading…
Reference in a new issue