mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 11:33:31 +08:00
[NTOS:PNP] Partially implement NtPlugPlayControl(PlugPlayControlQueryAndRemoveDevice)
CORE-12307
This commit is contained in:
parent
5eeeb1c235
commit
06b3ee43c2
@ -1147,6 +1147,39 @@ PiControlSyncDeviceAction(
|
||||
return Status;
|
||||
}
|
||||
|
||||
static
|
||||
NTSTATUS
|
||||
PiControlQueryRemoveDevice(
|
||||
_In_ PPLUGPLAY_CONTROL_QUERY_REMOVE_DATA ControlData)
|
||||
{
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
NTSTATUS Status;
|
||||
UNICODE_STRING DeviceInstance;
|
||||
|
||||
Status = IopCaptureUnicodeString(&DeviceInstance, &ControlData->DeviceInstance);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return Status;
|
||||
}
|
||||
|
||||
DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance);
|
||||
if (DeviceInstance.Buffer != NULL)
|
||||
{
|
||||
ExFreePool(DeviceInstance.Buffer);
|
||||
}
|
||||
if (DeviceObject == NULL)
|
||||
{
|
||||
return STATUS_NO_SUCH_DEVICE;
|
||||
}
|
||||
|
||||
UNIMPLEMENTED;
|
||||
Status = STATUS_NOT_IMPLEMENTED;
|
||||
|
||||
ObDereferenceObject(DeviceObject);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* PUBLIC FUNCTIONS **********************************************************/
|
||||
|
||||
/*
|
||||
@ -1400,7 +1433,10 @@ NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass,
|
||||
PlugPlayControlClass);
|
||||
|
||||
// case PlugPlayControlUnlockDevice:
|
||||
// case PlugPlayControlQueryAndRemoveDevice:
|
||||
case PlugPlayControlQueryAndRemoveDevice:
|
||||
if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_QUERY_REMOVE_DATA))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
return PiControlQueryRemoveDevice((PPLUGPLAY_CONTROL_QUERY_REMOVE_DATA)Buffer);
|
||||
|
||||
case PlugPlayControlUserResponse:
|
||||
if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_USER_RESPONSE_DATA))
|
||||
|
Loading…
Reference in New Issue
Block a user