[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ros-diffs
Subject:    [ros-diffs] [ekohl] 17586: Implement CM_Get_Class_Key_Name[_Ex]A/W
From:       <ekohl () svn ! reactos ! com>
Date:       2005-08-28 15:08:00
Message-ID: 000001c5abe2$47de5980$6b01a8c0 () PENELOPE
[Download RAW message or body]

Implement CM_Get_Class_Key_Name[_Ex]A/W and CM_Open_Class[_Ex]A/W.
Modified: trunk/reactos/include/idl/pnp.idl
Modified: trunk/reactos/include/wine/cfgmgr32.h
Modified: trunk/reactos/lib/setupapi/cfgmgr.c
Modified: trunk/reactos/lib/setupapi/setupapi.spec
Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c
Modified: trunk/reactos/w32api/include/ddk/cfgmgr32.h
  _____  

Modified: trunk/reactos/include/idl/pnp.idl
--- trunk/reactos/include/idl/pnp.idl	2005-08-28 12:23:37 UTC (rev
17585)
+++ trunk/reactos/include/idl/pnp.idl	2005-08-28 15:07:45 UTC (rev
17586)
@@ -69,6 +69,12 @@

                                  [in] unsigned long Length,
                                  [in] unsigned long Flags);
 
+  CONFIGRET PNP_GetClassName(handle_t BindingHandle,
+                             [in, string] wchar_t *ClassGuid,
+                             [out, string, size_is(*Length)] wchar_t
*Buffer,
+                             [in, out] unsigned long *Length,
+                             [in] unsigned long Flags);
+
   CONFIGRET PNP_GetDeviceStatus(handle_t BindingHandle,
                                 [in, string] wchar_t *DeviceInstance,
                                 [out] unsigned long *Status,
  _____  

Modified: trunk/reactos/include/wine/cfgmgr32.h
--- trunk/reactos/include/wine/cfgmgr32.h	2005-08-28 12:23:37 UTC
(rev 17585)
+++ trunk/reactos/include/wine/cfgmgr32.h	2005-08-28 15:07:45 UTC
(rev 17586)
@@ -128,12 +128,17 @@

 CONFIGRET WINAPI CM_Connect_MachineA( PCSTR, PHMACHINE );
 CONFIGRET WINAPI CM_Connect_MachineW( PCWSTR, PHMACHINE );
 #define     CM_Connect_Machine WINELIB_NAME_AW(CM_Connect_Machine)
-
 CONFIGRET WINAPI CM_Disconnect_Machine( HMACHINE );
 CONFIGRET WINAPI CM_Enumerate_Classes( ULONG, LPGUID, ULONG );
 CONFIGRET WINAPI CM_Enumerate_Classes_Ex( ULONG, LPGUID, ULONG,
HMACHINE );
 CONFIGRET WINAPI CM_Get_Child( PDEVINST, DEVINST, ULONG );
 CONFIGRET WINAPI CM_Get_Child_Ex( PDEVINST, DEVINST, ULONG, HMACHINE );
+CONFIGRET WINAPI CM_Get_Class_Key_NameA( LPGUID, LPSTR, PULONG, ULONG
);
+CONFIGRET WINAPI CM_Get_Class_Key_NameW( LPGUID, LPWSTR, PULONG, ULONG
);
+#define     CM_Get_Class_Key_Name
WINELIB_NAME_AW(CM_Get_Class_Key_Name)
+CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA( LPGUID, LPSTR, PULONG,
ULONG, HMACHINE );
+CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW( LPGUID, LPWSTR, PULONG,
ULONG, HMACHINE );
+#define     CM_Get_Class_Key_Name_Ex
WINELIB_NAME_AW(CM_Get_Class_Key_Name_Ex)
 CONFIGRET WINAPI CM_Get_Depth( PULONG, DEVINST, ULONG );
 CONFIGRET WINAPI CM_Get_Depth_Ex( PULONG, DEVINST, ULONG, HMACHINE );
 CONFIGRET WINAPI CM_Get_DevNode_Registry_PropertyA( DEVINST, ULONG,
PULONG, PVOID, PULONG, ULONG );
  _____  

Modified: trunk/reactos/lib/setupapi/cfgmgr.c
--- trunk/reactos/lib/setupapi/cfgmgr.c	2005-08-28 12:23:37 UTC (rev
17585)
+++ trunk/reactos/lib/setupapi/cfgmgr.c	2005-08-28 15:07:45 UTC (rev
17586)
@@ -41,11 +41,18 @@

 WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
 /* Registry key and value names */
+static const WCHAR Backslash[] = {'\\', 0};
+static const WCHAR Class[]  = {'C','l','a','s','s',0};
+
 static const WCHAR ControlClass[] = {'S','y','s','t','e','m','\\',
 
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\'
,
                                      'C','o','n','t','r','o','l','\\',
                                      'C','l','a','s','s',0};
 
+static const WCHAR DeviceClasses[] = {'S','y','s','t','e','m','\\',
+
'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\'
,
+                                      'C','o','n','t','r','o','l','\\',
+
'D','e','v','i','c','e','C','l','a','s','s','e','s',0};
 
 typedef struct _MACHINE_INFO
 {
@@ -318,6 +325,76 @@
 
 
 
/***********************************************************************
+ * CM_Get_Class_Key_NameA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_NameA(
+    LPGUID ClassGuid, LPSTR pszKeyName, PULONG pulLength, ULONG
ulFlags)
+{
+    TRACE("%p %p %p %lx\n",
+          ClassGuid, pszKeyName, pulLength, ulFlags);
+    return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
+                                     ulFlags, NULL);
+}
+
+
+/**********************************************************************
*
+ * CM_Get_Class_Key_NameW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_NameW(
+    LPGUID ClassGuid, LPWSTR pszKeyName, PULONG pulLength, ULONG
ulFlags)
+{
+    TRACE("%p %p %p %lx\n",
+          ClassGuid, pszKeyName, pulLength, ulFlags);
+    return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
+                                     ulFlags, NULL);
+}
+
+
+/**********************************************************************
*
+ * CM_Get_Class_Key_Name_ExA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA(
+    LPGUID ClassGuid, LPSTR pszKeyName, PULONG pulLength, ULONG
ulFlags,
+    HMACHINE hMachine)
+{
+    FIXME("%p %p %p %lx %lx\n",
+          ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
+    return CR_FAILURE;
+}
+
+
+/**********************************************************************
*
+ * CM_Get_Class_Key_Name_ExW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW(
+    LPGUID ClassGuid, LPWSTR pszKeyName, PULONG pulLength, ULONG
ulFlags,
+    HMACHINE hMachine)
+{
+    FIXME("%p %p %p %lx %lx\n",
+          ClassGuid, pszKeyName, pulLength, ulFlags, hMachine);
+
+    if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
+        return CR_INVALID_POINTER;
+
+    if (ulFlags != 0)
+        return CR_INVALID_FLAG;
+
+    if (*pulLength < MAX_GUID_STRING_LEN)
+    {
+        *pulLength = 0;
+        return CR_BUFFER_SMALL;
+    }
+
+    if (UuidToStringW(ClassGuid, &pszKeyName) != RPC_S_OK)
+        return CR_INVALID_DATA;
+
+    *pulLength = MAX_GUID_STRING_LEN;
+
+    return CR_SUCCESS;
+}
+
+
+/**********************************************************************
*
  * CM_Get_Depth [SETUPAPI.@]
  */
 CONFIGRET WINAPI CM_Get_Depth(
@@ -1246,6 +1323,165 @@
 
 
 
/***********************************************************************
+ * CM_Open_Class_KeyA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_KeyA(
+    LPGUID pClassGuid, LPCSTR pszClassName, REGSAM samDesired,
+    REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags)
+{
+    TRACE("%p %s %lx %lx %p %lx\n",
+          debugstr_guid(pClassGuid), pszClassName,
+          samDesired, Disposition, phkClass, ulFlags);
+
+    return CM_Open_Class_Key_ExA(pClassGuid, pszClassName, samDesired,
+                                 Disposition, phkClass, ulFlags, NULL);
+}
+
+
+/**********************************************************************
*
+ * CM_Open_Class_KeyW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_KeyW(
+    LPGUID pClassGuid, LPCWSTR pszClassName, REGSAM samDesired,
+    REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags)
+{
+    TRACE("%p %s %lx %lx %p %lx\n",
+          debugstr_guid(pClassGuid), debugstr_w(pszClassName),
+          samDesired, Disposition, phkClass, ulFlags);
+
+    return CM_Open_Class_Key_ExW(pClassGuid, pszClassName, samDesired,
+                                 Disposition, phkClass, ulFlags, NULL);
+}
+
+
+/**********************************************************************
*
+ * CM_Open_Class_Key_ExA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_Key_ExA(
+    LPGUID pClassGuid, LPCSTR pszClassName, REGSAM samDesired,
+    REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags,
+    HMACHINE hMachine)
+{
+    CONFIGRET rc = CR_SUCCESS;
+    LPWSTR pszClassNameW = NULL;
+
+    TRACE("%p %s %lx %lx %p %lx %lx\n",
+          debugstr_guid(pClassGuid), pszClassName,
+          samDesired, Disposition, phkClass, ulFlags, hMachine);
+
+    if (pszClassName != NULL)
+    {
+       if (CaptureAndConvertAnsiArg(pszClassName, &pszClassNameW))
+         return CR_INVALID_DATA;
+    }
+
+    rc = CM_Open_Class_Key_ExW(pClassGuid, pszClassNameW, samDesired,
+                               Disposition, phkClass, ulFlags,
hMachine);
+
+    if (pszClassNameW != NULL)
+        MyFree(pszClassNameW);
+
+    return CR_SUCCESS;
+}
+
+
+/**********************************************************************
*
+ * CM_Open_Class_Key_ExW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_Key_ExW(
+    LPGUID pClassGuid, LPCWSTR pszClassName, REGSAM samDesired,
+    REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags,
+    HMACHINE hMachine)
+{
+    WCHAR szKeyName[MAX_PATH];
+    LPWSTR lpGuidString;
+    DWORD dwDisposition;
+    DWORD dwError;
+    HKEY hKey;
+
+    TRACE("%p %s %lx %lx %p %lx %lx\n",
+          debugstr_guid(pClassGuid), debugstr_w(pszClassName),
+          samDesired, Disposition, phkClass, ulFlags, hMachine);
+
+    /* Check Disposition and ulFlags */
+    if ((Disposition & ~RegDisposition_Bits) ||
+        (ulFlags & ~CM_OPEN_CLASS_KEY_BITS))
+        return CR_INVALID_FLAG;
+
+    /* Check phkClass */
+    if (phkClass == NULL)
+        return CR_INVALID_POINTER;
+
+    *phkClass = NULL;
+
+    if (ulFlags == CM_OPEN_CLASS_KEY_INTERFACE &&
+        pszClassName != NULL)
+        return CR_INVALID_DATA;
+
+    if (hMachine == NULL)
+    {
+        hKey = HKEY_LOCAL_MACHINE;
+    }
+    else
+    {
+       if
(RegConnectRegistryW(((PMACHINE_INFO)hMachine)->szMachineName,
+                               HKEY_LOCAL_MACHINE, &hKey))
+           return CR_REGISTRY_ERROR;
+    }
+
+    if (ulFlags & CM_OPEN_CLASS_KEY_INTERFACE)
+    {
+        lstrcpyW(szKeyName, DeviceClasses);
+    }
+    else
+    {
+        lstrcpyW(szKeyName, ControlClass);
+    }
+
+    if (pClassGuid != NULL)
+    {
+        if (UuidToStringW((UUID*)pClassGuid, &lpGuidString) !=
RPC_S_OK)
+        {
+            RegCloseKey(hKey);
+            return CR_INVALID_DATA;
+        }
+
+        lstrcatW(szKeyName, Backslash);
+        lstrcatW(szKeyName, lpGuidString);
+    }
+
+    if (Disposition == RegDisposition_OpenAlways)
+    {
+        dwError = RegCreateKeyExW(hKey, szKeyName, 0, NULL, 0,
samDesired,
+                                  NULL, phkClass, &dwDisposition);
+    }
+    else
+    {
+        dwError = RegOpenKeyExW(hKey, szKeyName, 0, samDesired,
phkClass);
+    }
+
+    RegCloseKey(hKey);
+
+    if (pClassGuid != NULL)
+        RpcStringFreeW(&lpGuidString);
+
+    if (dwError != ERROR_SUCCESS)
+    {
+        *phkClass = NULL;
+        return CR_NO_SUCH_REGISTRY_KEY;
+    }
+
+    if (pszClassName != NULL)
+    {
+        RegSetValueExW(*phkClass, Class, 0, REG_SZ,
(LPBYTE)pszClassName,
+                       (lstrlenW(pszClassName) + 1) * sizeof(WCHAR));
+    }
+
+    return CR_SUCCESS;
+}
+
+
+/**********************************************************************
*
  * CM_Set_DevNode_Problem [SETUPAPI.@]
  */
 CONFIGRET WINAPI CM_Set_DevNode_Problem(
  _____  

Modified: trunk/reactos/lib/setupapi/setupapi.spec
--- trunk/reactos/lib/setupapi/setupapi.spec	2005-08-28 12:23:37 UTC
(rev 17585)
+++ trunk/reactos/lib/setupapi/setupapi.spec	2005-08-28 15:07:45 UTC
(rev 17586)
@@ -55,10 +55,10 @@

 @ stub CM_Free_Res_Des_Handle
 @ stdcall CM_Get_Child(ptr long long)
 @ stdcall CM_Get_Child_Ex(ptr long long long)
-@ stub CM_Get_Class_Key_NameA
-@ stub CM_Get_Class_Key_NameW
-@ stub CM_Get_Class_Key_Name_ExA
-@ stub CM_Get_Class_Key_Name_ExW
+@ stdcall CM_Get_Class_Key_NameA(ptr str ptr long)
+@ stdcall CM_Get_Class_Key_NameW(ptr wstr ptr long)
+@ stdcall CM_Get_Class_Key_Name_ExA(ptr str ptr long long)
+@ stdcall CM_Get_Class_Key_Name_ExW(ptr wstr ptr long long)
 @ stub CM_Get_Class_NameA
 @ stub CM_Get_Class_NameW
 @ stub CM_Get_Class_Name_ExA
@@ -139,10 +139,10 @@
 @ stub CM_Move_DevNode
 @ stub CM_Move_DevNode_Ex
 @ stub CM_Next_Range
-@ stub CM_Open_Class_KeyA
-@ stub CM_Open_Class_KeyW
-@ stub CM_Open_Class_Key_ExA
-@ stub CM_Open_Class_Key_ExW
+@ stdcall CM_Open_Class_KeyA(ptr str long long ptr long)
+@ stdcall CM_Open_Class_KeyW(ptr wstr long long ptr long)
+@ stdcall CM_Open_Class_Key_ExA(ptr str long long ptr long long)
+@ stdcall CM_Open_Class_Key_ExW(ptr wstr long long ptr long long)
 @ stub CM_Open_DevNode_Key
 @ stub CM_Open_DevNode_Key_Ex
 @ stub CM_Query_Arbitrator_Free_Data
  _____  

Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c
--- trunk/reactos/services/umpnpmgr/umpnpmgr.c	2005-08-28 12:23:37 UTC
(rev 17585)
+++ trunk/reactos/services/umpnpmgr/umpnpmgr.c	2005-08-28 15:07:45 UTC
(rev 17586)
@@ -635,6 +635,55 @@

 
 
 CONFIGRET
+PNP_GetClassName(handle_t BindingHandle,
+                 wchar_t *ClassGuid,    /* in */
+                 wchar_t *Buffer,       /* out */
+                 unsigned long *Length, /* in out */
+                 unsigned long Flags)
+{
+    WCHAR szKeyName[MAX_PATH];
+    CONFIGRET ret = CR_SUCCESS;
+    HKEY hKey = NULL;
+    ULONG ulSize;
+
+    DPRINT1("PNP_GetClassName() called\n");
+
+    lstrcpyW(szKeyName, L"System\\CurrentControlSet\\Control\\Class");
+    lstrcatW(szKeyName, L"\\");
+    lstrcatW(szKeyName, ClassGuid);
+
+    if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+                      szKeyName,
+                      0,
+                      KEY_QUERY_VALUE,
+                      &hKey))
+        return CR_REGISTRY_ERROR;
+
+    ulSize = *Length * sizeof(WCHAR);
+    if (RegQueryValueExW(hKey,
+                         L"Class",
+                         NULL,
+                         NULL,
+                         (LPBYTE)Buffer,
+                         &ulSize))
+    {
+        *Length = 0;
+        ret = CR_REGISTRY_ERROR;
+    }
+    else
+    {
+        *Length = ulSize / sizeof(WCHAR);
+    }
+
+    RegCloseKey(hKey);
+
+    DPRINT1("PNP_GetClassName() done (returns %lx)\n", ret);
+
+    return ret;
+}
+
+
+CONFIGRET
 PNP_GetDeviceStatus(handle_t BindingHandle,
                     wchar_t *DeviceInstance,
                     unsigned long *pStatus,
  _____  

Modified: trunk/reactos/w32api/include/ddk/cfgmgr32.h
--- trunk/reactos/w32api/include/ddk/cfgmgr32.h	2005-08-28 12:23:37 UTC
(rev 17585)
+++ trunk/reactos/w32api/include/ddk/cfgmgr32.h	2005-08-28 15:07:45 UTC
(rev 17586)
@@ -787,7 +787,7 @@

 #define CM_Enumerate_Enumerators_Ex CM_Enumerate_Enumerators_ExW
 #else
 #define CM_Enumerate_Enumerators CM_Enumerate_EnumeratorsA
-#define CM_Enumerate_Enumerators_Ex CM_Enumerate_Enumerators_ExW
+#define CM_Enumerate_Enumerators_Ex CM_Enumerate_Enumerators_ExA
 #endif /* UNICODE */
 
 /* FIXME: Obsolete CM_Find_Range */
@@ -864,8 +864,53 @@
 
 /* FIXME: Obsolete CM_Get_Class_Name */
 /* FIXME: Obsolete CM_Get_Class_Name_Ex */
-/* FIXME: Obsolete CM_Get_Class_Key_Name */
-/* FIXME: Obsolete CM_Get_Class_Key_Name_Ex */
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_NameA(
+  IN LPGUID  ClassGuid,
+  OUT LPSTR  pszKeyName,
+  IN OUT PULONG  pulLength,
+  IN ULONG  ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_NameW(
+  IN LPGUID  ClassGuid,
+  OUT LPWSTR  pszKeyName,
+  IN OUT PULONG  pulLength,
+  IN ULONG  ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_Name_ExA(
+  IN LPGUID  ClassGuid,
+  OUT LPSTR  pszKeyName,
+  IN OUT PULONG  pulLength,
+  IN ULONG  ulFlags,
+  IN HMACHINE  hMachine);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_Name_ExW(
+  IN LPGUID  ClassGuid,
+  OUT LPWSTR  pszKeyName,
+  IN OUT PULONG  pulLength,
+  IN ULONG  ulFlags,
+  IN HMACHINE  hMachine);
+
+#ifdef UNICODE
+#define CM_Get_Class_Key_Name CM_Get_Class_Key_NameW
+#define CM_Get_Class_Key_Name_Ex CM_Get_Class_Key_Name_ExW
+#else
+#define CM_Get_Class_Key_Name CM_Get_Class_Key_NameA
+#define CM_Get_Class_Key_Name_Ex CM_Get_Class_Key_Name_ExA
+#endif /* UNICODE */
+
 /* FIXME: Obsolete CM_Get_Class_Registry_Property */
 
 CMAPI
@@ -928,7 +973,7 @@
 #define CM_Get_Device_ID_Ex CM_Get_Device_ID_ExW
 #else
 #define CM_Get_Device_ID CM_Get_Device_IDA
-#define CM_Get_Device_ID_Ex CM_Get_Device_ID_ExW
+#define CM_Get_Device_ID_Ex CM_Get_Device_ID_ExA
 #endif /* UNICODE */
 
 CMAPI
@@ -1440,8 +1485,61 @@
 /* FIXME: Obsolete CM_Move_DevNode */
 /* FIXME: Obsolete CM_Move_DevNode_Ex */
 /* FIXME: Obsolete CM_Next_Range */
-/* FIXME: Obsolete CM_Open_Class_Key */
-/* FIXME: Obsolete CM_Open_Class_Key_Ex */
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_KeyA(
+  IN LPGUID  ClassGuid, OPTIONAL
+  IN LPCSTR  pszClassName, OPTIONAL
+  IN REGSAM  samDesired,
+  IN REGDISPOSITION  Disposition,
+  OUT PHKEY  phkClass,
+  IN ULONG  ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_KeyW(
+  IN LPGUID  ClassGuid, OPTIONAL
+  IN LPCWSTR  pszClassName, OPTIONAL
+  IN REGSAM  samDesired,
+  IN REGDISPOSITION  Disposition,
+  OUT PHKEY  phkClass,
+  IN ULONG  ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_Key_ExA(
+  IN LPGUID  pszClassGuid, OPTIONAL
+  IN LPCSTR  pszClassName, OPTIONAL
+  IN REGSAM  samDesired,
+  IN REGDISPOSITION  Disposition,
+  OUT PHKEY  phkClass,
+  IN ULONG  ulFlags,
+  IN HMACHINE  hMachine);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_Key_ExW(
+  IN LPGUID  pszClassGuid, OPTIONAL
+  IN LPCWSTR  pszClassName, OPTIONAL
+  IN REGSAM  samDesired,
+  IN REGDISPOSITION Disposition,
+  OUT PHKEY  phkClass,
+  IN ULONG  ulFlags,
+  IN HMACHINE  hMachine);
+
+#ifdef UNICODE
+#define CM_Open_Class_Key CM_Open_Class_KeyW
+#define CM_Open_Class_Key_Ex CM_Open_Class_Key_ExW
+#else
+#define CM_Open_Class_Key CM_Open_Class_KeyA
+#define CM_Open_Class_Key_Ex CM_Open_Class_Key_ExA
+#endif /* UNICODE */
+
 /* FIXME: Obsolete CM_Open_DevNode_Key */
 /* FIXME: Obsolete CM_Open_DevNode_Key_Ex */
 

[Attachment #3 (text/html)]

<html>
<head>
<style>
<!--
body { background-color:#ffffff }
.file { border:1px solid #eeeeee; margin-top:1em; margin-bottom:1em }
.pathname { font-family:monospace; float:right }
.fileheader { margin-bottom:.5em }
.diff { margin:0 }
.tasklist { padding:4px; border:1px dashed #000000; margin-top:1em }
.tasklist ul { margin-top:0; margin-bottom:0 }
tr.alt { background-color:#eeeeee }
#added { background-color:#ddffdd }
#addedchars { background-color:#99ff99; font-weight:bolder }
tr.alt #added { background-color:#ccf7cc }
#removed { background-color:#ffdddd }
#removedchars { background-color:#ff9999; font-weight:bolder }
tr.alt #removed { background-color:#f7cccc }
#info { color:#888888 }
#context { background-color:#eeeeee }
td {padding-left:.3em; padding-right:.3em }
tr.head { border-bottom-width:1px; border-bottom-style:solid }
tr.head td { padding:0; padding-top:.2em }
.task { background-color:#ffff00 }
.comment { padding:4px; border:1px dashed #000000; background-color:#ffffdd }
.error { color:red }
hr { border-width:0px; height:2px; background:black }
-->
</style>
</head>
<body>
<pre class="comment">Implement CM_Get_Class_Key_Name[_Ex]A/W and \
CM_Open_Class[_Ex]A/W.</pre><pre class="diff" id="context">Modified: \
                trunk/reactos/include/idl/pnp.idl
Modified: trunk/reactos/include/wine/cfgmgr32.h
Modified: trunk/reactos/lib/setupapi/cfgmgr.c
Modified: trunk/reactos/lib/setupapi/setupapi.spec
Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c
Modified: trunk/reactos/w32api/include/ddk/cfgmgr32.h
</pre><hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/include/idl/pnp.idl</b></big></div> <pre class="diff"><small \
                id="info">--- trunk/reactos/include/idl/pnp.idl	2005-08-28 12:23:37 \
                UTC (rev 17585)
+++ trunk/reactos/include/idl/pnp.idl	2005-08-28 15:07:45 UTC (rev 17586)
@@ -69,6 +69,12 @@
</small></pre><pre class="diff" id="context"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;[in] unsigned long Length,  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[in] unsigned \
long Flags);  
</pre><pre class="diff" id="added">+ &nbsp;CONFIGRET PNP_GetClassName(handle_t \
BindingHandle, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [in, string] wchar_t *ClassGuid, + &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
[out, string, size_is(*Length)] wchar_t *Buffer, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [in, out] unsigned \
long *Length, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; [in] unsigned long Flags); +
</pre><pre class="diff" id="context"> &nbsp; CONFIGRET PNP_GetDeviceStatus(handle_t \
BindingHandle,  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [in, string] wchar_t *DeviceInstance,  \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; [out] unsigned long *Status, </pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/include/wine/cfgmgr32.h</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/include/wine/cfgmgr32.h	2005-08-28 12:23:37 UTC (rev \
                17585)
+++ trunk/reactos/include/wine/cfgmgr32.h	2005-08-28 15:07:45 UTC (rev 17586)
@@ -128,12 +128,17 @@
</small></pre><pre class="diff" id="context"> CONFIGRET WINAPI CM_Connect_MachineA( \
PCSTR, PHMACHINE );  CONFIGRET WINAPI CM_Connect_MachineW( PCWSTR, PHMACHINE );
 #define &nbsp; &nbsp; CM_Connect_Machine WINELIB_NAME_AW(CM_Connect_Machine)
</pre><pre class="diff" id="removed">-
</pre><pre class="diff" id="context"> CONFIGRET WINAPI CM_Disconnect_Machine( \
HMACHINE );  CONFIGRET WINAPI CM_Enumerate_Classes( ULONG, LPGUID, ULONG );
 CONFIGRET WINAPI CM_Enumerate_Classes_Ex( ULONG, LPGUID, ULONG, HMACHINE );
 CONFIGRET WINAPI CM_Get_Child( PDEVINST, DEVINST, ULONG );
 CONFIGRET WINAPI CM_Get_Child_Ex( PDEVINST, DEVINST, ULONG, HMACHINE );
</pre><pre class="diff" id="added">+CONFIGRET WINAPI CM_Get_Class_Key_NameA( LPGUID, \
LPSTR, PULONG, ULONG ); +CONFIGRET WINAPI CM_Get_Class_Key_NameW( LPGUID, LPWSTR, \
PULONG, ULONG ); +#define &nbsp; &nbsp; CM_Get_Class_Key_Name \
WINELIB_NAME_AW(CM_Get_Class_Key_Name) +CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA( \
LPGUID, LPSTR, PULONG, ULONG, HMACHINE ); +CONFIGRET WINAPI \
CM_Get_Class_Key_Name_ExW( LPGUID, LPWSTR, PULONG, ULONG, HMACHINE ); +#define &nbsp; \
&nbsp; CM_Get_Class_Key_Name_Ex WINELIB_NAME_AW(CM_Get_Class_Key_Name_Ex) </pre><pre \
class="diff" id="context"> CONFIGRET WINAPI CM_Get_Depth( PULONG, DEVINST, ULONG );  \
CONFIGRET WINAPI CM_Get_Depth_Ex( PULONG, DEVINST, ULONG, HMACHINE );  CONFIGRET \
WINAPI CM_Get_DevNode_Registry_PropertyA( DEVINST, ULONG, PULONG, PVOID, PULONG, \
ULONG ); </pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/lib/setupapi/cfgmgr.c</b></big></div> <pre class="diff"><small \
                id="info">--- trunk/reactos/lib/setupapi/cfgmgr.c	2005-08-28 12:23:37 \
                UTC (rev 17585)
+++ trunk/reactos/lib/setupapi/cfgmgr.c	2005-08-28 15:07:45 UTC (rev 17586)
@@ -41,11 +41,18 @@
</small></pre><pre class="diff" id="context"> WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
 
 /* Registry key and value names */
</pre><pre class="diff" id="added">+static const WCHAR Backslash[] = {'\\', 0};
+static const WCHAR Class[] &nbsp;= {'C','l','a','s','s',0};
+
</pre><pre class="diff" id="context"> static const WCHAR ControlClass[] = \
{'S','y','s','t','e','m','\\',  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',  \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'C','o','n','t','r','o','l','\\',  \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'C','l','a','s','s',0};  
</pre><pre class="diff" id="added">+static const WCHAR DeviceClasses[] = \
{'S','y','s','t','e','m','\\', + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', + \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'C','o','n','t','r','o','l','\\', + \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;'D','e','v','i','c','e','C','l','a','s','s','e','s',0}; </pre><pre class="diff" \
id="context">   typedef struct _MACHINE_INFO
 {
@@ -318,6 +325,76 @@
</pre><pre class="diff" id="context"> 
 
 /***********************************************************************
</pre><pre class="diff" id="added">+ * CM_Get_Class_Key_NameA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_NameA(
+ &nbsp; &nbsp;LPGUID ClassGuid, LPSTR pszKeyName, PULONG pulLength, ULONG ulFlags)
+{
+ &nbsp; &nbsp;TRACE(&quot;%p %p %p %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ClassGuid, pszKeyName, pulLength, ulFlags);
+ &nbsp; &nbsp;return CM_Get_Class_Key_Name_ExA(ClassGuid, pszKeyName, pulLength,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ulFlags, NULL); +}
+
+
+/***********************************************************************
+ * CM_Get_Class_Key_NameW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_NameW(
+ &nbsp; &nbsp;LPGUID ClassGuid, LPWSTR pszKeyName, PULONG pulLength, ULONG ulFlags)
+{
+ &nbsp; &nbsp;TRACE(&quot;%p %p %p %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ClassGuid, pszKeyName, pulLength, ulFlags);
+ &nbsp; &nbsp;return CM_Get_Class_Key_Name_ExW(ClassGuid, pszKeyName, pulLength,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ulFlags, NULL); +}
+
+
+/***********************************************************************
+ * CM_Get_Class_Key_Name_ExA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_Name_ExA(
+ &nbsp; &nbsp;LPGUID ClassGuid, LPSTR pszKeyName, PULONG pulLength, ULONG ulFlags,
+ &nbsp; &nbsp;HMACHINE hMachine)
+{
+ &nbsp; &nbsp;FIXME(&quot;%p %p %p %lx %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ClassGuid, pszKeyName, pulLength, ulFlags, \
hMachine); + &nbsp; &nbsp;return CR_FAILURE;
+}
+
+
+/***********************************************************************
+ * CM_Get_Class_Key_Name_ExW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Get_Class_Key_Name_ExW(
+ &nbsp; &nbsp;LPGUID ClassGuid, LPWSTR pszKeyName, PULONG pulLength, ULONG ulFlags,
+ &nbsp; &nbsp;HMACHINE hMachine)
+{
+ &nbsp; &nbsp;FIXME(&quot;%p %p %p %lx %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ClassGuid, pszKeyName, pulLength, ulFlags, \
hMachine); +
+ &nbsp; &nbsp;if (ClassGuid == NULL || pszKeyName == NULL || pulLength == NULL)
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_INVALID_POINTER;
+
+ &nbsp; &nbsp;if (ulFlags != 0)
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_INVALID_FLAG;
+
+ &nbsp; &nbsp;if (*pulLength &lt; MAX_GUID_STRING_LEN)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;*pulLength = 0;
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_BUFFER_SMALL;
+ &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;if (UuidToStringW(ClassGuid, &amp;pszKeyName) != RPC_S_OK)
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_INVALID_DATA;
+
+ &nbsp; &nbsp;*pulLength = MAX_GUID_STRING_LEN;
+
+ &nbsp; &nbsp;return CR_SUCCESS;
+}
+
+
+/***********************************************************************
</pre><pre class="diff" id="context"> &nbsp;* CM_Get_Depth [SETUPAPI.@]
 &nbsp;*/
 CONFIGRET WINAPI CM_Get_Depth(
@@ -1246,6 +1323,165 @@
</pre><pre class="diff" id="context"> 
 
 /***********************************************************************
</pre><pre class="diff" id="added">+ * CM_Open_Class_KeyA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_KeyA(
+ &nbsp; &nbsp;LPGUID pClassGuid, LPCSTR pszClassName, REGSAM samDesired,
+ &nbsp; &nbsp;REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags)
+{
+ &nbsp; &nbsp;TRACE(&quot;%p %s %lx %lx %p %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debugstr_guid(pClassGuid), pszClassName,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;samDesired, Disposition, phkClass, ulFlags);
+
+ &nbsp; &nbsp;return CM_Open_Class_Key_ExA(pClassGuid, pszClassName, samDesired,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; Disposition, phkClass, ulFlags, NULL); +}
+
+
+/***********************************************************************
+ * CM_Open_Class_KeyW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_KeyW(
+ &nbsp; &nbsp;LPGUID pClassGuid, LPCWSTR pszClassName, REGSAM samDesired,
+ &nbsp; &nbsp;REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags)
+{
+ &nbsp; &nbsp;TRACE(&quot;%p %s %lx %lx %p %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debugstr_guid(pClassGuid), \
debugstr_w(pszClassName), + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;samDesired, \
Disposition, phkClass, ulFlags); +
+ &nbsp; &nbsp;return CM_Open_Class_Key_ExW(pClassGuid, pszClassName, samDesired,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; Disposition, phkClass, ulFlags, NULL); +}
+
+
+/***********************************************************************
+ * CM_Open_Class_Key_ExA [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_Key_ExA(
+ &nbsp; &nbsp;LPGUID pClassGuid, LPCSTR pszClassName, REGSAM samDesired,
+ &nbsp; &nbsp;REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags,
+ &nbsp; &nbsp;HMACHINE hMachine)
+{
+ &nbsp; &nbsp;CONFIGRET rc = CR_SUCCESS;
+ &nbsp; &nbsp;LPWSTR pszClassNameW = NULL;
+
+ &nbsp; &nbsp;TRACE(&quot;%p %s %lx %lx %p %lx %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debugstr_guid(pClassGuid), pszClassName,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;samDesired, Disposition, phkClass, ulFlags, \
hMachine); +
+ &nbsp; &nbsp;if (pszClassName != NULL)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; if (CaptureAndConvertAnsiArg(pszClassName, \
&amp;pszClassNameW)) + &nbsp; &nbsp; &nbsp; &nbsp; return CR_INVALID_DATA;
+ &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;rc = CM_Open_Class_Key_ExW(pClassGuid, pszClassNameW, samDesired,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; Disposition, phkClass, ulFlags, hMachine); +
+ &nbsp; &nbsp;if (pszClassNameW != NULL)
+ &nbsp; &nbsp; &nbsp; &nbsp;MyFree(pszClassNameW);
+
+ &nbsp; &nbsp;return CR_SUCCESS;
+}
+
+
+/***********************************************************************
+ * CM_Open_Class_Key_ExW [SETUPAPI.@]
+ */
+CONFIGRET WINAPI CM_Open_Class_Key_ExW(
+ &nbsp; &nbsp;LPGUID pClassGuid, LPCWSTR pszClassName, REGSAM samDesired,
+ &nbsp; &nbsp;REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags,
+ &nbsp; &nbsp;HMACHINE hMachine)
+{
+ &nbsp; &nbsp;WCHAR szKeyName[MAX_PATH];
+ &nbsp; &nbsp;LPWSTR lpGuidString;
+ &nbsp; &nbsp;DWORD dwDisposition;
+ &nbsp; &nbsp;DWORD dwError;
+ &nbsp; &nbsp;HKEY hKey;
+
+ &nbsp; &nbsp;TRACE(&quot;%p %s %lx %lx %p %lx %lx\n&quot;,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debugstr_guid(pClassGuid), \
debugstr_w(pszClassName), + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;samDesired, \
Disposition, phkClass, ulFlags, hMachine); +
+ &nbsp; &nbsp;/* Check Disposition and ulFlags */
+ &nbsp; &nbsp;if ((Disposition &amp; ~RegDisposition_Bits) ||
+ &nbsp; &nbsp; &nbsp; &nbsp;(ulFlags &amp; ~CM_OPEN_CLASS_KEY_BITS))
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_INVALID_FLAG;
+
+ &nbsp; &nbsp;/* Check phkClass */
+ &nbsp; &nbsp;if (phkClass == NULL)
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_INVALID_POINTER;
+
+ &nbsp; &nbsp;*phkClass = NULL;
+
+ &nbsp; &nbsp;if (ulFlags == CM_OPEN_CLASS_KEY_INTERFACE &amp;&amp;
+ &nbsp; &nbsp; &nbsp; &nbsp;pszClassName != NULL)
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_INVALID_DATA;
+
+ &nbsp; &nbsp;if (hMachine == NULL)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;hKey = HKEY_LOCAL_MACHINE;
+ &nbsp; &nbsp;}
+ &nbsp; &nbsp;else
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; if \
(RegConnectRegistryW(((PMACHINE_INFO)hMachine)-&gt;szMachineName, + &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; HKEY_LOCAL_MACHINE, &amp;hKey)) + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return \
CR_REGISTRY_ERROR; + &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;if (ulFlags &amp; CM_OPEN_CLASS_KEY_INTERFACE)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;lstrcpyW(szKeyName, DeviceClasses);
+ &nbsp; &nbsp;}
+ &nbsp; &nbsp;else
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;lstrcpyW(szKeyName, ControlClass);
+ &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;if (pClassGuid != NULL)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;if (UuidToStringW((UUID*)pClassGuid, &amp;lpGuidString) \
!= RPC_S_OK) + &nbsp; &nbsp; &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RegCloseKey(hKey);
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return CR_INVALID_DATA;
+ &nbsp; &nbsp; &nbsp; &nbsp;}
+
+ &nbsp; &nbsp; &nbsp; &nbsp;lstrcatW(szKeyName, Backslash);
+ &nbsp; &nbsp; &nbsp; &nbsp;lstrcatW(szKeyName, lpGuidString);
+ &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;if (Disposition == RegDisposition_OpenAlways)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;dwError = RegCreateKeyExW(hKey, szKeyName, 0, NULL, 0, \
samDesired, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NULL, phkClass, &amp;dwDisposition); \
+ &nbsp; &nbsp;} + &nbsp; &nbsp;else
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;dwError = RegOpenKeyExW(hKey, szKeyName, 0, samDesired, \
phkClass); + &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;RegCloseKey(hKey);
+
+ &nbsp; &nbsp;if (pClassGuid != NULL)
+ &nbsp; &nbsp; &nbsp; &nbsp;RpcStringFreeW(&amp;lpGuidString);
+
+ &nbsp; &nbsp;if (dwError != ERROR_SUCCESS)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;*phkClass = NULL;
+ &nbsp; &nbsp; &nbsp; &nbsp;return CR_NO_SUCH_REGISTRY_KEY;
+ &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;if (pszClassName != NULL)
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;RegSetValueExW(*phkClass, Class, 0, REG_SZ, \
(LPBYTE)pszClassName, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; (lstrlenW(pszClassName) + 1) * sizeof(WCHAR)); + &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;return CR_SUCCESS;
+}
+
+
+/***********************************************************************
</pre><pre class="diff" id="context"> &nbsp;* CM_Set_DevNode_Problem [SETUPAPI.@]
 &nbsp;*/
 CONFIGRET WINAPI CM_Set_DevNode_Problem(
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/lib/setupapi/setupapi.spec</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/lib/setupapi/setupapi.spec	2005-08-28 12:23:37 UTC (rev \
                17585)
+++ trunk/reactos/lib/setupapi/setupapi.spec	2005-08-28 15:07:45 UTC (rev 17586)
@@ -55,10 +55,10 @@
</small></pre><pre class="diff" id="context"> @ stub CM_Free_Res_Des_Handle
 @ stdcall CM_Get_Child(ptr long long)
 @ stdcall CM_Get_Child_Ex(ptr long long long)
</pre><pre class="diff" id="removed">-@ stub CM_Get_Class_Key_NameA
-@ stub CM_Get_Class_Key_NameW
-@ stub CM_Get_Class_Key_Name_ExA
-@ st<span id="removedchars">ub CM_Get_Class_Key_Name_ExW</span>
</pre><pre class="diff" id="added">+@ st<span id="addedchars">dcall \
CM_Get_Class_Key_NameA(ptr str ptr long)</span> +@ stdcall CM_Get_Class_Key_NameW(ptr \
wstr ptr long) +@ stdcall CM_Get_Class_Key_Name_ExA(ptr str ptr long long)
+@ stdcall CM_Get_Class_Key_Name_ExW(ptr wstr ptr long long)
</pre><pre class="diff" id="context"> @ stub CM_Get_Class_NameA
 @ stub CM_Get_Class_NameW
 @ stub CM_Get_Class_Name_ExA
@@ -139,10 +139,10 @@
</pre><pre class="diff" id="context"> @ stub CM_Move_DevNode
 @ stub CM_Move_DevNode_Ex
 @ stub CM_Next_Range
</pre><pre class="diff" id="removed">-@ stub CM_Open_Class_KeyA
-@ stub CM_Open_Class_KeyW
-@ stub CM_Open_Class_Key_ExA
-@ st<span id="removedchars">ub CM_Open_Class_Key_ExW</span>
</pre><pre class="diff" id="added">+@ st<span id="addedchars">dcall \
CM_Open_Class_KeyA(ptr str long long ptr long)</span> +@ stdcall \
CM_Open_Class_KeyW(ptr wstr long long ptr long) +@ stdcall CM_Open_Class_Key_ExA(ptr \
str long long ptr long long) +@ stdcall CM_Open_Class_Key_ExW(ptr wstr long long ptr \
long long) </pre><pre class="diff" id="context"> @ stub CM_Open_DevNode_Key
 @ stub CM_Open_DevNode_Key_Ex
 @ stub CM_Query_Arbitrator_Free_Data
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/services/umpnpmgr/umpnpmgr.c</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/services/umpnpmgr/umpnpmgr.c	2005-08-28 12:23:37 UTC (rev \
                17585)
+++ trunk/reactos/services/umpnpmgr/umpnpmgr.c	2005-08-28 15:07:45 UTC (rev 17586)
@@ -635,6 +635,55 @@
</small></pre><pre class="diff" id="context"> 
 
 CONFIGRET
</pre><pre class="diff" id="added">+PNP_GetClassName(handle_t BindingHandle,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wchar_t *ClassGuid, &nbsp; \
&nbsp;/* in */ + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wchar_t \
*Buffer, &nbsp; &nbsp; &nbsp; /* out */ + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; unsigned long *Length, /* in out */ + &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; unsigned long Flags) +{
+ &nbsp; &nbsp;WCHAR szKeyName[MAX_PATH];
+ &nbsp; &nbsp;CONFIGRET ret = CR_SUCCESS;
+ &nbsp; &nbsp;HKEY hKey = NULL;
+ &nbsp; &nbsp;ULONG ulSize;
+
+ &nbsp; &nbsp;DPRINT1(&quot;PNP_GetClassName() called\n&quot;);
+
+ &nbsp; &nbsp;lstrcpyW(szKeyName, \
L&quot;System\\CurrentControlSet\\Control\\Class&quot;); + &nbsp; \
&nbsp;lstrcatW(szKeyName, L&quot;\\&quot;); + &nbsp; &nbsp;lstrcatW(szKeyName, \
ClassGuid); +
+ &nbsp; &nbsp;if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;szKeyName, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp;0, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp;KEY_QUERY_VALUE, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp;&amp;hKey)) + &nbsp; &nbsp; &nbsp; &nbsp;return \
CR_REGISTRY_ERROR; +
+ &nbsp; &nbsp;ulSize = *Length * sizeof(WCHAR);
+ &nbsp; &nbsp;if (RegQueryValueExW(hKey,
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
L&quot;Class&quot;, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; NULL, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; NULL, + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (LPBYTE)Buffer, + &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;ulSize)) + &nbsp; \
&nbsp;{ + &nbsp; &nbsp; &nbsp; &nbsp;*Length = 0;
+ &nbsp; &nbsp; &nbsp; &nbsp;ret = CR_REGISTRY_ERROR;
+ &nbsp; &nbsp;}
+ &nbsp; &nbsp;else
+ &nbsp; &nbsp;{
+ &nbsp; &nbsp; &nbsp; &nbsp;*Length = ulSize / sizeof(WCHAR);
+ &nbsp; &nbsp;}
+
+ &nbsp; &nbsp;RegCloseKey(hKey);
+
+ &nbsp; &nbsp;DPRINT1(&quot;PNP_GetClassName() done (returns %lx)\n&quot;, ret);
+
+ &nbsp; &nbsp;return ret;
+}
+
+
+CONFIGRET
</pre><pre class="diff" id="context"> PNP_GetDeviceStatus(handle_t BindingHandle,
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wchar_t \
*DeviceInstance,  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; unsigned long *pStatus, </pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Modified: \
trunk/reactos/w32api/include/ddk/cfgmgr32.h</b></big></div> <pre class="diff"><small \
id="info">--- trunk/reactos/w32api/include/ddk/cfgmgr32.h	2005-08-28 12:23:37 UTC \
                (rev 17585)
+++ trunk/reactos/w32api/include/ddk/cfgmgr32.h	2005-08-28 15:07:45 UTC (rev 17586)
@@ -787,7 +787,7 @@
</small></pre><pre class="diff" id="context"> #define CM_Enumerate_Enumerators_Ex \
CM_Enumerate_Enumerators_ExW  #else
 #define CM_Enumerate_Enumerators CM_Enumerate_EnumeratorsA
</pre><pre class="diff" id="removed">-#define CM_Enumerate_Enumerators_Ex \
CM_Enumerate_Enumerators_Ex<span id="removedchars">W</span> </pre><pre class="diff" \
id="added">+#define CM_Enumerate_Enumerators_Ex CM_Enumerate_Enumerators_Ex<span \
id="addedchars">A</span> </pre><pre class="diff" id="context"> #endif /* UNICODE */
 
 /* FIXME: Obsolete CM_Find_Range */
@@ -864,8 +864,53 @@
</pre><pre class="diff" id="context"> 
 /* FIXME: Obsolete CM_Get_Class_Name */
 /* FIXME: Obsolete CM_Get_Class_Name_Ex */
</pre><pre class="diff" id="removed">-/* FIXME: Obsolete CM_Get_Class_Key_Name */
-/* FIXME: Obsolete CM_Get_Class_Key_Name_Ex */
</pre><pre class="diff" id="added">+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_NameA(
+ &nbsp;IN LPGUID &nbsp;ClassGuid,
+ &nbsp;OUT LPSTR &nbsp;pszKeyName,
+ &nbsp;IN OUT PULONG &nbsp;pulLength,
+ &nbsp;IN ULONG &nbsp;ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_NameW(
+ &nbsp;IN LPGUID &nbsp;ClassGuid,
+ &nbsp;OUT LPWSTR &nbsp;pszKeyName,
+ &nbsp;IN OUT PULONG &nbsp;pulLength,
+ &nbsp;IN ULONG &nbsp;ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_Name_ExA(
+ &nbsp;IN LPGUID &nbsp;ClassGuid,
+ &nbsp;OUT LPSTR &nbsp;pszKeyName,
+ &nbsp;IN OUT PULONG &nbsp;pulLength,
+ &nbsp;IN ULONG &nbsp;ulFlags,
+ &nbsp;IN HMACHINE &nbsp;hMachine);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Get_Class_Key_Name_ExW(
+ &nbsp;IN LPGUID &nbsp;ClassGuid,
+ &nbsp;OUT LPWSTR &nbsp;pszKeyName,
+ &nbsp;IN OUT PULONG &nbsp;pulLength,
+ &nbsp;IN ULONG &nbsp;ulFlags,
+ &nbsp;IN HMACHINE &nbsp;hMachine);
+
+#ifdef UNICODE
+#define CM_Get_Class_Key_Name CM_Get_Class_Key_NameW
+#define CM_Get_Class_Key_Name_Ex CM_Get_Class_Key_Name_ExW
+#else
+#define CM_Get_Class_Key_Name CM_Get_Class_Key_NameA
+#define CM_Get_Class_Key_Name_Ex CM_Get_Class_Key_Name_ExA
+#endif /* UNICODE */
+
</pre><pre class="diff" id="context"> /* FIXME: Obsolete \
CM_Get_Class_Registry_Property */  
 CMAPI
@@ -928,7 +973,7 @@
</pre><pre class="diff" id="context"> #define CM_Get_Device_ID_Ex \
CM_Get_Device_ID_ExW  #else
 #define CM_Get_Device_ID CM_Get_Device_IDA
</pre><pre class="diff" id="removed">-#define CM_Get_Device_ID_Ex \
CM_Get_Device_ID_Ex<span id="removedchars">W</span> </pre><pre class="diff" \
id="added">+#define CM_Get_Device_ID_Ex CM_Get_Device_ID_Ex<span \
id="addedchars">A</span> </pre><pre class="diff" id="context"> #endif /* UNICODE */
 
 CMAPI
@@ -1440,8 +1485,61 @@
</pre><pre class="diff" id="context"> /* FIXME: Obsolete CM_Move_DevNode */
 /* FIXME: Obsolete CM_Move_DevNode_Ex */
 /* FIXME: Obsolete CM_Next_Range */
</pre><pre class="diff" id="removed">-/* FIXME: Obsolete CM_Open_Class_Key */
-/* FIXME: Obsolete CM_Open_Class_Key_Ex */
</pre><pre class="diff" id="added">+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_KeyA(
+ &nbsp;IN LPGUID &nbsp;ClassGuid, OPTIONAL
+ &nbsp;IN LPCSTR &nbsp;pszClassName, OPTIONAL
+ &nbsp;IN REGSAM &nbsp;samDesired,
+ &nbsp;IN REGDISPOSITION &nbsp;Disposition,
+ &nbsp;OUT PHKEY &nbsp;phkClass,
+ &nbsp;IN ULONG &nbsp;ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_KeyW(
+ &nbsp;IN LPGUID &nbsp;ClassGuid, OPTIONAL
+ &nbsp;IN LPCWSTR &nbsp;pszClassName, OPTIONAL
+ &nbsp;IN REGSAM &nbsp;samDesired,
+ &nbsp;IN REGDISPOSITION &nbsp;Disposition,
+ &nbsp;OUT PHKEY &nbsp;phkClass,
+ &nbsp;IN ULONG &nbsp;ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_Key_ExA(
+ &nbsp;IN LPGUID &nbsp;pszClassGuid, OPTIONAL
+ &nbsp;IN LPCSTR &nbsp;pszClassName, OPTIONAL
+ &nbsp;IN REGSAM &nbsp;samDesired,
+ &nbsp;IN REGDISPOSITION &nbsp;Disposition,
+ &nbsp;OUT PHKEY &nbsp;phkClass,
+ &nbsp;IN ULONG &nbsp;ulFlags,
+ &nbsp;IN HMACHINE &nbsp;hMachine);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Open_Class_Key_ExW(
+ &nbsp;IN LPGUID &nbsp;pszClassGuid, OPTIONAL
+ &nbsp;IN LPCWSTR &nbsp;pszClassName, OPTIONAL
+ &nbsp;IN REGSAM &nbsp;samDesired,
+ &nbsp;IN REGDISPOSITION Disposition,
+ &nbsp;OUT PHKEY &nbsp;phkClass,
+ &nbsp;IN ULONG &nbsp;ulFlags,
+ &nbsp;IN HMACHINE &nbsp;hMachine);
+
+#ifdef UNICODE
+#define CM_Open_Class_Key CM_Open_Class_KeyW
+#define CM_Open_Class_Key_Ex CM_Open_Class_Key_ExW
+#else
+#define CM_Open_Class_Key CM_Open_Class_KeyA
+#define CM_Open_Class_Key_Ex CM_Open_Class_Key_ExA
+#endif /* UNICODE */
+
</pre><pre class="diff" id="context"> /* FIXME: Obsolete CM_Open_DevNode_Key */
 /* FIXME: Obsolete CM_Open_DevNode_Key_Ex */
 
</pre>
</div>

</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic