Module: wine Branch: master Commit: 07737513148cbd2d251a1def9847ad6ed50f302b URL: https://gitlab.winehq.org/wine/wine/-/commit/07737513148cbd2d251a1def9847ad6...
Author: Alex Henrie alexhenrie24@gmail.com Date: Sun May 26 22:41:16 2024 -0600
ntdll/tests: Delete the WineTest registry key when the tests finish.
---
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);