Nikolay Sivov : shlwapi: Forward SHGetValue() to shcore.dll.

Alexandre Julliard julliard at winehq.org
Mon May 11 16:08:37 CDT 2020


Module: wine
Branch: master
Commit: ec58bd31f7b4ca99fe490daafa3759c99218c89e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ec58bd31f7b4ca99fe490daafa3759c99218c89e

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon May 11 18:23:46 2020 +0300

shlwapi: Forward SHGetValue() to shcore.dll.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 .../api-ms-win-downlevel-shlwapi-l2-1-0.spec       |  4 +-
 dlls/shlwapi/reg.c                                 | 66 ----------------------
 dlls/shlwapi/shlwapi.spec                          |  4 +-
 3 files changed, 4 insertions(+), 70 deletions(-)

diff --git a/dlls/api-ms-win-downlevel-shlwapi-l2-1-0/api-ms-win-downlevel-shlwapi-l2-1-0.spec b/dlls/api-ms-win-downlevel-shlwapi-l2-1-0/api-ms-win-downlevel-shlwapi-l2-1-0.spec
index 4ed7f84c78..3ee015b675 100644
--- a/dlls/api-ms-win-downlevel-shlwapi-l2-1-0/api-ms-win-downlevel-shlwapi-l2-1-0.spec
+++ b/dlls/api-ms-win-downlevel-shlwapi-l2-1-0/api-ms-win-downlevel-shlwapi-l2-1-0.spec
@@ -30,8 +30,8 @@
 @ stdcall SHEnumValueA(long long str ptr ptr ptr ptr) shlwapi.SHEnumValueA
 @ stdcall SHEnumValueW(long long wstr ptr ptr ptr ptr) shlwapi.SHEnumValueW
 @ stdcall SHGetThreadRef(ptr) shlwapi.SHGetThreadRef
-@ stdcall SHGetValueA( long str str ptr ptr ptr ) shlwapi.SHGetValueA
-@ stdcall SHGetValueW( long wstr wstr ptr ptr ptr ) shlwapi.SHGetValueW
+@ stdcall SHGetValueA(long str str ptr ptr ptr) shlwapi.SHGetValueA
+@ stdcall SHGetValueW(long wstr wstr ptr ptr ptr) shlwapi.SHGetValueW
 @ stdcall SHOpenRegStream2A(long str str long) shlwapi.SHOpenRegStream2A
 @ stdcall SHOpenRegStream2W(long wstr wstr long) shlwapi.SHOpenRegStream2W
 @ stdcall SHOpenRegStreamA(long str str long) shlwapi.SHOpenRegStreamA
diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c
index 08cc26ee48..f33047ab38 100644
--- a/dlls/shlwapi/reg.c
+++ b/dlls/shlwapi/reg.c
@@ -47,72 +47,6 @@ static const WCHAR szExtensionW[] = { 'E', 'x', 't','e','n','s','i','o','n','\0'
 INT     WINAPI SHStringFromGUIDW(REFGUID,LPWSTR,INT);
 HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID,LPCWSTR,BOOL,BOOL,PHKEY);
 
-/*************************************************************************
- * SHGetValueA   [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
- *   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 SHGetValueA(HKEY hKey, LPCSTR lpszSubKey, LPCSTR lpszValue,
-                         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);
-
-  /*   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;
-}
-
-/*************************************************************************
- * SHGetValueW   [SHLWAPI.@]
- *
- * See SHGetValueA.
- */
-DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue,
-                         LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
-{
-  DWORD dwRet = 0;
-  HKEY hSubKey = 0;
-
-  TRACE("(hkey=%p,%s,%s,%p,%p,%p)\n", hKey, debugstr_w(lpszSubKey),
-        debugstr_w(lpszValue), pwType, pvData, pcbData);
-
-  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;
-}
-
 /*************************************************************************
  * SHSetValueA   [SHLWAPI.@]
  *
diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec
index e571eeb2e7..a0782607a7 100644
--- a/dlls/shlwapi/shlwapi.spec
+++ b/dlls/shlwapi/shlwapi.spec
@@ -702,8 +702,8 @@
 @ stdcall SHEnumValueW(long long wstr ptr ptr ptr ptr) shcore.SHEnumValueW
 @ stdcall SHGetInverseCMAP ( ptr long )
 @ stdcall SHGetThreadRef(ptr) shcore.SHGetThreadRef
-@ stdcall SHGetValueA ( long str str ptr ptr ptr )
-@ stdcall SHGetValueW ( long wstr wstr ptr ptr ptr )
+@ stdcall -import SHGetValueA(long str str ptr ptr ptr)
+@ stdcall -import SHGetValueW(long wstr wstr ptr ptr ptr)
 @ stdcall SHIsLowMemoryMachine(long)
 @ stdcall SHOpenRegStream2A(long str str long) shcore.SHOpenRegStream2A
 @ stdcall SHOpenRegStream2W(long wstr wstr long) shcore.SHOpenRegStream2W




More information about the wine-cvs mailing list