Author: ekohl Date: Sun Jun 4 23:12:58 2006 New Revision: 22218
URL: http://svn.reactos.ru/svn/reactos?rev=22218&view=rev Log: Add PNP_AddID stub and implement CM_Add_ID_ExW.
Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def trunk/reactos/dll/win32/setupapi/cfgmgr.c trunk/reactos/include/reactos/idl/pnp.idl
Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/base/services/umpnpmgr/umpnp... ============================================================================== --- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c (original) +++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Sun Jun 4 23:12:58 2006 @@ -1039,6 +1039,29 @@ }
+/* Function 34 */ +CONFIGRET +PNP_AddID(handle_t BindingHandle, + wchar_t *DeviceInstance, /* in, string, unique */ + wchar_t *DeviceId, /* in, string */ + DWORD Flags) +{ + CONFIGRET ret = CR_SUCCESS; + + DPRINT1("PNP_AddID() called\n"); + DPRINT1(" DeviceInstance: %S\n", DeviceInstance); + DPRINT1(" DeviceId: %S\n", DeviceId); + DPRINT1(" Flags: %lx\n", Flags); + + /* FIXME */ + ret = CR_CALL_NOT_IMPLEMENTED; + + DPRINT1("PNP_AddID() done (returns %lx)\n", ret); + + return ret; +} + + /* Function 38 */ CONFIGRET PNP_IsDockStationPresent(handle_t BindingHandle,
Modified: trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.... ============================================================================== --- trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def (original) +++ trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def Sun Jun 4 23:12:58 2006 @@ -1,7 +1,7 @@ ; ; ReactOS cfgmgr32.dll ; -; Copyright (C) 2005 Eric Kohl +; Copyright (C) 2005, 2006 Eric Kohl ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by @@ -27,10 +27,10 @@ ;CMP_WaitServices ;CM_Add_Empty_Log_Conf@16=SETUPAPI.CM_Add_Empty_Log_Conf ;CM_Add_Empty_Log_Conf_Ex@20=SETUPAPI.CM_Add_Empty_Log_Conf_Ex -;CM_Add_IDA -;CM_Add_IDW -;CM_Add_ID_ExA -;CM_Add_ID_ExW +CM_Add_IDA@12=SETUPAPI.CM_Add_IDA +CM_Add_IDW@12=SETUPAPI.CM_Add_IDW +CM_Add_ID_ExA@16=SETUPAPI.CM_Add_ID_ExA +CM_Add_ID_ExW@16=SETUPAPI.CM_Add_ID_ExW ;CM_Add_Range ;CM_Add_Res_Des ;CM_Add_Res_Des_Ex
Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.c?... ============================================================================== --- trunk/reactos/dll/win32/setupapi/cfgmgr.c (original) +++ trunk/reactos/dll/win32/setupapi/cfgmgr.c Sun Jun 4 23:12:58 2006 @@ -171,8 +171,48 @@ CONFIGRET WINAPI CM_Add_ID_ExW( DEVINST dnDevInst, PWSTR pszID, ULONG ulFlags, HMACHINE hMachine) { - FIXME("%p %s %lx %p\n", dnDevInst, debugstr_w(pszID), ulFlags, hMachine); - return CR_CALL_NOT_IMPLEMENTED; + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst; + + TRACE("%p %s %lx %p\n", dnDevInst, debugstr_w(pszID), ulFlags, hMachine); + + if (!IsUserAdmin()) + return CR_ACCESS_DENIED; + + if (dnDevInst == 0) + return CR_INVALID_DEVINST; + + if (pszID == NULL) + return CR_INVALID_POINTER; + + if (ulFlags & ~CM_ADD_ID_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 = StringTableStringFromId(StringTable, dnDevInst); + if (lpDevInst == NULL) + return CR_INVALID_DEVNODE; + + return PNP_AddID(BindingHandle, + lpDevInst, + pszID, + ulFlags); }
Modified: trunk/reactos/include/reactos/idl/pnp.idl URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/include/reactos/idl/pnp.idl?... ============================================================================== --- trunk/reactos/include/reactos/idl/pnp.idl (original) +++ trunk/reactos/include/reactos/idl/pnp.idl Sun Jun 4 23:12:58 2006 @@ -174,6 +174,12 @@ [in, string] wchar_t *DeviceInstance, [in] DWORD Flags);
+ /* Function 34 */ + CONFIGRET PNP_AddID(handle_t BindingHandle, + [in, string, unique] wchar_t *DeviceInstance, + [in, string] wchar_t *DeviceId, + [in] DWORD Flags); + /* Function 38 */ CONFIGRET PNP_IsDockStationPresent(handle_t BindingHandle, [out]PBOOL Present);