diff --git a/reactos/include/idl/pnp.idl b/reactos/include/idl/pnp.idl index f42d2a6cfc6..d9ff1a7959c 100644 --- a/reactos/include/idl/pnp.idl +++ b/reactos/include/idl/pnp.idl @@ -134,4 +134,7 @@ interface pnp /* Function 38 */ CONFIGRET PNP_IsDockStationPresent(handle_t BindingHandle, [out]PBOOL Present); + + /* Function 39 */ + CONFIGRET PNP_RequestEjectPC(handle_t BindingHandle); } diff --git a/reactos/include/wine/cfgmgr32.h b/reactos/include/wine/cfgmgr32.h index f9cd9bd0edf..70853f60332 100644 --- a/reactos/include/wine/cfgmgr32.h +++ b/reactos/include/wine/cfgmgr32.h @@ -223,6 +223,9 @@ CONFIGRET WINAPI CM_Open_Class_Key_ExA(LPGUID, LPCSTR, REGSAM, REGDISPOSITION, P CONFIGRET WINAPI CM_Open_Class_Key_ExW(LPGUID, LPCWSTR, REGSAM, REGDISPOSITION, PHKEY, ULONG, HMACHINE); #define CM_Open_Class_Key_Ex WINELIB_NAME_AW(CM_Open_Class_Key_Ex) +CONFIGRET WINAPI CM_Request_Eject_PC( VOID ); +CONFIGRET WINAPI CM_Request_Eject_PC_Ex( HMACHINE ); + CONFIGRET WINAPI CM_Set_DevNode_Problem( DEVINST, ULONG, ULONG ); CONFIGRET WINAPI CM_Set_DevNode_Problem_Ex( DEVINST, ULONG, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Set_DevNode_Registry_PropertyA( DEVINST, ULONG, PCVOID, ULONG, ULONG ); diff --git a/reactos/lib/setupapi/cfgmgr.c b/reactos/lib/setupapi/cfgmgr.c index 75d9055e998..3b988581906 100644 --- a/reactos/lib/setupapi/cfgmgr.c +++ b/reactos/lib/setupapi/cfgmgr.c @@ -1539,7 +1539,7 @@ CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex( { RPC_BINDING_HANDLE BindingHandle = NULL; - FIXME("%p %lx\n", pbPresent, hMachine); + TRACE("%p %lx\n", pbPresent, hMachine); if (pbPresent == NULL) return CR_INVALID_POINTER; @@ -1835,6 +1835,42 @@ CONFIGRET WINAPI CM_Open_Class_Key_ExW( } +/*********************************************************************** + * CM_Request_Eject_PC [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Request_Eject_PC(VOID) +{ + TRACE("\n"); + return CM_Request_Eject_PC_Ex(NULL); +} + + +/*********************************************************************** + * CM_Request_Eject_PC_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Request_Eject_PC_Ex( + HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + + TRACE("%lx\n", hMachine); + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, NULL)) + return CR_FAILURE; + } + + return PNP_RequestEjectPC(BindingHandle); +} + + /*********************************************************************** * CM_Set_DevNode_Problem [SETUPAPI.@] */ diff --git a/reactos/services/umpnpmgr/umpnpmgr.c b/reactos/services/umpnpmgr/umpnpmgr.c index 48ca7315f59..1fc2b4f8c51 100644 --- a/reactos/services/umpnpmgr/umpnpmgr.c +++ b/reactos/services/umpnpmgr/umpnpmgr.c @@ -794,6 +794,7 @@ PNP_SetDeviceProblem(handle_t BindingHandle, } +/* Function 38 */ CONFIGRET PNP_IsDockStationPresent(handle_t BindingHandle, unsigned long *Present) @@ -844,6 +845,22 @@ PNP_IsDockStationPresent(handle_t BindingHandle, } +/* Function 39 */ +CONFIGRET +PNP_RequestEjectPC(handle_t BindingHandle) +{ + CONFIGRET ret = CR_SUCCESS; + + DPRINT1("PNP_RequestEjectPC() called\n"); + + ret = CR_FAILURE; /* FIXME */ + + DPRINT1("PNP_RequestEjectPC() done (returns %lx)\n", ret); + + return ret; +} + + static DWORD WINAPI PnpEventThread(LPVOID lpParameter) { diff --git a/reactos/w32api/include/ddk/cfgmgr32.h b/reactos/w32api/include/ddk/cfgmgr32.h index b030d1b6a77..173f7ebc464 100644 --- a/reactos/w32api/include/ddk/cfgmgr32.h +++ b/reactos/w32api/include/ddk/cfgmgr32.h @@ -1773,8 +1773,18 @@ CM_Request_Device_EjectW( #define CM_Request_Device_Eject_Ex CM_Request_Device_Eject_ExA #endif /* UNICODE */ -/* FIXME: Obsolete CM_Request_Eject_PC */ -/* FIXME: Obsolete CM_Request_Eject_PC_Ex */ +CMAPI +CONFIGRET +WINAPI +CM_Request_Eject_PC( + VOID); + +CMAPI +CONFIGRET +WINAPI +CM_Request_Eject_PC_Ex( + IN HMACHINE hMachine); + /* FIXME: Obsolete CM_Run_Detection */ /* FIXME: Obsolete CM_Run_Detection_Ex */ /* FIXME: Obsolete CM_Set_Class_Registry_Property */