https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a743e33bd8154c4c1eabc…
commit a743e33bd8154c4c1eabcdd2242683f29c60c8f0
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sat Nov 9 12:32:34 2019 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sat Nov 9 12:32:34 2019 +0100
[UMPNPMGR] Implement PNP_RequestEjectPC()
---
base/services/umpnpmgr/rpcserver.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/base/services/umpnpmgr/rpcserver.c b/base/services/umpnpmgr/rpcserver.c
index 141026b7bd1..70f77600f9c 100644
--- a/base/services/umpnpmgr/rpcserver.c
+++ b/base/services/umpnpmgr/rpcserver.c
@@ -3090,8 +3090,29 @@ WINAPI
PNP_RequestEjectPC(
handle_t hBinding)
{
- UNIMPLEMENTED;
- return CR_CALL_NOT_IMPLEMENTED;
+ WCHAR szDockDeviceInstance[MAX_DEVICE_ID_LEN];
+ PLUGPLAY_CONTROL_RETRIEVE_DOCK_DATA DockData;
+ NTSTATUS Status;
+
+ DPRINT("PNP_RequestEjectPC(%p)\n", hBinding);
+
+ /* Retrieve the dock device */
+ DockData.DeviceInstanceLength = ARRAYSIZE(szDockDeviceInstance);
+ DockData.DeviceInstance = szDockDeviceInstance;
+
+ Status = NtPlugPlayControl(PlugPlayControlRetrieveDock,
+ &DockData,
+ sizeof(DockData));
+ if (!NT_SUCCESS(Status))
+ return NtStatusToCrError(Status);
+
+ /* Eject the dock device */
+ return PNP_RequestDeviceEject(hBinding,
+ szDockDeviceInstance,
+ NULL,
+ NULL,
+ 0,
+ 0);
}