1 /*
2  * PROJECT:         ReactOS api tests
3  * LICENSE:         GPL - See COPYING in the top level directory
4  * PURPOSE:         Test for NtQuery/SetSystemInformation
5  * PROGRAMMERS:     Timo Kreuzer
6  *                  Thomas Faber <thomas.faber@reactos.org>
7  */
8 
9 #include "precomp.h"
10 
11 #define ntv6(x) (LOBYTE(LOWORD(GetVersion())) >= 6 ? (x) : 0)
12 
13 static
14 void
15 Test_Flags(void)
16 {
17     NTSTATUS Status;
18     ULONG ReturnLength;
19     ULONG Flags;
20     ULONG Buffer[2];
21     ULONG Buffer2[2];
22     PSYSTEM_FLAGS_INFORMATION FlagsInfo = (PVOID)Buffer;
23     BOOLEAN PrivilegeEnabled;
24 
25     /* Query */
26     ReturnLength = 0x55555555;
27     Status = NtQuerySystemInformation(SystemFlagsInformation, NULL, 0, &ReturnLength);
28     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status);
29     ok(ReturnLength == 0 ||
30        ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength);
31 
32     ReturnLength = 0x55555555;
33     Status = NtQuerySystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION) - 1, &ReturnLength);
34     ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status);
35     ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength);
36 
37     ReturnLength = 0x55555555;
38     Status = NtQuerySystemInformation(SystemFlagsInformation, (PVOID)2, 0, &ReturnLength);
39     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status);
40     ok(ReturnLength == 0 ||
41        ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength);
42 
43     ReturnLength = 0x55555555;
44     Status = NtQuerySystemInformation(SystemFlagsInformation, (PVOID)4, 0, &ReturnLength);
45     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status);
46     ok(ReturnLength == 0 ||
47        ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength);
48 
49     ReturnLength = 0x55555555;
50     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
51     Status = NtQuerySystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION), &ReturnLength);
52     ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtQuerySystemInformation returned %lx\n", Status);
53     ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength);
54     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
55     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
56 
57     ReturnLength = 0x55555555;
58     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
59     Status = NtQuerySystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION) - 1, &ReturnLength);
60     ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtQuerySystemInformation returned %lx\n", Status);
61     ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength);
62     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
63     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
64 
65     ReturnLength = 0x55555555;
66     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
67     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) - 1, &ReturnLength);
68     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status);
69     ok(ReturnLength == 0 ||
70        ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength);
71     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
72     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
73 
74     ReturnLength = 0x55555555;
75     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
76     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), &ReturnLength);
77     ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status);
78     ok(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION), "ReturnLength = %lu\n", ReturnLength);
79     ok(FlagsInfo->Flags != 0x55555555, "Flags = %lx\n", FlagsInfo->Flags);
80     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
81     Flags = FlagsInfo->Flags;
82 
83     ReturnLength = 0x55555555;
84     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
85     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) + 1, &ReturnLength);
86     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status);
87     ok(ReturnLength == 0 ||
88        ntv6(ReturnLength == sizeof(SYSTEM_FLAGS_INFORMATION)), "ReturnLength = %lu\n", ReturnLength);
89     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
90     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
91 
92     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
93     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), NULL);
94     ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status);
95     ok(FlagsInfo->Flags == Flags, "Flags = %lx, expected %lx\n", FlagsInfo->Flags, Flags);
96     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
97 
98     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
99     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PVOID)4);
100     ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status);
101     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
102     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
103 
104     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
105     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PVOID)2);
106     ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status);
107     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
108     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
109 
110     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
111     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PVOID)1);
112     ok(Status == STATUS_ACCESS_VIOLATION, "NtQuerySystemInformation returned %lx\n", Status);
113     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
114     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
115 
116     RtlFillMemory(Buffer2, sizeof(Buffer2), 0x55);
117     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
118     Status = NtQuerySystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION), (PULONG)((PUCHAR)Buffer2 + 1));
119     ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status);
120     ok(FlagsInfo->Flags == Flags, "Flags = %lx, expected %lx\n", FlagsInfo->Flags, Flags);
121     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
122     ok(Buffer2[0] == 0x00000455, "Buffer2[0] = %lx\n", Buffer2[0]);
123     ok(Buffer2[1] == 0x55555500, "Buffer2[1] = %lx\n", Buffer2[1]);
124 
125     /* Set */
126     Status = NtSetSystemInformation(SystemFlagsInformation, NULL, 0);
127     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status);
128 
129     Status = NtSetSystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION) - 1);
130     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status);
131 
132     Status = NtSetSystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION));
133     ok(Status == STATUS_ACCESS_DENIED, "NtSetSystemInformation returned %lx\n", Status);
134 
135     Status = NtSetSystemInformation(SystemFlagsInformation, (PVOID)2, sizeof(SYSTEM_FLAGS_INFORMATION));
136     ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status);
137 
138     Status = RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, TRUE, FALSE, &PrivilegeEnabled);
139     if (!NT_SUCCESS(Status))
140     {
141         skip("Cannot acquire SeDebugPrivilege\n");
142         return;
143     }
144 
145     Status = NtSetSystemInformation(SystemFlagsInformation, NULL, sizeof(SYSTEM_FLAGS_INFORMATION));
146     ok(Status == STATUS_ACCESS_VIOLATION, "NtSetSystemInformation returned %lx\n", Status);
147 
148     Status = NtSetSystemInformation(SystemFlagsInformation, (PVOID)2, sizeof(SYSTEM_FLAGS_INFORMATION));
149     ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status);
150 
151     Status = NtSetSystemInformation(SystemFlagsInformation, (PVOID)4, sizeof(SYSTEM_FLAGS_INFORMATION));
152     ok(Status == STATUS_ACCESS_VIOLATION, "NtSetSystemInformation returned %lx\n", Status);
153 
154     FlagsInfo->Flags = Flags;
155     Status = NtSetSystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION));
156     ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status);
157 
158     Status = NtSetSystemInformation(SystemFlagsInformation, (PUCHAR)FlagsInfo + 2, sizeof(SYSTEM_FLAGS_INFORMATION) - 1);
159     ok(Status == STATUS_DATATYPE_MISALIGNMENT, "NtSetSystemInformation returned %lx\n", Status);
160 
161     Status = NtSetSystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) - 1);
162     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status);
163 
164     Status = NtSetSystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION) + 1);
165     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtSetSystemInformation returned %lx\n", Status);
166 
167     Status = NtSetSystemInformation(SystemFlagsInformation, FlagsInfo, sizeof(SYSTEM_FLAGS_INFORMATION));
168     ok(Status == STATUS_SUCCESS, "NtSetSystemInformation returned %lx\n", Status);
169 
170     ok(FlagsInfo->Flags == Flags, "Flags = %lx, expected %lu\n", FlagsInfo->Flags, Flags);
171 
172     Status = RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, PrivilegeEnabled, FALSE, &PrivilegeEnabled);
173     ok(Status == STATUS_SUCCESS, "RtlAdjustPrivilege returned %lx\n", Status);
174 }
175 
176 static
177 void
178 Test_TimeAdjustment(void)
179 {
180     SYSTEM_QUERY_TIME_ADJUST_INFORMATION TimeInfoOrg, GetTimeInfo;
181     SYSTEM_SET_TIME_ADJUST_INFORMATION SetTimeInfo;
182     NTSTATUS Status;
183     ULONG ReturnLength;
184     BOOLEAN PrivilegeEnabled;
185 
186     SetTimeInfo.TimeAdjustment = 0;
187     SetTimeInfo.Enable = 0;
188 
189     /* Query original values */
190     Status = NtQuerySystemInformation(SystemTimeAdjustmentInformation,
191                                       &TimeInfoOrg,
192                                       sizeof(TimeInfoOrg),
193                                       &ReturnLength);
194 
195     /* Test without privilege */
196     Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
197                                     &SetTimeInfo,
198                                     sizeof(SetTimeInfo));
199     ok_ntstatus(Status, STATUS_PRIVILEGE_NOT_HELD);
200 
201     /* Get the required privilege */
202     Status = RtlAdjustPrivilege(SE_SYSTEMTIME_PRIVILEGE, TRUE, FALSE, &PrivilegeEnabled);
203     if (!NT_SUCCESS(Status))
204     {
205         skip("Cannot acquire SeSystemTimePrivilege\n");
206         return;
207     }
208 
209     /* Test wrong length */
210     Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
211                                     &SetTimeInfo,
212                                     sizeof(SetTimeInfo) + 1);
213     ok_ntstatus(Status, STATUS_INFO_LENGTH_MISMATCH);
214 
215     /* Test both members 0 */
216     Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
217                                     &SetTimeInfo,
218                                     sizeof(SetTimeInfo));
219     ok_ntstatus(Status, STATUS_INVALID_PARAMETER_2);
220 
221     /* Set huge value */
222     SetTimeInfo.TimeAdjustment = -1;
223     SetTimeInfo.Enable = 0;
224     Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
225                                     &SetTimeInfo,
226                                     sizeof(SetTimeInfo));
227     ok_ntstatus(Status, STATUS_SUCCESS);
228 
229     /* Query the result */
230     Status = NtQuerySystemInformation(SystemTimeAdjustmentInformation,
231                                       &GetTimeInfo,
232                                       sizeof(GetTimeInfo),
233                                       &ReturnLength);
234     ok_ntstatus(Status, STATUS_SUCCESS);
235     ok_long(GetTimeInfo.TimeAdjustment, -1);
236     ok_long(GetTimeInfo.Enable, 0);
237 
238     /* set Enable to 1 */
239     SetTimeInfo.TimeAdjustment = -1;
240     SetTimeInfo.Enable = 1;
241     Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
242                                     &SetTimeInfo,
243                                     sizeof(SetTimeInfo));
244     ok_ntstatus(Status, STATUS_SUCCESS);
245 
246     /* Query the result */
247     Status = NtQuerySystemInformation(SystemTimeAdjustmentInformation,
248                                       &GetTimeInfo,
249                                       sizeof(GetTimeInfo),
250                                       &ReturnLength);
251     ok_ntstatus(Status, STATUS_SUCCESS);
252     ok_long(GetTimeInfo.TimeAdjustment, GetTimeInfo.TimeIncrement);
253     ok_long(GetTimeInfo.Enable, 1);
254 
255     /* Restore original values */
256     SetTimeInfo.TimeAdjustment = TimeInfoOrg.TimeAdjustment;
257     SetTimeInfo.Enable = TimeInfoOrg.Enable;
258     Status = NtSetSystemInformation(SystemTimeAdjustmentInformation,
259                                     &SetTimeInfo,
260                                     sizeof(SetTimeInfo));
261     ok_ntstatus(Status, STATUS_SUCCESS);
262 
263     Status = RtlAdjustPrivilege(SE_SYSTEMTIME_PRIVILEGE, PrivilegeEnabled, FALSE, &PrivilegeEnabled);
264     ok(Status == STATUS_SUCCESS, "RtlAdjustPrivilege returned %lx\n", Status);
265 }
266 
267 static
268 void
269 Test_KernelDebugger(void)
270 {
271     NTSTATUS Status;
272     ULONG ReturnLength;
273     ULONG Buffer[2];
274     PSYSTEM_KERNEL_DEBUGGER_INFORMATION DebuggerInfo = (PVOID)Buffer;
275 
276     /* Query */
277     ReturnLength = 0x55555555;
278     Status = NtQuerySystemInformation(SystemKernelDebuggerInformation, NULL, 0, &ReturnLength);
279     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status);
280     ok(ReturnLength == 0 ||
281        ntv6(ReturnLength == sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION)), "ReturnLength = %lu\n", ReturnLength);
282 
283     ReturnLength = 0x55555555;
284     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
285     Status = NtQuerySystemInformation(SystemKernelDebuggerInformation, DebuggerInfo, sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION) - 1, &ReturnLength);
286     ok(Status == STATUS_INFO_LENGTH_MISMATCH, "NtQuerySystemInformation returned %lx\n", Status);
287     ok(ReturnLength == 0 ||
288        ntv6(ReturnLength == sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION)), "ReturnLength = %lu\n", ReturnLength);
289     ok(Buffer[0] == 0x55555555, "Buffer[0] = %lx\n", Buffer[0]);
290     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
291 
292     ReturnLength = 0x55555555;
293     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
294     Status = NtQuerySystemInformation(SystemKernelDebuggerInformation, (PUCHAR)DebuggerInfo + 1, sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION), &ReturnLength);
295     ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status);
296     ok(ReturnLength == sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION), "ReturnLength = %lu\n", ReturnLength);
297     ok((Buffer[0] & 0x55fefe55) == 0x55000055, "Buffer[0] = %lx\n", Buffer[0]);
298     ok(Buffer[1] == 0x55555555, "Buffer[1] = %lx\n", Buffer[1]);
299 
300     ReturnLength = 0x55555555;
301     RtlFillMemory(Buffer, sizeof(Buffer), 0x55);
302     Status = NtQuerySystemInformation(SystemKernelDebuggerInformation, DebuggerInfo, sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION), &ReturnLength);
303     ok(Status == STATUS_SUCCESS, "NtQuerySystemInformation returned %lx\n", Status);
304     ok(ReturnLength == sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION), "ReturnLength = %lu\n", ReturnLength);
305     ok(DebuggerInfo->KernelDebuggerEnabled == FALSE ||
306        DebuggerInfo->KernelDebuggerEnabled == TRUE, "KernelDebuggerEnabled = %u\n", DebuggerInfo->KernelDebuggerEnabled);
307     ok(DebuggerInfo->KernelDebuggerNotPresent == FALSE ||
308        DebuggerInfo->KernelDebuggerNotPresent == TRUE, "KernelDebuggerNotPresent = %u\n", DebuggerInfo->KernelDebuggerNotPresent);
309 
310     /* Set - not supported */
311     DebuggerInfo->KernelDebuggerEnabled = FALSE;
312     DebuggerInfo->KernelDebuggerNotPresent = TRUE;
313     Status = NtSetSystemInformation(SystemKernelDebuggerInformation, DebuggerInfo, sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION));
314     ok(Status == STATUS_INVALID_INFO_CLASS, "NtSetSystemInformation returned %lx\n", Status);
315 }
316 
317 START_TEST(NtSystemInformation)
318 {
319     NTSTATUS Status;
320     ULONG ReturnLength;
321 
322     Status = NtQuerySystemInformation(9999, NULL, 0, NULL);
323     ok(Status == STATUS_INVALID_INFO_CLASS, "NtQuerySystemInformation returned %lx\n", Status);
324 
325     Status = NtQuerySystemInformation(9999, NULL, 0, (PVOID)1);
326     ok(Status == STATUS_ACCESS_VIOLATION ||
327        ntv6(Status == STATUS_INVALID_INFO_CLASS), "NtQuerySystemInformation returned %lx\n", Status);
328 
329     ReturnLength = 0x55555555;
330     Status = NtQuerySystemInformation(9999, NULL, 0, &ReturnLength);
331     ok(Status == STATUS_INVALID_INFO_CLASS, "NtQuerySystemInformation returned %lx\n", Status);
332     ok(ReturnLength == 0 ||
333        ntv6(ReturnLength == 0x55555555), "ReturnLength = %lu\n", ReturnLength);
334 
335     ReturnLength = 0x55555555;
336     Status = NtQuerySystemInformation(9999, NULL, 1, &ReturnLength);
337     ok(Status == STATUS_ACCESS_VIOLATION ||
338        ntv6(Status == STATUS_INVALID_INFO_CLASS), "NtQuerySystemInformation returned %lx\n", Status);
339     ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength);
340 
341     ReturnLength = 0x55555555;
342     Status = NtQuerySystemInformation(9999, (PVOID)1, 1, &ReturnLength);
343     ok(Status == STATUS_DATATYPE_MISALIGNMENT ||
344        ntv6(Status == STATUS_INVALID_INFO_CLASS), "NtQuerySystemInformation returned %lx\n", Status);
345     ok(ReturnLength == 0x55555555, "ReturnLength = %lu\n", ReturnLength);
346 
347     Status = NtQuerySystemInformation(9999, NULL, 1, (PVOID)1);
348     ok(Status == STATUS_ACCESS_VIOLATION ||
349        ntv6(Status == STATUS_INVALID_INFO_CLASS), "NtQuerySystemInformation returned %lx\n", Status);
350 
351     Status = NtQuerySystemInformation(9999, (PVOID)1, 1, (PVOID)1);
352     ok(Status == STATUS_DATATYPE_MISALIGNMENT ||
353        ntv6(Status == STATUS_INVALID_INFO_CLASS), "NtQuerySystemInformation returned %lx\n", Status);
354 
355     Test_Flags();
356     Test_TimeAdjustment();
357     Test_KernelDebugger();
358 }
359