From 8135ef1f043756655276ea74f04080411dad52f8 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 16 Jul 2006 12:11:26 +0000 Subject: [PATCH] Implement CM_Get_First_Log_Conf[_Ex] and add PNP_GetFirstLogConf stub. svn path=/trunk/; revision=23074 --- reactos/base/services/umpnpmgr/umpnpmgr.c | 20 ++++++ reactos/dll/win32/cfgmgr32/cfgmgr32.def | 4 +- reactos/dll/win32/setupapi/cfgmgr.c | 78 +++++++++++++++++++++++ reactos/dll/win32/setupapi/setupapi.spec | 4 +- reactos/include/reactos/idl/pnp.idl | 7 ++ reactos/include/reactos/wine/cfgmgr32.h | 2 + 6 files changed, 111 insertions(+), 4 deletions(-) diff --git a/reactos/base/services/umpnpmgr/umpnpmgr.c b/reactos/base/services/umpnpmgr/umpnpmgr.c index e9cd1d8c78b..53e10003b0e 100644 --- a/reactos/base/services/umpnpmgr/umpnpmgr.c +++ b/reactos/base/services/umpnpmgr/umpnpmgr.c @@ -1284,6 +1284,26 @@ PNP_FreeLogConf(handle_t BindingHandle, } +/* Function 42 */ +CONFIGRET +PNP_GetFirstLogConf(handle_t BindingHandle, + wchar_t *DeviceInstance, + ULONG ulPriority, + ULONG *pulLogConfTag, + ULONG ulFlags) +{ + CONFIGRET ret = CR_SUCCESS; + + DPRINT1("PNP_GetFirstLogConf() called\n"); + + *pulLogConfTag = 0; /* FIXME */ + + DPRINT1("PNP_GetFirstLogConf() done (returns %lx)\n", ret); + + return ret; +} + + /* Function 58 */ CONFIGRET PNP_RunDetection(handle_t BindingHandle, diff --git a/reactos/dll/win32/cfgmgr32/cfgmgr32.def b/reactos/dll/win32/cfgmgr32/cfgmgr32.def index e8a29566290..a1e20021a9d 100644 --- a/reactos/dll/win32/cfgmgr32/cfgmgr32.def +++ b/reactos/dll/win32/cfgmgr32/cfgmgr32.def @@ -119,8 +119,8 @@ CM_Get_Device_ID_Size_Ex=SETUPAPI.CM_Get_Device_ID_Size_Ex ;CM_Get_Device_Interface_List_SizeW ;CM_Get_Device_Interface_List_Size_ExA ;CM_Get_Device_Interface_List_Size_ExW -;CM_Get_First_Log_Conf -;CM_Get_First_Log_Conf_Ex +CM_Get_First_Log_Conf=SETUPAPI.CM_Get_First_Log_Conf +CM_Get_First_Log_Conf_Ex=SETUPAPI.CM_Get_First_Log_Conf_Ex CM_Get_Global_State=SETUPAPI.CM_Get_Global_State CM_Get_Global_State_Ex=SETUPAPI.CM_Get_Global_State_Ex CM_Get_HW_Prof_FlagsA=SETUPAPI.CM_Get_HW_Prof_FlagsA diff --git a/reactos/dll/win32/setupapi/cfgmgr.c b/reactos/dll/win32/setupapi/cfgmgr.c index 68308b164b5..156b032c2e2 100644 --- a/reactos/dll/win32/setupapi/cfgmgr.c +++ b/reactos/dll/win32/setupapi/cfgmgr.c @@ -1945,6 +1945,84 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex( } +/*********************************************************************** + * CM_Get_First_Log_Conf [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_First_Log_Conf( + PLOG_CONF plcLogConf, DEVINST dnDevInst, ULONG ulFlags) +{ + TRACE("%p %lx %lx\n", plcLogConf, dnDevInst, ulFlags); + return CM_Get_First_Log_Conf_Ex(plcLogConf, dnDevInst, ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_First_Log_Conf_Ex [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex( + PLOG_CONF plcLogConf, DEVINST dnDevInst, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpDevInst = NULL; + CONFIGRET ret = CR_SUCCESS; + ULONG ulTag; + PLOG_CONF_INFO pLogConfInfo; + + FIXME("%p %lx %lx %lx\n", plcLogConf, dnDevInst, ulFlags, hMachine); + + if (dnDevInst == 0) + return CR_INVALID_DEVINST; + + if (ulFlags & ~LOG_CONF_BITS) + return CR_INVALID_FLAG; + + if (plcLogConf) + *plcLogConf = 0; + + 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; + + ret = PNP_GetFirstLogConf(BindingHandle, + lpDevInst, + ulFlags, + &ulTag, + ulFlags); + if (ret != CR_SUCCESS) + return ret; + + pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO)); + if (pLogConfInfo == NULL) + return CR_OUT_OF_MEMORY; + + pLogConfInfo->ulMagic = LOG_CONF_MAGIC; + pLogConfInfo->dnDevInst = dnDevInst; + pLogConfInfo->ulFlags = ulFlags; + pLogConfInfo->ulTag = ulTag; + + *plcLogConf = (LOG_CONF)pLogConfInfo; + + return CR_SUCCESS; +} + + /*********************************************************************** * CM_Get_Global_State [SETUPAPI.@] */ diff --git a/reactos/dll/win32/setupapi/setupapi.spec b/reactos/dll/win32/setupapi/setupapi.spec index c73e536b76e..a7beb94c5aa 100644 --- a/reactos/dll/win32/setupapi/setupapi.spec +++ b/reactos/dll/win32/setupapi/setupapi.spec @@ -97,8 +97,8 @@ @ stub CM_Get_Device_Interface_List_SizeW @ stub CM_Get_Device_Interface_List_Size_ExA @ stub CM_Get_Device_Interface_List_Size_ExW -@ stub CM_Get_First_Log_Conf -@ stub CM_Get_First_Log_Conf_Ex +@ stdcall CM_Get_First_Log_Conf(ptr long long) +@ stdcall CM_Get_First_Log_Conf_Ex(ptr long long long) @ stdcall CM_Get_Global_State(ptr long) @ stdcall CM_Get_Global_State_Ex(ptr long long) @ stdcall CM_Get_HW_Prof_FlagsA(str long ptr long) diff --git a/reactos/include/reactos/idl/pnp.idl b/reactos/include/reactos/idl/pnp.idl index bf871a55cb2..d19c04992c1 100644 --- a/reactos/include/reactos/idl/pnp.idl +++ b/reactos/include/reactos/idl/pnp.idl @@ -212,6 +212,13 @@ interface pnp [in] ULONG ulLogConfTag, [in] ULONG ulFlags); + /* Function 44 */ + CONFIGRET PNP_GetFirstLogConf(handle_t BindingHandle, + [in, string] wchar_t *DeviceInstance, + [in] ULONG ulPriority, + [out] ULONG *pulLogConfTag, + [in] ULONG ulFlags); + /* Function 58 */ CONFIGRET PNP_RunDetection(handle_t BindingHandle, [in] unsigned long Flags); diff --git a/reactos/include/reactos/wine/cfgmgr32.h b/reactos/include/reactos/wine/cfgmgr32.h index 4943e4dca0c..eade8a52d57 100644 --- a/reactos/include/reactos/wine/cfgmgr32.h +++ b/reactos/include/reactos/wine/cfgmgr32.h @@ -297,6 +297,8 @@ CONFIGRET WINAPI CM_Get_Device_ID_List_Size_ExW( PULONG, PCWSTR, ULONG, HMACHINE #define CM_Get_Device_ID_List_Size_Ex WINELIB_NAME_AW(CM_Get_Device_ID_List_Size_Ex) CONFIGRET WINAPI CM_Get_Device_ID_Size( PULONG, DEVINST, ULONG ); CONFIGRET WINAPI CM_Get_Device_ID_Size_Ex( PULONG, DEVINST, ULONG, HMACHINE ); +CONFIGRET WINAPI CM_Get_First_Log_Conf( PLOG_CONF, DEVINST, ULONG ); +CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex( PLOG_CONF, DEVINST, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_Global_State( PULONG, ULONG ); CONFIGRET WINAPI CM_Get_Global_State_Ex( PULONG, ULONG, HMACHINE ); CONFIGRET WINAPI CM_Get_HW_Prof_FlagsA( DEVINSTID_A, ULONG, PULONG, ULONG );