As instructed, I added a few lines to the already written tests that
confirm my claim.
Part of the research of the registry merging project was to determine
where the implementation is going to be written: advapi32, ntdll or
the server itself. The server choice was dismissed since HKCR isn't
stored and rather fetched live. These tests prove that advapi32 calls
that reference HKCR are either pointed there to \REGISTRY\MACHINE or
\REGISTRY\USER and hence, that the merge is to be done in advapi32.
http://newtestbot.winehq.org/JobDetails.pl?Key=976
---
dlls/advapi32/tests/registry.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index b2483a7..8437e4d 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -43,6 +43,7 @@ static DWORD (WINAPI *pRegDeleteTreeA)(HKEY,LPCSTR);
static DWORD (WINAPI *pRegDeleteKeyExA)(HKEY,LPCSTR,REGSAM,DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL);
static NTSTATUS (WINAPI * pNtDeleteKey)(HANDLE);
+static NTSTATUS (WINAPI * pNtQueryKey)(HANDLE,int,PVOID,ULONG,PULONG);
static NTSTATUS (WINAPI * pRtlFormatCurrentUserKeyPath)(UNICODE_STRING*);
static NTSTATUS (WINAPI * pRtlFreeUnicodeString)(PUNICODE_STRING);
@@ -136,6 +137,7 @@ static void InitFunctionPtrs(void)
pRtlFormatCurrentUserKeyPath = (void *)GetProcAddress( hntdll, "RtlFormatCurrentUserKeyPath" );
pRtlFreeUnicodeString = (void *)GetProcAddress(hntdll, "RtlFreeUnicodeString");
pNtDeleteKey = (void *)GetProcAddress( hntdll, "NtDeleteKey" );
+ pNtQueryKey = (void *)GetProcAddress( hntdll, "NtQueryKey" );
}
/* delete key and all its subkeys */
@@ -2104,6 +2106,7 @@ static void test_classesroot(void)
DWORD type = REG_SZ;
static CHAR buffer[8];
LONG res;
+ void *buf = malloc(300*sizeof(wchar_t));
/* create a key in the user's classes */
if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Classes\\WineTestCls", &hkey ))
@@ -2132,6 +2135,9 @@ static void test_classesroot(void)
RegCloseKey( hkey );
return;
}
+ pNtQueryKey( hkcr, 3 /*KeyNameInformation*/, buf, 500*sizeof(wchar_t), (ULONG*)&res );
+ ok( wcsncmp((wchar_t*)buf+2, L"\\REGISTRY\\USER", 14) == 0,
+ "key not from \\REGISTRY\\USER\n");