Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
Description
If HasGuid are specified and IoCallDriver(IOCTL_MOUNTDEV_QUERY_STABLE_GUID) returns an error, it will be returned to the caller by QueryDeviceInformation().
...
|
...
|
/* If user wants to know about GUID */ |
if (HasGuid) |
{
|
/* Query device stable GUID */ |
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
Irp = IoBuildDeviceIoControlRequest(IOCTL_MOUNTDEV_QUERY_STABLE_GUID,
|
DeviceObject,
|
NULL,
|
0,
|
StableGuid,
|
sizeof(GUID), |
FALSE,
|
&Event,
|
&IoStatusBlock);
|
if (!Irp) |
{
|
ObDereferenceObject(DeviceObject);
|
ObDereferenceObject(FileObject);
|
return STATUS_INSUFFICIENT_RESOURCES; |
}
|
|
Stack = IoGetNextIrpStackLocation(Irp);
|
Stack->FileObject = FileObject;
|
|
Status = IoCallDriver(DeviceObject, Irp);
|
if (Status == STATUS_PENDING) |
{
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
Status = IoStatusBlock.Status;
|
}
|
|
*HasGuid = NT_SUCCESS(Status);
|
}
|
|
ObDereferenceObject(DeviceObject);
|
ObDereferenceObject(FileObject);
|
return Status; |
}
|
.
Returned Status should not depend on this request.
...
|
...
|
/* If user wants to know about GUID */
|
if (HasGuid)
|
{
|
NTSTATUS status;
|
|
/* Query device stable GUID */
|
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
Irp = IoBuildDeviceIoControlRequest(IOCTL_MOUNTDEV_QUERY_STABLE_GUID,
|
DeviceObject,
|
NULL,
|
0,
|
StableGuid,
|
sizeof(GUID),
|
FALSE,
|
&Event,
|
&IoStatusBlock);
|
if (!Irp)
|
{
|
ObDereferenceObject(DeviceObject);
|
ObDereferenceObject(FileObject);
|
return STATUS_INSUFFICIENT_RESOURCES;
|
}
|
|
Stack = IoGetNextIrpStackLocation(Irp);
|
Stack->FileObject = FileObject;
|
|
status = IoCallDriver(DeviceObject, Irp);
|
if (status == STATUS_PENDING)
|
{
|
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
status = IoStatusBlock.Status;
|
}
|
|
*HasGuid = NT_SUCCESS(status);
|
}
|
|
ObDereferenceObject(DeviceObject);
|
ObDereferenceObject(FileObject);
|
return Status;
|
}
|