12#define IS_HKCR(hk) (((UINT_PTR)hk & 3) == 2)
54 ok(NameInformation !=
NULL,
"\n");
65 RtlFreeHeap(RtlGetProcessHeap(), 0, NameInformation);
70 DWORD ErrorCode =
RegQueryInfoKeyW(
hKey,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
76#define ok_key_deleted(hKey) _test_key_deleted(hKey, TRUE, __LINE__)
77#define ok_key_not_deleted(hKey) _test_key_deleted(hKey, FALSE, __LINE__)
95 "Key name is %.*S, expected %.*S\n",
102#define ok_key_name(hKey, Prefix, Name) _test_key_name(hKey, Prefix, Name, __LINE__)
108 HKEY MachineKey, MachineSubKey;
109 HKEY UserKey, UserSubKey;
110 HKEY ClassesRootKey, ClassesRootSubKey;
117 L"Software\\Classes\\Apitest_HKLM",
128 win_skip(
"Please run those tests with Administrator rights\n");
150 L"Software\\Classes\\Apitest_HKLM",
181 L"Software\\Classes\\Apitest_HKCR",
192 L"Software\\Classes\\Apitest_HKCR",
211 L"Software\\Classes\\Apitest_HKCR",
221 L"Software\\Classes\\Apitest_HKCU",
246 L"Software\\Classes\\Apitest_HKCU",
264 L"Software\\Classes\\Apitest_HKCU",
274 L"Software\\Classes\\Apitest_HKLM_HKCU",
287 L"Software\\Classes\\Apitest_HKLM_HKCU",
301 L"Apitest_HKLM_HKCU",
314 L"Apitest_HKLM_HKCU",
347 L"Software\\Classes\\Apitest_HKLM",
372 L"Software\\Classes\\Apitest_HKLM\\HKCU_Subkey",
415 L"Software\\Classes\\Apitest_HKLM",
447 L"Software\\Classes\\Apitest_HKCU",
492 L"Software\\Classes\\Apitest_HKCU\\HKLM_Subkey",
518 L"Software\\Classes\\Apitest_HKCU",
534 L"Software\\Classes\\Apitest_HKCU\\HKCU_Subkey",
599 ok(Duplicated,
"\n");
600 ok(DupHandle !=
NULL,
"\n");
615 L"Software\\Classes",
static UNICODE_STRING HKCU_ClassesPath
static void Test_DuplicateHandle(void)
static void _test_key_name(HKEY hKey, PUNICODE_STRING Prefix, LPCWSTR Name, ULONG LineNumber)
static void _test_key_deleted(HKEY hKey, BOOL Deleted, ULONG LineNumber)
static LONG DeleteSubKey(HKEY hKey, LPWSTR Root, LPWSTR SubKey)
#define ok_key_not_deleted(hKey)
#define ok_key_name(hKey, Prefix, Name)
static void Test_CreateOpenKey(void)
static UNICODE_STRING HKLM_ClassesPath
#define ok_key_deleted(hKey)
static void GetKeyName(HKEY hKey, PUNICODE_STRING KeyName)
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
#define ok_hex(expression, result)
#define ok_ntstatus(status, expected)
#define ok_dec(expression, result)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define RegCloseKey(hKey)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
#define GetCurrentProcess()
#define ERROR_ACCESS_DENIED
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
NTSYSAPI NTSTATUS WINAPI RtlDuplicateUnicodeString(int, const UNICODE_STRING *, UNICODE_STRING *)
#define ERROR_FILE_NOT_FOUND
_In_ NDIS_ERROR_CODE ErrorCode
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define REG_OPENED_EXISTING_KEY
NTSTATUS NTAPI NtQueryKey(IN HANDLE KeyHandle, IN KEY_INFORMATION_CLASS KeyInformationClass, OUT PVOID KeyInformation, IN ULONG Length, OUT PULONG ResultLength)
#define STATUS_BUFFER_TOO_SMALL
root entry for file system trees
#define RTL_CONSTANT_STRING(s)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
#define ERROR_KEY_DELETED
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT
#define DUPLICATE_SAME_ACCESS
_In_ __drv_aliasesMem PSTRING Prefix