https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9d26058a8e1b61da85ce8…
commit 9d26058a8e1b61da85ce8f2a4f81fc7dcae63112
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Aug 12 22:19:05 2018 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Aug 12 22:26:22 2018 +0200
[UMPNPMGR] Partially implement ReenumerateDeviceInstance which is needed by the Lenovo
T400 network driver installer
---
base/services/umpnpmgr/umpnpmgr.c | 36 +++++++++++++++++++++++++++++++-----
sdk/include/ndk/cmtypes.h | 7 +++++++
2 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/base/services/umpnpmgr/umpnpmgr.c b/base/services/umpnpmgr/umpnpmgr.c
index 478bcc7825..02eaf05b3a 100644
--- a/base/services/umpnpmgr/umpnpmgr.c
+++ b/base/services/umpnpmgr/umpnpmgr.c
@@ -1959,11 +1959,36 @@ DisableDeviceInstance(LPWSTR pszDeviceInstance)
static CONFIGRET
-ReenumerateDeviceInstance(LPWSTR pszDeviceInstance)
+ReenumerateDeviceInstance(
+ _In_ LPWSTR pszDeviceInstance,
+ _In_ ULONG ulFlags)
{
- DPRINT("ReenumerateDeviceInstance: not implemented\n");
- /* FIXME */
- return CR_CALL_NOT_IMPLEMENTED;
+ PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA EnumerateDeviceData;
+ CONFIGRET ret = CR_SUCCESS;
+ NTSTATUS Status;
+
+ DPRINT1("ReenumerateDeviceInstance(%S 0x%08lx)\n",
+ pszDeviceInstance, ulFlags);
+
+ if (ulFlags & ~CM_REENUMERATE_BITS)
+ return CR_INVALID_FLAG;
+
+ if (ulFlags & CM_REENUMERATE_RETRY_INSTALLATION)
+ {
+ DPRINT1("CM_REENUMERATE_RETRY_INSTALLATION not implemented!\n");
+ }
+
+ RtlInitUnicodeString(&EnumerateDeviceData.DeviceInstance,
+ pszDeviceInstance);
+ EnumerateDeviceData.Flags = 0;
+
+ Status = NtPlugPlayControl(PlugPlayControlEnumerateDevice,
+ &EnumerateDeviceData,
+ sizeof(PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA));
+ if (!NT_SUCCESS(Status))
+ ret = NtStatusToCrError(Status);
+
+ return ret;
}
@@ -2004,7 +2029,8 @@ PNP_DeviceInstanceAction(
break;
case PNP_DEVINST_REENUMERATE:
- ret = ReenumerateDeviceInstance(pszDeviceInstance1);
+ ret = ReenumerateDeviceInstance(pszDeviceInstance1,
+ ulFlags);
break;
default:
diff --git a/sdk/include/ndk/cmtypes.h b/sdk/include/ndk/cmtypes.h
index 1d58d93b68..2b854923cf 100644
--- a/sdk/include/ndk/cmtypes.h
+++ b/sdk/include/ndk/cmtypes.h
@@ -445,6 +445,13 @@ typedef struct _PLUGPLAY_EVENT_BLOCK
// Plug and Play Control Classes
//
+// Class 0x00
+typedef struct _PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA
+{
+ UNICODE_STRING DeviceInstance;
+ ULONG Flags;
+} PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA, *PPLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA;
+
//Class 0x09
typedef struct _PLUGPLAY_CONTROL_INTERFACE_DEVICE_LIST_DATA
{