https://git.reactos.org/?p=reactos.git;a=commitdiff;h=13bb5e2317962c5a08d19…
commit 13bb5e2317962c5a08d19b837a2523aa7458e772
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Tue Oct 15 22:40:06 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Tue Oct 15 22:40:06 2019 +0200
[umpnpmgr][ndk] Implement PNP_RequestDeviceEject() and update unknown type in
PLUGPLAY_CONTROL_QUERY_REMOVE_DATA
---
base/services/umpnpmgr/rpcserver.c | 34 ++++++++++++++++++++++++++++++++--
sdk/include/ndk/cmtypes.h | 2 +-
2 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c
index bef58c8895a..141026b7bd1 100644
--- a/base/services/umpnpmgr/rpcserver.c
+++ b/base/services/umpnpmgr/rpcserver.c
@@ -2972,6 +2972,7 @@ PNP_QueryRemove(
pszDeviceID);
PlugPlayData.VetoName = pszVetoName;
PlugPlayData.NameLength = ulNameLength;
+// PlugPlayData.Flags =
Status = NtPlugPlayControl(PlugPlayControlQueryAndRemoveDevice,
&PlugPlayData,
@@ -2994,8 +2995,37 @@ PNP_RequestDeviceEject(
DWORD ulNameLength,
DWORD ulFlags)
{
- UNIMPLEMENTED;
- return CR_CALL_NOT_IMPLEMENTED;
+ PLUGPLAY_CONTROL_QUERY_REMOVE_DATA PlugPlayData;
+ NTSTATUS Status;
+ DWORD ret = CR_SUCCESS;
+
+ DPRINT1("PNP_RequestDeviceEject(%p %S %p %p %lu 0x%lx)\n",
+ hBinding, pszDeviceID, pVetoType, pszVetoName,
+ ulNameLength, ulFlags);
+
+ if (ulFlags != 0)
+ return CR_INVALID_FLAG;
+
+ if (pVetoType != NULL)
+ *pVetoType = PNP_VetoTypeUnknown;
+
+ if (pszVetoName != NULL && ulNameLength > 0)
+ *pszVetoName = UNICODE_NULL;
+
+ RtlZeroMemory(&PlugPlayData, sizeof(PlugPlayData));
+ RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
+ pszDeviceID);
+ PlugPlayData.VetoName = pszVetoName;
+ PlugPlayData.NameLength = ulNameLength;
+// PlugPlayData.Flags =
+
+ Status = NtPlugPlayControl(PlugPlayControlQueryAndRemoveDevice,
+ &PlugPlayData,
+ sizeof(PlugPlayData));
+ if (!NT_SUCCESS(Status))
+ ret = NtStatusToCrError(Status);
+
+ return ret;
}
diff --git a/sdk/include/ndk/cmtypes.h b/sdk/include/ndk/cmtypes.h
index 8c0b50f6007..6446f4efec2 100644
--- a/sdk/include/ndk/cmtypes.h
+++ b/sdk/include/ndk/cmtypes.h
@@ -457,7 +457,7 @@ typedef struct _PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA
typedef struct _PLUGPLAY_CONTROL_QUERY_REMOVE_DATA
{
UNICODE_STRING DeviceInstance;
- ULONG Unknown2;
+ ULONG Flags;
PNP_VETO_TYPE VetoType;
LPWSTR VetoName;
ULONG NameLength;