From: Alex Henrie alexhenrie24@gmail.com
--- dlls/ntdll/tests/reg.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 0b61d06fdf7..4ebcdb1814d 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -2659,15 +2659,16 @@ static void test_NtRegLoadKeyEx(void)
START_TEST(reg) { - static const WCHAR winetest[] = {'\','W','i','n','e','T','e','s','t',0}; + LSTATUS status; + if(!InitFunctionPtrs()) return; + pRtlFormatCurrentUserKeyPath(&winetestpath); + winetestpath.MaximumLength = winetestpath.MaximumLength + sizeof(L"\WineTest"); winetestpath.Buffer = pRtlReAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, winetestpath.Buffer, - winetestpath.MaximumLength + sizeof(winetest)*sizeof(WCHAR)); - winetestpath.MaximumLength = winetestpath.MaximumLength + sizeof(winetest)*sizeof(WCHAR); - - pRtlAppendUnicodeToString(&winetestpath, winetest); + winetestpath.MaximumLength); + pRtlAppendUnicodeToString(&winetestpath, L"\WineTest");
test_NtCreateKey(); test_NtOpenKey(); @@ -2689,6 +2690,9 @@ START_TEST(reg) test_NtRenameKey(); test_NtRegLoadKeyEx();
+ status = RegDeleteTreeW(HKEY_CURRENT_USER, L"WineTest"); + ok(status == ERROR_SUCCESS, "Failed to delete the WineTest registry key: %lu\n", status); + pRtlFreeUnicodeString(&winetestpath);
FreeLibrary(hntdll);