mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 03:04:47 +00:00
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.
This commit is contained in:
parent
d930a0cc5e
commit
8ed6b1609c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue