Commit 8ed6b160 authored by Claire Girka's avatar Claire Girka Committed by Alexandre Julliard

hidclass: Improve error handling in get_device_id.

Do not assume the underlying driver will return meaningful data, as it may not support BusQueryContainerID which will be queried in a next commit.
parent d930a0cc
......@@ -84,11 +84,16 @@ static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCH
irpsp->MinorFunction = IRP_MN_QUERY_ID;
irpsp->Parameters.QueryId.IdType = type;
irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
if (IoCallDriver(device, irp) == STATUS_PENDING)
KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
wcscpy(id, (WCHAR *)irp_status.Information);
ExFreePool((WCHAR *)irp_status.Information);
if (!irp_status.Status)
{
wcscpy(id, (WCHAR *)irp_status.Information);
ExFreePool((WCHAR *)irp_status.Information);
}
return irp_status.Status;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment