mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTOS:IO] Implement the PlugPlayControl.PlugPlayControlEnumerateDevice request
Drivers for Intel Pro/1000 NICs seem to install properly.
This commit is contained in:
parent
92e5fabb55
commit
8319c73e2e
1 changed files with 38 additions and 1 deletions
|
@ -212,6 +212,39 @@ IopCaptureUnicodeString(PUNICODE_STRING DstName, PUNICODE_STRING SrcName)
|
|||
return Status;
|
||||
}
|
||||
|
||||
static NTSTATUS
|
||||
IopPnpEnumerateDevice(PPLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA DeviceData)
|
||||
{
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
UNICODE_STRING DeviceInstance;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
Status = IopCaptureUnicodeString(&DeviceInstance, &DeviceData->DeviceInstance);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return Status;
|
||||
}
|
||||
|
||||
DPRINT("IopPnpEnumerateDevice(%wZ)\n", &DeviceInstance);
|
||||
|
||||
/* Get the device object */
|
||||
DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance);
|
||||
if (DeviceInstance.Buffer != NULL)
|
||||
{
|
||||
ExFreePool(DeviceInstance.Buffer);
|
||||
}
|
||||
if (DeviceObject == NULL)
|
||||
{
|
||||
return STATUS_NO_SUCH_DEVICE;
|
||||
}
|
||||
|
||||
Status = IopEnumerateDevice(DeviceObject);
|
||||
|
||||
ObDereferenceObject(DeviceObject);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
static NTSTATUS
|
||||
IopGetInterfaceDeviceList(PPLUGPLAY_CONTROL_INTERFACE_DEVICE_LIST_DATA DeviceList)
|
||||
{
|
||||
|
@ -1300,7 +1333,11 @@ NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass,
|
|||
|
||||
switch (PlugPlayControlClass)
|
||||
{
|
||||
// case PlugPlayControlEnumerateDevice:
|
||||
case PlugPlayControlEnumerateDevice:
|
||||
if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA))
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
return IopPnpEnumerateDevice((PPLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA)Buffer);
|
||||
|
||||
// case PlugPlayControlRegisterNewDevice:
|
||||
// case PlugPlayControlDeregisterDevice:
|
||||
// case PlugPlayControlInitializeDevice:
|
||||
|
|
Loading…
Reference in a new issue