Commit a88f66d1 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

shcore: Add SHRegDuplicateHKey().

parent d7a45561
......@@ -1751,3 +1751,15 @@ DWORD WINAPI SHAnsiToUnicode(const char *src, WCHAR *dest, int dest_len)
return ret;
}
/*************************************************************************
* SHRegDuplicateHKey [SHCORE.@]
*/
HKEY WINAPI SHRegDuplicateHKey(HKEY hKey)
{
HKEY newKey = 0;
RegOpenKeyExW(hKey, 0, 0, MAXIMUM_ALLOWED, &newKey);
TRACE("new key is %p\n", newKey);
return newKey;
}
......@@ -61,7 +61,7 @@
@ stdcall SHQueryInfoKeyW(long ptr ptr ptr ptr) shlwapi.SHQueryInfoKeyW
@ stdcall SHQueryValueExA(long str ptr ptr ptr ptr) shlwapi.SHQueryValueExA
@ stdcall SHQueryValueExW(long wstr ptr ptr ptr ptr) shlwapi.SHQueryValueExW
@ stdcall SHRegDuplicateHKey(long) shlwapi.SHRegDuplicateHKey
@ stdcall SHRegDuplicateHKey(long)
@ stdcall SHRegGetIntW(ptr wstr long) shlwapi.SHRegGetIntW
@ stdcall SHRegGetPathA(long str str ptr long) shlwapi.SHRegGetPathA
@ stdcall SHRegGetPathW(long wstr wstr ptr long) shlwapi.SHRegGetPathW
......
TESTDLL = shcore.dll
IMPORTS = advapi32
C_SRCS = \
shcore.c
......@@ -33,6 +33,7 @@ static int (WINAPI *pSHUnicodeToAnsi)(const WCHAR *, char *, int);
static int (WINAPI *pSHAnsiToUnicode)(const char *, WCHAR *, int);
static int (WINAPI *pSHAnsiToAnsi)(const char *, char *, int);
static int (WINAPI *pSHUnicodeToUnicode)(const WCHAR *, WCHAR *, int);
static HKEY (WINAPI *pSHRegDuplicateHKey)(HKEY);
static void init(HMODULE hshcore)
{
......@@ -43,6 +44,7 @@ static void init(HMODULE hshcore)
X(SHAnsiToUnicode);
X(SHAnsiToAnsi);
X(SHUnicodeToUnicode);
X(SHRegDuplicateHKey);
#undef X
}
......@@ -300,6 +302,23 @@ static void test_SHUnicodeToUnicode(void)
ok(buff[5] == 'f', "Unexpected buffer contents.\n");
}
static void test_SHRegDuplicateHKey(void)
{
HKEY hkey, hkey2;
DWORD ret;
ret = RegCreateKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey);
ok(!ret, "Failed to create test key, ret %d.\n", ret);
hkey2 = pSHRegDuplicateHKey(hkey);
ok(hkey2 != NULL && hkey2 != hkey, "Unexpected duplicate key.\n");
RegCloseKey(hkey2);
RegCloseKey(hkey);
RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test");
}
START_TEST(shcore)
{
HMODULE hshcore = LoadLibraryA("shcore.dll");
......@@ -317,4 +336,5 @@ START_TEST(shcore)
test_SHAnsiToUnicode();
test_SHAnsiToAnsi();
test_SHUnicodeToUnicode();
test_SHRegDuplicateHKey();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment