Semi-Stub implementation for SHRegGetValue(A|W)

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Sun Nov 6 06:56:14 CST 2005


Changelog: 
        wine/dlls/shlwapi/reg.c:
	Semi-Stub implementation for SHRegGetValue(A|W)
	
I didn't find any definition for the different srrfFlag Bitvalues and for
the SRRF type definition. Pointers and definitions welcome.

This patch lets the recent Atmel AVRStudio Version 4.12 run, invoked like
"env WINEDLLOVERRIDES=ole32,oleaut32,rpcrt4,msxml3,urlmon=n wine\
AVRStudio.exe"
together with the still pending
Subject: CopyImage for IMAGE_BITMAP still not right, next Try
Date: Tue, 20 Sep 2005 13:26:56 +0200
wine/dlls/user/cursoricon.c hasn't changed till 12 Sep 2005, so the
cursoricon still applies unchanged.

When SHRegGetValue is fully implemented, probably SHGetValue should call
SHRegGetValue with the appropriate flags.

B.t.w: Does the "lw" in shlwapi really stand for "light weight"? What a
joke...

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/shlwapi/shlwapi.spec
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/shlwapi.spec,v
retrieving revision 1.111
diff -u -r1.111 shlwapi.spec
--- wine/dlls/shlwapi/shlwapi.spec	26 Sep 2005 09:56:40 -0000	1.111
+++ wine/dlls/shlwapi/shlwapi.spec	6 Nov 2005 12:39:37 -0000
@@ -697,7 +697,9 @@
 @ stdcall SHGetInverseCMAP ( ptr long )
 @ stdcall SHGetThreadRef (ptr)
 @ stdcall SHGetValueA ( long str str ptr ptr ptr )
+@ stdcall SHRegGetValueA ( long str str long ptr ptr ptr )
 @ stdcall SHGetValueW ( long wstr wstr ptr ptr ptr )
+@ stdcall SHRegGetValueW ( long wstr wstr long ptr ptr ptr )
 @ stdcall SHIsLowMemoryMachine(long)
 @ stdcall SHLoadIndirectString(wstr ptr long ptr)
 @ stdcall SHOpenRegStream2A(long str str long)
Index: wine/dlls/shlwapi/reg.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/reg.c,v
retrieving revision 1.63
diff -u -r1.63 reg.c
--- wine/dlls/shlwapi/reg.c	12 Sep 2005 22:07:53 -0000	1.63
+++ wine/dlls/shlwapi/reg.c	6 Nov 2005 12:39:47 -0000
@@ -1140,6 +1140,75 @@
 }
 
 /*************************************************************************
+ * SHRegGetValueA   [SHLWAPI.@]
+ *
+ * Get a value from the registry.
+ *
+ * PARAMS
+ *   hKey       [I] Handle to registry key
+ *   lpszSubKey [I] Name of sub key containing value to get
+ *   lpszValue  [I] Name of value to get
+ *   srrf       [I] Flags for restricting returned data
+ *   pwType     [O] Pointer to the values type
+ *   pvData     [O] Pointer to the values data
+ *   pcbData    [O] Pointer to the values size
+ *
+ * RETURNS
+ *   Success: ERROR_SUCCESS. Output parameters contain the details read.
+ *   Failure: An error code from RegOpenKeyExA() or SHQueryValueExA().
+ */
+DWORD WINAPI SHRegGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue, DWORD srrfFlags,
+                         LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
+{
+  DWORD dwRet = 0;
+  HKEY hSubKey = 0;
+
+  TRACE("(hkey=%p,%s,%s,%p,%p,%p)\n", hKey, debugstr_a(lpszSubKey),
+        debugstr_a(lpszValue), pwType, pvData, pcbData);
+  FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08lx\n", srrfFlags);
+
+  /*   lpszSubKey can be 0. In this case the value is taken from the
+   *   current key.
+   */
+  if(lpszSubKey)
+    dwRet = RegOpenKeyExA(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey);
+
+  if (! dwRet)
+  {
+    /* SHQueryValueEx expands Environment strings */
+    dwRet = SHQueryValueExA(hSubKey ? hSubKey : hKey, lpszValue, 0, pwType, pvData, pcbData);
+    if (hSubKey) RegCloseKey(hSubKey);
+  }
+  return dwRet;
+}
+
+/*************************************************************************
+ * SHReg GetRegValueW   [SHLWAPI.@]
+ *
+ * See SHGetValueA.
+ */
+DWORD WINAPI SHRegGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD srrfFlags,
+                         LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
+{
+  DWORD dwRet = 0;
+  HKEY hSubKey = 0;
+
+  TRACE("(hkey=%p,%s,%s,0x%08lx, %p,%p,%p)\n", hKey, debugstr_w(lpszSubKey),
+        debugstr_w(lpszValue), srrfFlags,pwType, pvData, pcbData);
+  FIXME("Semi-Stub: Find meaning and implement handling of SRFF Flags 0x%08lx\n", srrfFlags);
+
+  if(lpszSubKey)
+    dwRet = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_QUERY_VALUE, &hSubKey);
+
+  if (! dwRet)
+  {
+    dwRet = SHQueryValueExW(hSubKey ? hSubKey : hKey, lpszValue, 0, pwType, pvData, pcbData);
+    if (hSubKey) RegCloseKey(hSubKey);
+  }
+  return dwRet;
+}
+
+/*************************************************************************
  * SHGetValueW   [SHLWAPI.@]
  *
  * See SHGetValueA.



More information about the wine-patches mailing list