* PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
*/
-#include <stdio.h>
-
-#include <apitest.h>
-#include <strsafe.h>
-
-#define WIN32_NO_STATUS
-#include <ndk/rtlfuncs.h>
-#include <ndk/cmfuncs.h>
-#include <ndk/cmtypes.h>
-#include <ndk/iofuncs.h>
-#include <ndk/obfuncs.h>
-#include <ndk/setypes.h>
+#include "precomp.h"
/* See xdk/cmtypes.h */
#define REG_CREATED_NEW_KEY 1
#endif
+static NTSTATUS (NTAPI *pNtUnloadKey2)(POBJECT_ATTRIBUTES, ULONG);
static BOOLEAN
RetrieveCurrentModuleNTDirectory(
OBJ_CASE_INSENSITIVE,
RootKey,
NULL);
- // return NtUnloadKey(&ObjectAttributes);
- return NtUnloadKey2(&ObjectAttributes, Flags);
+ if (!pNtUnloadKey2)
+ {
+ win_skip("NtUnloadKey2 unavailable, using NtUnloadKey. Flags %lu\n", Flags);
+ return NtUnloadKey(&ObjectAttributes);
+ }
+ return pNtUnloadKey2(&ObjectAttributes, Flags);
}
BOOLEAN PrivilegeSet[2] = {FALSE, FALSE};
WCHAR PathBuffer[MAX_PATH];
+ pNtUnloadKey2 = (PVOID)GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "NtUnloadKey2");
+
/* Retrieve our current directory */
RetrieveCurrentModuleNTDirectory(&NtTestPath);