Nikolay Sivov : shlwapi: Implement SHRegCreateUSKeyA().

Alexandre Julliard julliard at winehq.org
Tue Apr 22 13:23:19 CDT 2014


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Apr 22 08:50:04 2014 +0400

shlwapi: Implement SHRegCreateUSKeyA().

---

 dlls/shlwapi/reg.c |   53 ++++++++++++++++++++++++++++++++++------------------
 1 file changed, 35 insertions(+), 18 deletions(-)

diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c
index 7fb71cf..1653b80 100644
--- a/dlls/shlwapi/reg.c
+++ b/dlls/shlwapi/reg.c
@@ -209,31 +209,48 @@ LONG WINAPI SHRegCloseUSKey(
 /*************************************************************************
  * SHRegCreateUSKeyA  [SHLWAPI.@]
  *
- * Create or open a user-specific registry key.
- * 
- * PARAMS
- *  pszPath        [I] Key name to create or open.
- *  samDesired     [I] Wanted security access.
- *  hRelativeUSKey [I] Base path if pszPath is relative. NULL otherwise.
- *  phNewUSKey     [O] Receives a handle to the new or opened key.
- *  dwFlags        [I] Base key under which the key should be opened.
- *
- * RETURNS
- *  Success: ERROR_SUCCESS
- *  Failure: Nonzero error code from winerror.h
+ * See SHRegCreateUSKeyW.
  */
-LONG WINAPI SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey,
-                              PHUSKEY phNewUSKey, DWORD dwFlags)
+LONG WINAPI SHRegCreateUSKeyA(LPCSTR path, REGSAM samDesired, HUSKEY relative_key,
+                              PHUSKEY new_uskey, DWORD flags)
 {
-    FIXME("(%s, 0x%08x, %p, %p, 0x%08x) stub\n", debugstr_a(pszPath), samDesired,
-          hRelativeUSKey, phNewUSKey, dwFlags);
-    return ERROR_SUCCESS;
+    WCHAR *pathW;
+    LONG ret;
+
+    TRACE("(%s, 0x%08x, %p, %p, 0x%08x)\n", debugstr_a(path), samDesired, relative_key,
+        new_uskey, flags);
+
+    if (path)
+    {
+        INT len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
+        pathW = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
+        if (!pathW)
+            return ERROR_NOT_ENOUGH_MEMORY;
+        MultiByteToWideChar(CP_ACP, 0, path, -1, pathW, len);
+    }
+    else
+        pathW = NULL;
+
+    ret = SHRegCreateUSKeyW(pathW, samDesired, relative_key, new_uskey, flags);
+    HeapFree(GetProcessHeap(), 0, pathW);
+    return ret;
 }
 
 /*************************************************************************
  * SHRegCreateUSKeyW  [SHLWAPI.@]
  *
- * See SHRegCreateUSKeyA.
+ * Create or open a user-specific registry key.
+ *
+ * PARAMS
+ *  path         [I] Key name to create or open.
+ *  samDesired   [I] Wanted security access.
+ *  relative_key [I] Base path if 'path' is relative. NULL otherwise.
+ *  new_uskey    [O] Receives a handle to the new or opened key.
+ *  flags        [I] Base key under which the key should be opened.
+ *
+ * RETURNS
+ *  Success: ERROR_SUCCESS
+ *  Failure: Nonzero error code from winerror.h
  */
 LONG WINAPI SHRegCreateUSKeyW(LPCWSTR path, REGSAM samDesired, HUSKEY relative_key,
                               PHUSKEY new_uskey, DWORD flags)




More information about the wine-cvs mailing list