shlwapi: Implement SHRegCreateUSKeyA().

This commit is contained in:
Nikolay Sivov 2014-04-22 08:50:04 +04:00 committed by Alexandre Julliard
parent 3f0a24349c
commit f1706b0387
1 changed files with 35 additions and 18 deletions

View File

@ -209,31 +209,48 @@ LONG WINAPI SHRegCloseUSKey(
/************************************************************************* /*************************************************************************
* SHRegCreateUSKeyA [SHLWAPI.@] * SHRegCreateUSKeyA [SHLWAPI.@]
* *
* Create or open a user-specific registry key. * See SHRegCreateUSKeyW.
*
* 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
*/ */
LONG WINAPI SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, LONG WINAPI SHRegCreateUSKeyA(LPCSTR path, REGSAM samDesired, HUSKEY relative_key,
PHUSKEY phNewUSKey, DWORD dwFlags) PHUSKEY new_uskey, DWORD flags)
{ {
FIXME("(%s, 0x%08x, %p, %p, 0x%08x) stub\n", debugstr_a(pszPath), samDesired, WCHAR *pathW;
hRelativeUSKey, phNewUSKey, dwFlags); LONG ret;
return ERROR_SUCCESS;
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.@] * 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, LONG WINAPI SHRegCreateUSKeyW(LPCWSTR path, REGSAM samDesired, HUSKEY relative_key,
PHUSKEY new_uskey, DWORD flags) PHUSKEY new_uskey, DWORD flags)