* PROJECT: ReactOS kernel-mode tests
* LICENSE: GPLv2+ - See COPYING in the top level directory
* PURPOSE: Test for RtlQueryRegistryValues
- * PROGRAMMER: Thomas Faber <thfabba@gmx.de>
+ * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
*/
#define KMT_EMULATE_KERNEL
#include <kmt_test.h>
-#ifdef KMT_KERNEL_MODE
-#define KMT_KERNEL_HANDLE OBJ_KERNEL_HANDLE
-#else
-#define KMT_KERNEL_HANDLE 0
-#endif
-
#ifndef RTL_NUMBER_OF
#define RTL_NUMBER_OF(x) (sizeof(x) / sizeof(x[0]))
#endif
#define DO_QUERY(ExpectedArray, ExpectedCount) do \
{ \
ULONG _i; \
- for (_i = 0; _i < (ExpectedCount); _i++) \
+ ULONG _ExpectedCount = (ExpectedCount); \
+ for (_i = 0; _i < _ExpectedCount; _i++) \
{ \
Expected.Values[_i].ValueName = ValueName.Buffer; \
Expected.Values[_i].ValueType = REG_SZ; \
Expected.Values[_i].ValueLength = (ExpectedArray)[_i].Len; \
} \
Expected.CurrentIndex = 0; \
- Expected.Count = (ExpectedCount); \
- if ((ExpectedCount) == 1) \
+ Expected.Count = _ExpectedCount; \
+ if (_ExpectedCount == 1) \
QueryTable[0].EntryContext = &Expected.Values[0]; \
else \
QueryTable[0].EntryContext = NULL; \
RtlInitUnicodeString(&KeyName, L"\\Registry\\MACHINE\\Software");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
- OBJ_CASE_INSENSITIVE | KMT_KERNEL_HANDLE,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
NULL,
NULL);
Status = ZwOpenKey(&SoftwareHandle,
RtlInitUnicodeString(&KeyName, L"RtlRegistryKmtestKey");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
- OBJ_CASE_INSENSITIVE | KMT_KERNEL_HANDLE,
+ OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
SoftwareHandle,
NULL);
Status = ZwCreateKey(&KeyHandle,