[v2] setupapi: Stub CM_Open_DevNode_Key and CM_Get_Child

Christoph Brill egore911 at gmail.com
Thu Jan 19 08:05:01 CST 2017


Both are necessary to start Lord of the Rings Online as of January 2017.

v2: - Update cfgmgr32.spec and api-ms-win-devices-config-l1-1-1.spec with
      forwards to the added methods.
    - Add methods signatures, REGDISPOSITION typedef and values as well as
      CM_REGISTRY_* defines to cfgmgr32.h

Signed-off-by: Christoph Brill <egore911 at gmail.com>
---
 .../api-ms-win-devices-config-l1-1-1.spec          |  4 ++--
 dlls/cfgmgr32/cfgmgr32.spec                        |  4 ++--
 dlls/setupapi/setupapi.spec                        |  4 ++--
 dlls/setupapi/stubs.c                              | 22 ++++++++++++++++++++++
 include/cfgmgr32.h                                 | 14 ++++++++++++++
 5 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/dlls/api-ms-win-devices-config-l1-1-1/api-ms-win-devices-config-l1-1-1.spec b/dlls/api-ms-win-devices-config-l1-1-1/api-ms-win-devices-config-l1-1-1.spec
index 4302bbf8c8..7888d802be 100644
--- a/dlls/api-ms-win-devices-config-l1-1-1/api-ms-win-devices-config-l1-1-1.spec
+++ b/dlls/api-ms-win-devices-config-l1-1-1/api-ms-win-devices-config-l1-1-1.spec
@@ -3,7 +3,7 @@
 @ stub CM_Delete_DevNode_Key
 @ stub CM_Disable_DevNode
 @ stub CM_Enable_DevNode
-@ stub CM_Get_Child
+@ stdcall CM_Get_Child(ptr long long) setupapi.CM_Get_Child
 @ stub CM_Get_Class_Property_Keys
 @ stub CM_Get_Class_PropertyW
 @ stdcall CM_Get_Class_Registry_PropertyW(ptr long ptr ptr long long ptr) setupapi.CM_Get_Class_Registry_PropertyW
@@ -26,7 +26,7 @@
 @ stub CM_MapCrToWin32Err
 @ stub CM_Open_Class_KeyW
 @ stub CM_Open_Device_Interface_KeyW
-@ stub CM_Open_DevNode_Key
+@ stdcall CM_Open_DevNode_Key(long long long long ptr long) setupapi.CM_Open_DevNode_Key
 @ stub CM_Query_And_Remove_SubTreeW
 @ stub CM_Register_Notification
 @ stub CM_Set_Class_PropertyW
diff --git a/dlls/cfgmgr32/cfgmgr32.spec b/dlls/cfgmgr32/cfgmgr32.spec
index 116180c1b1..4ca4d3c856 100644
--- a/dlls/cfgmgr32/cfgmgr32.spec
+++ b/dlls/cfgmgr32/cfgmgr32.spec
@@ -42,7 +42,7 @@
 @ stub CM_Free_Res_Des
 @ stub CM_Free_Res_Des_Ex
 @ stub CM_Free_Res_Des_Handle
-@ stub CM_Get_Child
+@ stdcall CM_Get_Child(ptr long long) setupapi.CM_Get_Child
 @ stub CM_Get_Child_Ex
 @ stub CM_Get_Class_Key_NameA
 @ stub CM_Get_Class_Key_NameW
@@ -133,7 +133,7 @@
 @ stub CM_Open_Class_KeyW
 @ stub CM_Open_Class_Key_ExA
 @ stub CM_Open_Class_Key_ExW
-@ stub CM_Open_DevNode_Key
+@ stdcall CM_Open_DevNode_Key(long long long long ptr long) setupapi.CM_Open_DevNode_Key
 @ stub CM_Open_DevNode_Key_Ex
 @ stub CM_Query_Arbitrator_Free_Data
 @ stub CM_Query_Arbitrator_Free_Data_Ex
diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec
index 0eb8359ee1..5c57c23431 100644
--- a/dlls/setupapi/setupapi.spec
+++ b/dlls/setupapi/setupapi.spec
@@ -53,7 +53,7 @@
 @ stub CM_Free_Res_Des
 @ stub CM_Free_Res_Des_Ex
 @ stub CM_Free_Res_Des_Handle
-@ stub CM_Get_Child
+@ stdcall CM_Get_Child(ptr long long)
 @ stub CM_Get_Child_Ex
 @ stub CM_Get_Class_Key_NameA
 @ stub CM_Get_Class_Key_NameW
