ntoskrnl.exe: Use proper device handle in DevicePropertyPhysicalDeviceObjectName implementation.

Spotted by Huw Davies.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-04-11 17:19:03 +02:00 committed by Alexandre Julliard
parent 38bdd6fc5c
commit c1fb240f0c
1 changed files with 4 additions and 1 deletions

View File

@ -1831,8 +1831,11 @@ NTSTATUS WINAPI IoGetDeviceProperty( DEVICE_OBJECT *device, DEVICE_REGISTRY_PROP
{
ULONG used_len, len = buffer_length + sizeof(OBJECT_NAME_INFORMATION);
OBJECT_NAME_INFORMATION *name = HeapAlloc(GetProcessHeap(), 0, len);
HANDLE handle;
status = NtQueryObject(device->Reserved, ObjectNameInformation, name, len, &used_len);
handle = kernel_object_handle( device, 0 );
status = NtQueryObject( handle, ObjectNameInformation, name, len, &used_len );
NtClose( handle );
if (status == STATUS_SUCCESS)
{
/* Ensure room for NULL termination */