advapi32:Read HW_PROFILE_INFO from registry (partially based on patch from Ben Collins)

Louis. Lenders xerox_xerox2000 at yahoo.co.uk
Sat Oct 14 09:08:20 CDT 2006


Skipped content of type multipart/alternative-------------- next part --------------
diff --git a/dlls/advapi32/advapi.c b/dlls/advapi32/advapi.c
index 04a520a..921698f 100644
--- a/dlls/advapi32/advapi.c
+++ b/dlls/advapi32/advapi.c
@@ -116,11 +116,26 @@ GetUserNameW( LPWSTR lpszName, LPDWORD l
  */
 BOOL WINAPI GetCurrentHwProfileA(LPHW_PROFILE_INFOA pInfo)
 {
-	FIXME("(%p) semi-stub\n", pInfo);
-	pInfo->dwDockInfo = DOCKINFO_DOCKED;
-	strcpy(pInfo->szHwProfileGuid,"{12340001-1234-1234-1234-1233456789012}");
-	strcpy(pInfo->szHwProfileName,"Wine Profile");
-	return 1;
+    DWORD size;
+    HKEY hkey;
+
+    RegOpenKeyA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\IDConfigDB\\Hardware Profiles\\0001", &hkey);
+
+    size = MAX_PROFILE_LEN;
+    RegQueryValueExA(hkey, "FriendlyName", NULL, NULL,(LPBYTE) pInfo->szHwProfileName, &size);
+
+    size = HW_PROFILE_GUIDLEN;
+    RegQueryValueExA(hkey, "HwProfileGuid", NULL, NULL,(LPBYTE) pInfo->szHwProfileGuid, &size);
+    RegCloseKey(hkey);
+
+    RegOpenKeyA(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\IDConfigDB\\CurrentDockInfo", &hkey);
+
+    size = sizeof(DWORD);
+    RegQueryValueExA(hkey, "DockingState", NULL, NULL,  (LPBYTE) &pInfo->dwDockInfo, &size);
+    RegCloseKey(hkey);
+
+    TRACE("DockInfo = %x, Profile Guid = %s, Friendly Name = %s\n", pInfo->dwDockInfo, pInfo->szHwProfileGuid, pInfo->szHwProfileName);
+
+    return TRUE;
 }
 
 /******************************************************************************
diff --git a/tools/wine.inf b/tools/wine.inf
index 11cfe3b..b23a536 100644
--- a/tools/wine.inf
+++ b/tools/wine.inf
@@ -63,6 +63,7 @@ AddReg=\
     DirectX,\
     Environment,\
     Fonts,\
+    IDConfigDB,\
     MCI,\
     Misc,\
     Nls,\
@@ -236,6 +237,11 @@ HKLM,System\CurrentControlSet\Control\Se
 HKLM,System\CurrentControlSet\Control\Session Manager\Environment,"windir",,"%10%"
 HKLM,System\CurrentControlSet\Control\Session Manager\Environment,"winsysdir",,"%11%"
 
+[IDConfigDB]
+HKLM,System\CurrentControlSet\Control\IDConfigDB\CurrentDockInfo,"DockingState",0x10003,0x00000000
+HKLM,System\CurrentControlSet\Control\IDConfigDB\Hardware Profiles\0001,"FriendlyName",,"Wine Profile"
+HKLM,System\CurrentControlSet\Control\IDConfigDB\Hardware Profiles\0001,"HwProfileGuid",,"{12340001-1234-1234-1234-123345678901}"
+
 [Fonts]
 HKLM,%FontSubStr%,"Arial CE,238",,"Arial,238"
 HKLM,%FontSubStr%,"Arial CYR,204",,"Arial,204"


More information about the wine-patches mailing list