@@ -144,7 +144,7 @@
 @ stub CM_Open_Class_KeyW
 @ stub CM_Open_Class_Key_ExA
 @ stub CM_Open_Class_Key_ExW
-@ stub CM_Open_DevNode_Key
+@ stdcall CM_Open_DevNode_Key(long long long long ptr long)
 @ stub CM_Open_DevNode_Key_Ex
 @ stub CM_Query_And_Remove_SubTreeA
 @ stub CM_Query_And_Remove_SubTreeW
diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c
index 6ecf240c86..9b71c1c149 100644
--- a/dlls/setupapi/stubs.c
+++ b/dlls/setupapi/stubs.c
@@ -79,6 +79,28 @@ CONFIGRET WINAPI CM_Disconnect_Machine(HMACHINE handle)
 }
 
 /***********************************************************************
+ *             CM_Open_DevNode_Key  (SETUPAPI.@)
+ */
+CONFIGRET WINAPI CM_Open_DevNode_Key(
+    DEVINST dnDevInst, REGSAM access, ULONG ulHardwareProfile, REGDISPOSITION disposition,
+    PHKEY phkDevice, ULONG ulFlags)
+{
+    FIXME("0x%08x 0x%08x 0x%08x 0x%08x %p 0x%08x : stub\n", dnDevInst, access, ulHardwareProfile,
+          disposition, phkDevice, ulFlags);
+    return CR_SUCCESS;
+}
+
+/***********************************************************************
+ *             CM_Get_Child  (SETUPAPI.@)
+ */
+CONFIGRET WINAPI CM_Get_Child(
+    PDEVINST pdnDevInst, DEVINST dnDevInst, ULONG ulFlags)
+{
+    FIXME("%p 0x%08x 0x%08x: stub\n", pdnDevInst, dnDevInst, ulFlags);
+    return CR_SUCCESS;
+}
+
+/***********************************************************************
  *             CM_Get_Device_ID_ExA  (SETUPAPI.@)
  */
 DWORD WINAPI CM_Get_Device_ID_ExA(
diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h
index 7dc31e1413..4606389b9b 100644
--- a/include/cfgmgr32.h
+++ b/include/cfgmgr32.h
@@ -25,6 +25,8 @@
 # include <guiddef.h>
 #endif
 
+#include <winreg.h>
+
 /* cfgmgr32 doesn't use the normal convention, it adds an underscore before A/W */
 #ifdef WINE_NO_UNICODE_MACROS
 # define DECL_WINELIB_CFGMGR32_TYPE_AW(type)  /* nothing */
@@ -158,11 +160,20 @@ typedef DWORD CONFIGRET;
 #define CM_CRP_MIN                      CM_DRP_MIN
 #define CM_CRP_MAX                      CM_DRP_MAX
 
+#define RegDisposition_OpenAlways       0x00
+#define RegDisposition_OpenExisting     0x01
+
+#define CM_REGISTRY_HARDWARE            0x0000
+#define CM_REGISTRY_SOFTWARE            0x0001
+#define CM_REGISTRY_USER                0x0100
+#define CM_REGISTRY_CONFIG              0x0200
+
 typedef DWORD DEVINST, *PDEVINST;
 typedef DWORD DEVNODE, *PDEVNODE;
 typedef HANDLE HMACHINE, *PHMACHINE;
 typedef CHAR *DEVNODEID_A, *DEVINSTID_A;
 typedef WCHAR *DEVNODEID_W, *DEVINSTID_W;
+typedef ULONG REGDISPOSITION;
 
 DECL_WINELIB_CFGMGR32_TYPE_AW(DEVNODEID)
 DECL_WINELIB_CFGMGR32_TYPE_AW(DEVINSTID)
@@ -196,6 +207,9 @@ CMAPI WORD      WINAPI CM_Get_Version(void);
 CMAPI CONFIGRET WINAPI CM_Locate_DevNodeA(PDEVINST,DEVINSTID_A,ULONG);
 CMAPI CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST,DEVINSTID_W,ULONG);
 #define     CM_Locate_DevNode WINELIB_NAME_AW(CM_Locate_DevNode)
+CMAPI CONFIGRET WINAPI CM_Open_DevNode_Key(DEVINST dnDevInst, REGSAM access, ULONG ulHardwareProfile,
+                                           REGDISPOSITION disposition, PHKEY phkDevice, ULONG ulFlags);
+CMAPI CONFIGRET WINAPI CM_Get_Child(PDEVINST pdnDevInst, DEVINST dnDevInst, ULONG ulFlags);
 
 #ifdef __cplusplus
 }
-- 
2.11.0




More information about the wine-patches mailing list