Author: ekohl
Date: Sun Jul 9 01:37:32 2006
New Revision: 22949
URL:
http://svn.reactos.org/svn/reactos?rev=22949&view=rev
Log:
Implement CM_Add_Empty_Log_Conf[_Ex] and add PNP_AddEmptyLogConf stub.
Modified:
trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def
trunk/reactos/dll/win32/setupapi/cfgmgr.c
trunk/reactos/dll/win32/setupapi/setupapi.spec
trunk/reactos/include/ddk/cfgmgr32.h
trunk/reactos/include/reactos/idl/pnp.idl
trunk/reactos/include/reactos/wine/cfgmgr32.h
Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
==============================================================================
--- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c (original)
+++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Sun Jul 9 01:37:32 2006
@@ -1245,6 +1245,26 @@
}
+/* Function 42 */
+CONFIGRET
+PNP_AddEmptyLogConf(handle_t BindingHandle,
+ wchar_t *DeviceInstance,
+ ULONG ulPriority,
+ ULONG *ulLogConfTag,
+ ULONG ulFlags)
+{
+ CONFIGRET ret = CR_SUCCESS;
+
+ DPRINT1("PNP_AddEmptyLogConf() called\n");
+
+ *ulLogConfTag = 0; /* FIXME */
+
+ DPRINT1("PNP_AddEmptyLogConf() done (returns %lx)\n", ret);
+
+ return ret;
+}
+
+
/* Function 58 */
CONFIGRET
PNP_RunDetection(handle_t BindingHandle,
Modified: trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cfgmgr32/cfgmgr3…
==============================================================================
--- trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def (original)
+++ trunk/reactos/dll/win32/cfgmgr32/cfgmgr32.def Sun Jul 9 01:37:32 2006
@@ -25,8 +25,8 @@
;CMP_UnregisterNotification
;CMP_WaitNoPendingInstallEvents
;CMP_WaitServices
-;CM_Add_Empty_Log_Conf(a)16=SETUPAPI.CM_Add_Empty_Log_Conf
-;CM_Add_Empty_Log_Conf_Ex(a)20=SETUPAPI.CM_Add_Empty_Log_Conf_Ex
+CM_Add_Empty_Log_Conf(a)16=SETUPAPI.CM_Add_Empty_Log_Conf
+CM_Add_Empty_Log_Conf_Ex(a)20=SETUPAPI.CM_Add_Empty_Log_Conf_Ex
CM_Add_IDA(a)12=SETUPAPI.CM_Add_IDA
CM_Add_IDW(a)12=SETUPAPI.CM_Add_IDW
CM_Add_ID_ExA(a)16=SETUPAPI.CM_Add_ID_ExA
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 (original)
+++ trunk/reactos/dll/win32/setupapi/cfgmgr.c Sun Jul 9 01:37:32 2006
@@ -46,6 +46,17 @@
} MACHINE_INFO, *PMACHINE_INFO;
+typedef struct _LOG_CONF_INFO
+{
+ ULONG ulMagic;
+ DEVINST dnDevInst;
+ ULONG ulFlags;
+ ULONG ulTag;
+} LOG_CONF_INFO, *PLOG_CONF_INFO;
+
+#define LOG_CONF_MAGIC 0x464E434C /* "LCNF" */
+
+
static BOOL GuidToString(LPGUID Guid, LPWSTR String)
{
LPWSTR lpString;
@@ -116,6 +127,96 @@
break;
Sleep(5000);
+ }
+
+ return ret;
+}
+
+
+/***********************************************************************
+ * CM_Add_Empty_Log_Conf [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Add_Empty_Log_Conf(
+ PLOG_CONF plcLogConf, DEVINST dnDevInst, PRIORITY Priority,
+ ULONG ulFlags)
+{
+ TRACE("%p %p %lu %lx\n", plcLogConf, dnDevInst, Priority, ulFlags);
+ return CM_Add_Empty_Log_Conf_Ex(plcLogConf, dnDevInst, Priority,
+ ulFlags, NULL);
+}
+
+
+/***********************************************************************
+ * CM_Add_Empty_Log_Conf_Ex [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex(
+ PLOG_CONF plcLogConf, DEVINST dnDevInst, PRIORITY Priority,
+ ULONG ulFlags, HMACHINE hMachine)
+{
+ RPC_BINDING_HANDLE BindingHandle = NULL;
+ HSTRING_TABLE StringTable = NULL;
+ ULONG ulLogConfTag = 0;
+ LPWSTR lpDevInst;
+ PLOG_CONF_INFO pLogConfInfo;
+ CONFIGRET ret = CR_SUCCESS;
+
+ FIXME("%p %p %lu %lx %p\n",
+ plcLogConf, dnDevInst, Priority, ulFlags, hMachine);
+
+ if (!IsUserAdmin())
+ return CR_ACCESS_DENIED;
+
+ if (plcLogConf == NULL)
+ return CR_INVALID_POINTER;
+
+ if (dnDevInst == 0)
+ return CR_INVALID_DEVINST;
+
+ if (Priority > 0xFFFF)
+ return CR_INVALID_PRIORITY;
+
+ if (ulFlags & ~(LOG_CONF_BITS | PRIORITY_BIT))
+ 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;
+
+ ret = PNP_AddEmptyLogConf(BindingHandle, lpDevInst, Priority, &ulLogConfTag,
ulFlags);
+ if (ret == CR_SUCCESS)
+ {
+ pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
+ if (pLogConfInfo == NULL)
+ {
+ ret = CR_OUT_OF_MEMORY;
+ }
+ else
+ {
+ pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
+ pLogConfInfo->dnDevInst = dnDevInst;
+ pLogConfInfo->ulFlags = ulFlags;
+ pLogConfInfo->ulTag = ulLogConfTag;
+
+ *plcLogConf = (LOG_CONF)pLogConfInfo;
+
+ ret = CR_SUCCESS;
+ }
}
return ret;
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 (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi.spec Sun Jul 9 01:37:32 2006
@@ -9,8 +9,8 @@
@ stub CMP_UnregisterNotification
@ stub CMP_WaitNoPendingInstallEvents
@ stub CMP_WaitServicesAvailable
-@ stub CM_Add_Empty_Log_Conf
-@ stub CM_Add_Empty_Log_Conf_Ex
+@ stdcall CM_Add_Empty_Log_Conf(ptr ptr long long)
+@ stdcall CM_Add_Empty_Log_Conf_Ex(ptr ptr long long ptr)
@ stdcall CM_Add_IDA(ptr str long)
@ stdcall CM_Add_IDW(ptr wstr long)
@ stdcall CM_Add_ID_ExA(ptr str long ptr)
Modified: trunk/reactos/include/ddk/cfgmgr32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/cfgmgr32.h?rev…
==============================================================================
--- trunk/reactos/include/ddk/cfgmgr32.h (original)
+++ trunk/reactos/include/ddk/cfgmgr32.h Sun Jul 9 01:37:32 2006
@@ -619,6 +619,15 @@
/* FIXME: Missing CMP_WaitServicesAvailable */
/* CM_Add_Empty_Log_Conf.ulFlags constants */
+#define BASIC_LOG_CONF 0x00000000
+#define FILTERED_LOG_CONF 0x00000001
+#define ALLOC_LOG_CONF 0x00000002
+#define BOOT_LOG_CONF 0x00000003
+#define FORCED_LOG_CONF 0x00000004
+#define OVERRIDE_LOG_CONF 0x00000005
+#define NUM_LOG_CONF 0x00000006
+#define LOG_CONF_BITS 0x00000007
+
#define PRIORITY_EQUAL_FIRST 0x00000008
#define PRIORITY_EQUAL_LAST 0x00000000
#define PRIORITY_BIT 0x00000008
Modified: trunk/reactos/include/reactos/idl/pnp.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/pnp.id…
==============================================================================
--- trunk/reactos/include/reactos/idl/pnp.idl (original)
+++ trunk/reactos/include/reactos/idl/pnp.idl Sun Jul 9 01:37:32 2006
@@ -4,6 +4,7 @@
#define WORD unsigned short
#define DWORD unsigned long
+#define ULONG unsigned long
#define CONFIGRET unsigned long
#define BOOL unsigned long
#define PBOOL unsigned long *
@@ -197,6 +198,13 @@
[in, out] unsigned long *Value,
[in] DWORD Flags);
+ /* Function 42 */
+ CONFIGRET PNP_AddEmptyLogConf(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceInstance,
+ [in] ULONG ulPriority,
+ [out] ULONG *ulLogConfTag,
+ [in] ULONG ulFlags);
+
/* Function 58 */
CONFIGRET PNP_RunDetection(handle_t BindingHandle,
[in] unsigned long Flags);
Modified: trunk/reactos/include/reactos/wine/cfgmgr32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/cfgmg…
==============================================================================
--- trunk/reactos/include/reactos/wine/cfgmgr32.h (original)
+++ trunk/reactos/include/reactos/wine/cfgmgr32.h Sun Jul 9 01:37:32 2006
@@ -34,6 +34,11 @@
typedef DWORD DEVNODE;
typedef DEVNODE *PDEVNODE;
typedef ULONG REGDISPOSITION;
+typedef DWORD_PTR LOG_CONF;
+typedef LOG_CONF *PLOG_CONF;
+typedef ULONG PRIORITY;
+typedef PRIORITY *PPRIORITY;
+
typedef CHAR *DEVINSTID_A;
typedef WCHAR *DEVINSTID_W;
@@ -53,6 +58,7 @@
#define CR_INVALID_DEVICE_ID 0x0000001E
#define CR_INVALID_DATA 0x0000001F
#define CR_NO_SUCH_VALUE 0x00000025
+#define CR_INVALID_PRIORITY 0x00000027
#define CR_NO_SUCH_REGISTRY_KEY 0x0000002E
#define CR_INVALID_MACHINENAME 0x0000002F
#define CR_ACCESS_DENIED 0x00000033
@@ -189,12 +195,28 @@
#define CM_SET_HW_PROF_FLAGS_UI_NOT_OK 0x00000001
#define CM_SET_HW_PROF_FLAGS_BITS 0x00000001
+/* ulFlags for Log_Conf functions */
+#define BASIC_LOG_CONF 0x00000000
+#define FILTERED_LOG_CONF 0x00000001
+#define ALLOC_LOG_CONF 0x00000002
+#define BOOT_LOG_CONF 0x00000003
+#define FORCED_LOG_CONF 0x00000004
+#define OVERRIDE_LOG_CONF 0x00000005
+#define NUM_LOG_CONF 0x00000006
+#define LOG_CONF_BITS 0x00000007
+
+#define PRIORITY_EQUAL_FIRST 0x00000008
+#define PRIORITY_EQUAL_LAST 0x00000000
+#define PRIORITY_BIT 0x00000008
+
#define CMP_MAGIC 0x01234567
CONFIGRET WINAPI CMP_Init_Detection( DWORD );
CONFIGRET WINAPI CMP_Report_LogOn( DWORD, DWORD );
+CONFIGRET WINAPI CM_Add_Empty_Log_Conf( PLOG_CONF, DEVINST, PRIORITY, ULONG );
+CONFIGRET WINAPI CM_Add_Empty_Log_Conf_Ex( PLOG_CONF, DEVINST, PRIORITY, ULONG, HMACHINE
);
CONFIGRET WINAPI CM_Add_IDA( DEVINST, PSTR, ULONG );
CONFIGRET WINAPI CM_Add_IDW( DEVINST, PWSTR, ULONG );
#define CM_Add_ID WINELIB_NAME_AW(CM_Add_ID)