Author: ekohl
Date: Fri Mar 11 18:58:23 2011
New Revision: 51020
URL:
http://svn.reactos.org/svn/reactos?rev=51020&view=rev
Log:
[SETUPAPI]
Implement CM_Register_Device_Driver[_Ex].
Modified:
trunk/reactos/dll/win32/setupapi/cfgmgr.c
trunk/reactos/dll/win32/setupapi/setupapi.spec
Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Fri Mar 11 18:58:23 2011
@@ -4546,6 +4546,72 @@
pulLength,
&ulTransferLength,
0);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return ret;
+}
+
+
+/***********************************************************************
+ * CM_Register_Device_Driver [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Register_Device_Driver(
+ DEVINST dnDevInst, ULONG ulFlags)
+{
+ TRACE("%lx 0x%08lx\n", dnDevInst, ulFlags);
+ return CM_Register_Device_Driver_Ex(dnDevInst, ulFlags, NULL);
+}
+
+
+/***********************************************************************
+ * CM_Register_Device_Driver [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Register_Device_Driver_Ex(
+ DEVINST dnDevInst, ULONG ulFlags, HMACHINE hMachine)
+{
+ RPC_BINDING_HANDLE BindingHandle = NULL;
+ HSTRING_TABLE StringTable = NULL;
+ LPWSTR lpDevInst;
+ CONFIGRET ret;
+
+ TRACE("%lx 0x%08lx %p\n", dnDevInst, ulFlags, hMachine);
+
+ if (dnDevInst == 0)
+ return CR_INVALID_DEVNODE;
+
+ if (ulFlags & ~CM_REGISTER_DEVICE_DRIVER_BITS)
+ return CR_INVALID_FLAG;
+
+ if (hMachine != NULL)
+ {
+ BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
+ if (BindingHandle == NULL)
+ return CR_FAILURE;
+
+ StringTable = ((PMACHINE_INFO)hMachine)->StringTable;
+ if (StringTable == 0)
+ return CR_FAILURE;
+ }
+ else
+ {
+ if (!PnpGetLocalHandles(&BindingHandle, &StringTable))
+ return CR_FAILURE;
+ }
+
+ lpDevInst = pSetupStringTableStringFromId(StringTable, dnDevInst);
+ if (lpDevInst == NULL)
+ return CR_INVALID_DEVNODE;
+
+ RpcTryExcept
+ {
+ ret = PNP_RegisterDriver(BindingHandle,
+ lpDevInst,
+ ulFlags);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Fri Mar 11 18:58:23 2011
@@ -168,8 +168,8 @@
@ stub CM_Query_Resource_Conflict_List
@ stdcall CM_Reenumerate_DevNode(long long)
@ stdcall CM_Reenumerate_DevNode_Ex(long long long)
-@ stub CM_Register_Device_Driver
-@ stub CM_Register_Device_Driver_Ex
+@ stdcall CM_Register_Device_Driver(long long)
+@ stdcall CM_Register_Device_Driver_Ex(long long ptr)
@ stdcall CM_Register_Device_InterfaceA(long ptr str str ptr long)
@ stdcall CM_Register_Device_InterfaceW(long ptr wstr wstr ptr long)
@ stdcall CM_Register_Device_Interface_ExA(long ptr str str ptr long long)