From 8e26f382d9239db9ffb99bfc42fb967151dc2ea7 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 8 Jun 2015 14:02:36 +0000 Subject: [PATCH] [NTOSKRNL] Add NtPlugPlayControl.PlugPlayControlQueryDeviceRelations. svn path=/trunk/; revision=68074 --- reactos/include/ndk/cmtypes.h | 9 +++++++ reactos/ntoskrnl/io/pnpmgr/plugplay.c | 38 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/reactos/include/ndk/cmtypes.h b/reactos/include/ndk/cmtypes.h index 6f4322fb48f..4fdf9a5892f 100644 --- a/reactos/include/ndk/cmtypes.h +++ b/reactos/include/ndk/cmtypes.h @@ -462,6 +462,15 @@ typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA ULONG Depth; } PLUGPLAY_CONTROL_DEPTH_DATA, *PPLUGPLAY_CONTROL_DEPTH_DATA; +// Class 0x10 +typedef struct _PLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA +{ + UNICODE_STRING DeviceInstance; + ULONG Relations; // 0:EjectRelations, 1:RemovalRelations, 3:BusRelations + ULONG BufferSize; + PWCHAR Buffer; +} PLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA, *PPLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA; + // Class 0x14 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA { diff --git a/reactos/ntoskrnl/io/pnpmgr/plugplay.c b/reactos/ntoskrnl/io/pnpmgr/plugplay.c index 63757ea8335..765072f3cf3 100644 --- a/reactos/ntoskrnl/io/pnpmgr/plugplay.c +++ b/reactos/ntoskrnl/io/pnpmgr/plugplay.c @@ -552,6 +552,7 @@ IopDeviceStatus(PPLUGPLAY_CONTROL_STATUS_DATA StatusData) { return Status; } + DPRINT("Device name: '%wZ'\n", &DeviceInstance); _SEH2_TRY @@ -616,6 +617,16 @@ IopDeviceStatus(PPLUGPLAY_CONTROL_STATUS_DATA StatusData) return Status; } +static +NTSTATUS +IopGetDeviceRelations(PPLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA RelationsData) +{ + DPRINT("IopGetDeviceRelations() called\n"); + DPRINT("Device name: %wZ\n", &RelationsData->DeviceInstance); + DPRINT("Relations: %lu\n", &RelationsData->Relations); + + return STATUS_NOT_IMPLEMENTED; +} static NTSTATUS IopGetDeviceDepth(PPLUGPLAY_CONTROL_DEPTH_DATA DepthData) @@ -673,6 +684,7 @@ IopResetDevice(PPLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData) { return Status; } + DPRINT("IopResetDevice(%wZ)\n", &DeviceInstance); /* Get the device object */ @@ -961,11 +973,21 @@ NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, switch (PlugPlayControlClass) { +// case PlugPlayControlEnumerateDevice: +// case PlugPlayControlRegisterNewDevice: +// case PlugPlayControlDeregisterDevice: +// case PlugPlayControlInitializeDevice: +// case PlugPlayControlStartDevice: +// case PlugPlayControlUnlockDevice: +// case PlugPlayControlQueryAndRemoveDevice: + case PlugPlayControlUserResponse: if (Buffer || BufferLength != 0) return STATUS_INVALID_PARAMETER; return IopRemovePlugPlayEvent(); +// case PlugPlayControlGenerateLegacyDevice: + case PlugPlayControlGetInterfaceDeviceList: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_INTERFACE_DEVICE_LIST_DATA)) return STATUS_INVALID_PARAMETER; @@ -976,11 +998,15 @@ NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, return STATUS_INVALID_PARAMETER; return IopGetDeviceProperty((PPLUGPLAY_CONTROL_PROPERTY_DATA)Buffer); +// case PlugPlayControlDeviceClassAssociation: + case PlugPlayControlGetRelatedDevice: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_RELATED_DEVICE_DATA)) return STATUS_INVALID_PARAMETER; return IopGetRelatedDevice((PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA)Buffer); +// case PlugPlayControlGetInterfaceDeviceAlias: + case PlugPlayControlDeviceStatus: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_STATUS_DATA)) return STATUS_INVALID_PARAMETER; @@ -991,11 +1017,23 @@ NtPlugPlayControl(IN PLUGPLAY_CONTROL_CLASS PlugPlayControlClass, return STATUS_INVALID_PARAMETER; return IopGetDeviceDepth((PPLUGPLAY_CONTROL_DEPTH_DATA)Buffer); + case PlugPlayControlQueryDeviceRelations: + if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA)) + return STATUS_INVALID_PARAMETER; + return IopGetDeviceRelations((PPLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA)Buffer); + +// case PlugPlayControlTargetDeviceRelation: +// case PlugPlayControlQueryConflictList: +// case PlugPlayControlRetrieveDock: + case PlugPlayControlResetDevice: if (!Buffer || BufferLength < sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA)) return STATUS_INVALID_PARAMETER; return IopResetDevice((PPLUGPLAY_CONTROL_RESET_DEVICE_DATA)Buffer); +// case PlugPlayControlHaltDevice: +// case PlugPlayControlGetBlockedDriverList: + default: return STATUS_NOT_IMPLEMENTED; }