mshtml: Added IHTMLStyleSheet::get_rules implementation.
[wine] / dlls / ntdll / tests / info.c
1 /* Unit test suite for *Information* Registry API functions
2  *
3  * Copyright 2005 Paul Vriens
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  *
19  */
20
21 #include "ntdll_test.h"
22 #include <winnls.h>
23
24 static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
25 static NTSTATUS (WINAPI * pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
26 static NTSTATUS (WINAPI * pNtReadVirtualMemory)(HANDLE, const void*, void*, SIZE_T, SIZE_T*);
27
28 /* one_before_last_pid is used to be able to compare values of a still running process
29    with the output of the test_query_process_times and test_query_process_handlecount tests.
30 */
31 static DWORD one_before_last_pid = 0;
32
33 #define NTDLL_GET_PROC(func) do {                     \
34     p ## func = (void*)GetProcAddress(hntdll, #func); \
35     if(!p ## func) { \
36       trace("GetProcAddress(%s) failed\n", #func); \
37       return FALSE; \
38     } \
39   } while(0)
40
41 static BOOL InitFunctionPtrs(void)
42 {
43     /* All needed functions are NT based, so using GetModuleHandle is a good check */
44     HMODULE hntdll = GetModuleHandle("ntdll");
45     if (!hntdll)
46     {
47         skip("Not running on NT\n");
48         return FALSE;
49     }
50
51     NTDLL_GET_PROC(NtQuerySystemInformation);
52     NTDLL_GET_PROC(NtQueryInformationProcess);
53     NTDLL_GET_PROC(NtReadVirtualMemory);
54
55     return TRUE;
56 }
57
58 static void test_query_basic(void)
59 {
60     DWORD status;
61     ULONG ReturnLength;
62     SYSTEM_BASIC_INFORMATION sbi;
63
64     /* This test also covers some basic parameter testing that should be the same for 
65      * every information class
66     */
67
68     /* Use a nonexistent info class */
69     trace("Check nonexistent info class\n");
70     status = pNtQuerySystemInformation(-1, NULL, 0, NULL);
71     ok( status == STATUS_INVALID_INFO_CLASS, "Expected STATUS_INVALID_INFO_CLASS, got %08x\n", status);
72
73     /* Use an existing class but with a zero-length buffer */
74     trace("Check zero-length buffer\n");
75     status = pNtQuerySystemInformation(SystemBasicInformation, NULL, 0, NULL);
76     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
77
78     /* Use an existing class, correct length but no SystemInformation buffer */
79     trace("Check no SystemInformation buffer\n");
80     status = pNtQuerySystemInformation(SystemBasicInformation, NULL, sizeof(sbi), NULL);
81     ok( status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got %08x\n", status);
82
83     /* Use a existing class, correct length, a pointer to a buffer but no ReturnLength pointer */
84     trace("Check no ReturnLength pointer\n");
85     status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL);
86     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
87
88     /* Check a too large buffer size */
89     trace("Check a too large buffer size\n");
90     status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi) * 2, &ReturnLength);
91     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
92
93     /* Finally some correct calls */
94     trace("Check with correct parameters\n");
95     status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), &ReturnLength);
96     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
97     ok( sizeof(sbi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
98
99     /* Check if we have some return values */
100     trace("Number of Processors : %d\n", sbi.NumberOfProcessors);
101     ok( sbi.NumberOfProcessors > 0, "Expected more than 0 processors, got %d\n", sbi.NumberOfProcessors);
102 }
103
104 static void test_query_cpu(void)
105 {
106     DWORD status;
107     ULONG ReturnLength;
108     SYSTEM_CPU_INFORMATION sci;
109
110     status = pNtQuerySystemInformation(SystemCpuInformation, &sci, sizeof(sci), &ReturnLength);
111     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
112     ok( sizeof(sci) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
113
114     /* Check if we have some return values */
115     trace("Processor FeatureSet : %08x\n", sci.FeatureSet);
116     ok( sci.FeatureSet != 0, "Expected some features for this processor, got %08x\n", sci.FeatureSet);
117 }
118
119 static void test_query_performance(void)
120 {
121     DWORD status;
122     ULONG ReturnLength;
123     SYSTEM_PERFORMANCE_INFORMATION spi;
124
125     status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, 0, &ReturnLength);
126     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
127
128     status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, sizeof(spi), &ReturnLength);
129     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
130     ok( sizeof(spi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
131
132     status = pNtQuerySystemInformation(SystemPerformanceInformation, &spi, sizeof(spi) + 2, &ReturnLength);
133     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
134     ok( sizeof(spi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
135
136     /* Not return values yet, as struct members are unknown */
137 }
138
139 static void test_query_timeofday(void)
140 {
141     DWORD status;
142     ULONG ReturnLength;
143
144     /* Copy of our winternl.h structure turned into a private one */
145     typedef struct _SYSTEM_TIMEOFDAY_INFORMATION_PRIVATE {
146         LARGE_INTEGER liKeBootTime;
147         LARGE_INTEGER liKeSystemTime;
148         LARGE_INTEGER liExpTimeZoneBias;
149         ULONG uCurrentTimeZoneId;
150         DWORD dwUnknown1[5];
151     } SYSTEM_TIMEOFDAY_INFORMATION_PRIVATE, *PSYSTEM_TIMEOFDAY_INFORMATION_PRIVATE;
152
153     SYSTEM_TIMEOFDAY_INFORMATION_PRIVATE sti;
154   
155     /*  The struct size for NT (32 bytes) and Win2K/XP (48 bytes) differ.
156      *
157      *  Windows 2000 and XP return STATUS_INFO_LENGTH_MISMATCH if the given buffer size is greater
158      *  then 48 and 0 otherwise
159      *  Windows NT returns STATUS_INFO_LENGTH_MISMATCH when the given buffer size is not correct
160      *  and 0 otherwise
161      *
162      *  Windows 2000 and XP copy the given buffer size into the provided buffer, if the return code is STATUS_SUCCESS
163      *  NT only fills the buffer if the return code is STATUS_SUCCESS
164      *
165     */
166
167     status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, sizeof(sti), &ReturnLength);
168
169     if (status == STATUS_INFO_LENGTH_MISMATCH)
170     {
171         trace("Windows version is NT, we have to cater for differences with W2K/WinXP\n");
172  
173         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, 0, &ReturnLength);
174         ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
175         ok( 0 == ReturnLength, "ReturnLength should be 0, it is (%d)\n", ReturnLength);
176
177         sti.uCurrentTimeZoneId = 0xdeadbeef;
178         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, 28, &ReturnLength);
179         ok( 0xdeadbeef == sti.uCurrentTimeZoneId, "This part of the buffer should not have been filled\n");
180
181         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, 32, &ReturnLength);
182         ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
183         ok( 32 == ReturnLength, "ReturnLength should be 0, it is (%d)\n", ReturnLength);
184     }
185     else
186     {
187         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, 0, &ReturnLength);
188         ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
189         ok( 0 == ReturnLength, "ReturnLength should be 0, it is (%d)\n", ReturnLength);
190
191         sti.uCurrentTimeZoneId = 0xdeadbeef;
192         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, 24, &ReturnLength);
193         ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
194         ok( 24 == ReturnLength, "ReturnLength should be 24, it is (%d)\n", ReturnLength);
195         ok( 0xdeadbeef == sti.uCurrentTimeZoneId, "This part of the buffer should not have been filled\n");
196     
197         sti.uCurrentTimeZoneId = 0xdeadbeef;
198         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, 32, &ReturnLength);
199         ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
200         ok( 32 == ReturnLength, "ReturnLength should be 32, it is (%d)\n", ReturnLength);
201         ok( 0xdeadbeef != sti.uCurrentTimeZoneId, "Buffer should have been partially filled\n");
202     
203         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, 49, &ReturnLength);
204         ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
205         ok( 0 == ReturnLength, "ReturnLength should be 0, it is (%d)\n", ReturnLength);
206     
207         status = pNtQuerySystemInformation(SystemTimeOfDayInformation, &sti, sizeof(sti), &ReturnLength);
208         ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
209         ok( sizeof(sti) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
210     }
211
212     /* Check if we have some return values */
213     trace("uCurrentTimeZoneId : (%d)\n", sti.uCurrentTimeZoneId);
214 }
215
216 static void test_query_process(void)
217 {
218     DWORD status;
219     DWORD last_pid;
220     ULONG ReturnLength;
221     int i = 0, k = 0;
222     int is_nt = 0;
223     SYSTEM_BASIC_INFORMATION sbi;
224
225     /* Copy of our winternl.h structure turned into a private one */
226     typedef struct _SYSTEM_PROCESS_INFORMATION_PRIVATE {
227         DWORD dwOffset;
228         DWORD dwThreadCount;
229         DWORD dwUnknown1[6];
230         FILETIME ftCreationTime;
231         FILETIME ftUserTime;
232         FILETIME ftKernelTime;
233         UNICODE_STRING ProcessName;
234         DWORD dwBasePriority;
235         DWORD dwProcessID;
236         DWORD dwParentProcessID;
237         DWORD dwHandleCount;
238         DWORD dwUnknown3;
239         DWORD dwUnknown4;
240         VM_COUNTERS vmCounters;
241         IO_COUNTERS ioCounters;
242         SYSTEM_THREAD_INFORMATION ti[1];
243     } SYSTEM_PROCESS_INFORMATION_PRIVATE, *PSYSTEM_PROCESS_INFORMATION_PRIVATE;
244
245     ULONG SystemInformationLength = sizeof(SYSTEM_PROCESS_INFORMATION_PRIVATE);
246     SYSTEM_PROCESS_INFORMATION_PRIVATE* spi = HeapAlloc(GetProcessHeap(), 0, SystemInformationLength);
247
248     /* Only W2K3 returns the needed length, the rest returns 0, so we have to loop */
249
250     for (;;)
251     {
252         status = pNtQuerySystemInformation(SystemProcessInformation, spi, SystemInformationLength, &ReturnLength);
253
254         if (status != STATUS_INFO_LENGTH_MISMATCH) break;
255         
256         spi = HeapReAlloc(GetProcessHeap(), 0, spi , SystemInformationLength *= 2);
257     }
258
259     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
260
261     /* Get the first dwOffset, from this we can deduce the OS version we're running
262      *
263      * W2K/WinXP/W2K3:
264      *   dwOffset for a process is 184 + (no. of threads) * sizeof(SYSTEM_THREAD_INFORMATION)
265      * NT:
266      *   dwOffset for a process is 136 + (no. of threads) * sizeof(SYSTEM_THREAD_INFORMATION)
267      * Wine (with every windows version):
268      *   dwOffset for a process is 0 if just this test is running
269      *   dwOffset for a process is 184 + (no. of threads) * sizeof(SYSTEM_THREAD_INFORMATION) +
270      *                             ProcessName.MaximumLength
271      *     if more wine processes are running
272      *
273      * Note : On windows the first process is in fact the Idle 'process' with a thread for every processor
274     */
275
276     pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), &ReturnLength);
277
278     is_nt = ( spi->dwOffset - (sbi.NumberOfProcessors * sizeof(SYSTEM_THREAD_INFORMATION)) == 136);
279
280     if (is_nt) skip("Windows version is NT, we will skip thread tests\n");
281
282     /* Check if we have some return values
283      * 
284      * On windows there will be several processes running (Including the always present Idle and System)
285      * On wine we only have one (if this test is the only wine process running)
286     */
287     
288     /* Loop through the processes */
289
290     for (;;)
291     {
292         i++;
293
294         last_pid = spi->dwProcessID;
295
296         ok( spi->dwThreadCount > 0, "Expected some threads for this process, got 0\n");
297
298         /* Loop through the threads, skip NT4 for now */
299         
300         if (!is_nt)
301         {
302             DWORD j;
303             for ( j = 0; j < spi->dwThreadCount; j++) 
304             {
305                 k++;
306                 ok ( spi->ti[j].dwOwningPID == spi->dwProcessID, 
307                      "The owning pid of the thread (%d) doesn't equal the pid (%d) of the process\n",
308                      spi->ti[j].dwOwningPID, spi->dwProcessID);
309             }
310         }
311
312         if (!spi->dwOffset) break;
313
314         one_before_last_pid = last_pid;
315
316         spi = (SYSTEM_PROCESS_INFORMATION_PRIVATE*)((char*)spi + spi->dwOffset);
317     }
318     trace("Total number of running processes : %d\n", i);
319     if (!is_nt) trace("Total number of running threads   : %d\n", k);
320
321     if (one_before_last_pid == 0) one_before_last_pid = last_pid;
322
323     HeapFree( GetProcessHeap(), 0, spi);
324 }
325
326 static void test_query_procperf(void)
327 {
328     DWORD status;
329     ULONG ReturnLength;
330     ULONG NeededLength;
331     SYSTEM_BASIC_INFORMATION sbi;
332     SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION* sppi;
333
334     /* Find out the number of processors */
335     status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), &ReturnLength);
336     NeededLength = sbi.NumberOfProcessors * sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION);
337
338     sppi = HeapAlloc(GetProcessHeap(), 0, NeededLength);
339
340     status = pNtQuerySystemInformation(SystemProcessorPerformanceInformation, sppi, 0, &ReturnLength);
341     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
342
343     /* Try it for 1 processor */
344     status = pNtQuerySystemInformation(SystemProcessorPerformanceInformation, sppi,
345                                        sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION), &ReturnLength);
346     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
347     ok( sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) == ReturnLength,
348         "Inconsistent length %d\n", ReturnLength);
349  
350     /* Try it for all processors */
351     status = pNtQuerySystemInformation(SystemProcessorPerformanceInformation, sppi, NeededLength, &ReturnLength);
352     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
353     ok( NeededLength == ReturnLength, "Inconsistent length (%d) <-> (%d)\n", NeededLength, ReturnLength);
354
355     /* A too large given buffer size */
356     sppi = HeapReAlloc(GetProcessHeap(), 0, sppi , NeededLength + 2);
357     status = pNtQuerySystemInformation(SystemProcessorPerformanceInformation, sppi, NeededLength + 2, &ReturnLength);
358     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
359     ok( NeededLength == ReturnLength, "Inconsistent length (%d) <-> (%d)\n", NeededLength, ReturnLength);
360
361     HeapFree( GetProcessHeap(), 0, sppi);
362 }
363
364 static void test_query_module(void)
365 {
366     DWORD status;
367     ULONG ReturnLength;
368     ULONG ModuleCount, i;
369
370     ULONG SystemInformationLength = sizeof(SYSTEM_MODULE_INFORMATION);
371     SYSTEM_MODULE_INFORMATION* smi = HeapAlloc(GetProcessHeap(), 0, SystemInformationLength); 
372     SYSTEM_MODULE* sm;
373
374     /* Request the needed length */
375     status = pNtQuerySystemInformation(SystemModuleInformation, smi, 0, &ReturnLength);
376     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
377     ok( ReturnLength > 0, "Expected a ReturnLength to show the needed length\n");
378
379     SystemInformationLength = ReturnLength;
380     smi = HeapReAlloc(GetProcessHeap(), 0, smi , SystemInformationLength);
381     status = pNtQuerySystemInformation(SystemModuleInformation, smi, SystemInformationLength, &ReturnLength);
382     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
383
384     ModuleCount = smi->ModulesCount;
385     sm = &smi->Modules[0];
386     /* our implementation is a stub for now */
387     ok( ModuleCount > 0, "Expected some modules to be loaded\n");
388
389     /* Loop through all the modules/drivers, Wine doesn't get here (yet) */
390     for (i = 0; i < ModuleCount ; i++)
391     {
392         ok( i == sm->Id, "Id (%d) should have matched %u\n", sm->Id, i);
393         sm++;
394     }
395
396     HeapFree( GetProcessHeap(), 0, smi);
397 }
398
399 static void test_query_handle(void)
400 {
401     DWORD status;
402     ULONG ReturnLength;
403     ULONG SystemInformationLength = sizeof(SYSTEM_HANDLE_INFORMATION);
404     SYSTEM_HANDLE_INFORMATION* shi = HeapAlloc(GetProcessHeap(), 0, SystemInformationLength);
405
406     /* Request the needed length : a SystemInformationLength greater than one struct sets ReturnLength */
407     status = pNtQuerySystemInformation(SystemHandleInformation, shi, SystemInformationLength, &ReturnLength);
408
409     /* The following check assumes more than one handle on any given system */
410     todo_wine
411     {
412         ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
413     }
414     ok( ReturnLength > 0, "Expected ReturnLength to be > 0, it was %d\n", ReturnLength);
415
416     SystemInformationLength = ReturnLength;
417     shi = HeapReAlloc(GetProcessHeap(), 0, shi , SystemInformationLength);
418     status = pNtQuerySystemInformation(SystemHandleInformation, shi, SystemInformationLength, &ReturnLength);
419     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
420
421     /* Check if we have some return values */
422     trace("Number of Handles : %d\n", shi->Count);
423     todo_wine
424     {
425         /* our implementation is a stub for now */
426         ok( shi->Count > 1, "Expected more than 1 handles, got (%d)\n", shi->Count);
427     }
428
429     HeapFree( GetProcessHeap(), 0, shi);
430 }
431
432 static void test_query_cache(void)
433 {
434     DWORD status;
435     ULONG ReturnLength;
436     SYSTEM_CACHE_INFORMATION sci;
437
438     status = pNtQuerySystemInformation(SystemCacheInformation, &sci, 0, &ReturnLength);
439     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
440
441     status = pNtQuerySystemInformation(SystemCacheInformation, &sci, sizeof(sci), &ReturnLength);
442     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
443     ok( sizeof(sci) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
444
445     status = pNtQuerySystemInformation(SystemCacheInformation, &sci, sizeof(sci) + 2, &ReturnLength);
446     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
447     ok( sizeof(sci) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
448 }
449
450 static void test_query_interrupt(void)
451 {
452     DWORD status;
453     ULONG ReturnLength;
454     ULONG NeededLength;
455     SYSTEM_BASIC_INFORMATION sbi;
456     SYSTEM_INTERRUPT_INFORMATION* sii;
457
458     /* Find out the number of processors */
459     status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), &ReturnLength);
460     NeededLength = sbi.NumberOfProcessors * sizeof(SYSTEM_INTERRUPT_INFORMATION);
461
462     sii = HeapAlloc(GetProcessHeap(), 0, NeededLength);
463
464     status = pNtQuerySystemInformation(SystemInterruptInformation, sii, 0, &ReturnLength);
465     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
466
467     /* Try it for all processors */
468     status = pNtQuerySystemInformation(SystemInterruptInformation, sii, NeededLength, &ReturnLength);
469     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
470
471     /* Windows XP and W2K3 (and others?) always return 0 for the ReturnLength
472      * No test added for this as it's highly unlikely that an app depends on this
473     */
474
475     HeapFree( GetProcessHeap(), 0, sii);
476 }
477
478 static void test_query_kerndebug(void)
479 {
480     DWORD status;
481     ULONG ReturnLength;
482     SYSTEM_KERNEL_DEBUGGER_INFORMATION skdi;
483
484     status = pNtQuerySystemInformation(SystemKernelDebuggerInformation, &skdi, 0, &ReturnLength);
485     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
486
487     status = pNtQuerySystemInformation(SystemKernelDebuggerInformation, &skdi, sizeof(skdi), &ReturnLength);
488     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
489     ok( sizeof(skdi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
490
491     status = pNtQuerySystemInformation(SystemKernelDebuggerInformation, &skdi, sizeof(skdi) + 2, &ReturnLength);
492     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
493     ok( sizeof(skdi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
494 }
495
496 static void test_query_regquota(void)
497 {
498     DWORD status;
499     ULONG ReturnLength;
500     SYSTEM_REGISTRY_QUOTA_INFORMATION srqi;
501
502     status = pNtQuerySystemInformation(SystemRegistryQuotaInformation, &srqi, 0, &ReturnLength);
503     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
504
505     status = pNtQuerySystemInformation(SystemRegistryQuotaInformation, &srqi, sizeof(srqi), &ReturnLength);
506     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
507     ok( sizeof(srqi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
508
509     status = pNtQuerySystemInformation(SystemRegistryQuotaInformation, &srqi, sizeof(srqi) + 2, &ReturnLength);
510     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
511     ok( sizeof(srqi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
512 }
513
514 static void test_query_process_basic(void)
515 {
516     DWORD status;
517     ULONG ReturnLength;
518
519     typedef struct _PROCESS_BASIC_INFORMATION_PRIVATE {
520         DWORD ExitStatus;
521         DWORD PebBaseAddress;
522         DWORD AffinityMask;
523         DWORD BasePriority;
524         ULONG UniqueProcessId;
525         ULONG InheritedFromUniqueProcessId;
526     } PROCESS_BASIC_INFORMATION_PRIVATE, *PPROCESS_BASIC_INFORMATION_PRIVATE;
527
528     PROCESS_BASIC_INFORMATION_PRIVATE pbi;
529
530     /* This test also covers some basic parameter testing that should be the same for
531      * every information class
532     */
533
534     /* Use a nonexistent info class */
535     trace("Check nonexistent info class\n");
536     status = pNtQueryInformationProcess(NULL, -1, NULL, 0, NULL);
537     ok( status == STATUS_INVALID_INFO_CLASS, "Expected STATUS_INVALID_INFO_CLASS, got %08x\n", status);
538
539     /* Do not give a handle and buffer */
540     trace("Check NULL handle and buffer and zero-length buffersize\n");
541     status = pNtQueryInformationProcess(NULL, ProcessBasicInformation, NULL, 0, NULL);
542     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
543
544     /* Use a correct info class and buffer size, but still no handle and buffer */
545     trace("Check NULL handle and buffer\n");
546     status = pNtQueryInformationProcess(NULL, ProcessBasicInformation, NULL, sizeof(pbi), NULL);
547     ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_HANDLE,
548         "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08x\n", status);
549
550     /* Use a correct info class and buffer size, but still no handle */
551     trace("Check NULL handle\n");
552     status = pNtQueryInformationProcess(NULL, ProcessBasicInformation, &pbi, sizeof(pbi), NULL);
553     ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
554
555     /* Use a greater buffer size */
556     trace("Check NULL handle and too large buffersize\n");
557     status = pNtQueryInformationProcess(NULL, ProcessBasicInformation, &pbi, sizeof(pbi) * 2, NULL);
558     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
559
560     /* Use no ReturnLength */
561     trace("Check NULL ReturnLength\n");
562     status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), NULL);
563     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
564
565     /* Finally some correct calls */
566     trace("Check with correct parameters\n");
567     status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), &ReturnLength);
568     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
569     ok( sizeof(pbi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
570
571     /* Everything is correct except a too large buffersize */
572     trace("Too large buffersize\n");
573     status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi) * 2, &ReturnLength);
574     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
575     ok( sizeof(pbi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
576                                                                                                                                                
577     /* Check if we have some return values */
578     trace("ProcessID : %d\n", pbi.UniqueProcessId);
579     ok( pbi.UniqueProcessId > 0, "Expected a ProcessID > 0, got 0\n");
580 }
581
582 static void test_query_process_vm(void)
583 {
584     DWORD status;
585     ULONG ReturnLength;
586     VM_COUNTERS pvi;
587
588     status = pNtQueryInformationProcess(NULL, ProcessVmCounters, NULL, sizeof(pvi), NULL);
589     ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_HANDLE,
590         "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08x\n", status);
591
592     status = pNtQueryInformationProcess(NULL, ProcessVmCounters, &pvi, sizeof(pvi), NULL);
593     ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
594
595     /* Windows XP and W2K3 will report success for a size of 44 AND 48 !
596        Windows W2K will only report success for 44.
597        For now we only care for 44, which is sizeof(VM_COUNTERS)
598        If an app depends on it, we have to implement this in ntdll/process.c
599     */
600
601     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessVmCounters, &pvi, 24, &ReturnLength);
602     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
603
604     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessVmCounters, &pvi, sizeof(pvi), &ReturnLength);
605     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
606     ok( sizeof(pvi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
607
608     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessVmCounters, &pvi, 46, &ReturnLength);
609     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
610     ok( sizeof(pvi) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
611
612     /* Check if we have some return values */
613     trace("WorkingSetSize : %ld\n", pvi.WorkingSetSize);
614     todo_wine
615     {
616         ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n");
617     }
618 }
619
620 static void test_query_process_io(void)
621 {
622     DWORD status;
623     ULONG ReturnLength;
624     IO_COUNTERS pii;
625
626     /* NT4 doesn't support this information class, so check for it */
627     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessIoCounters, &pii, sizeof(pii), &ReturnLength);
628     if (status == STATUS_NOT_SUPPORTED)
629     {
630         skip("ProcessIoCounters information class is not supported\n");
631         return;
632     }
633  
634     status = pNtQueryInformationProcess(NULL, ProcessIoCounters, NULL, sizeof(pii), NULL);
635     ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_HANDLE,
636         "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08x\n", status);
637
638     status = pNtQueryInformationProcess(NULL, ProcessIoCounters, &pii, sizeof(pii), NULL);
639     ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
640
641     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessIoCounters, &pii, 24, &ReturnLength);
642     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
643
644     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessIoCounters, &pii, sizeof(pii), &ReturnLength);
645     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
646     ok( sizeof(pii) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
647
648     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessIoCounters, &pii, sizeof(pii) * 2, &ReturnLength);
649     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
650     ok( sizeof(pii) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
651
652     /* Check if we have some return values */
653     trace("OtherOperationCount : 0x%x%08x\n", (DWORD)(pii.OtherOperationCount >> 32), (DWORD)pii.OtherOperationCount);
654     todo_wine
655     {
656         ok( pii.OtherOperationCount > 0, "Expected an OtherOperationCount > 0\n");
657     }
658 }
659
660 static void test_query_process_times(void)
661 {
662     DWORD status;
663     ULONG ReturnLength;
664     HANDLE process;
665     SYSTEMTIME UTC, Local;
666     KERNEL_USER_TIMES spti;
667
668     status = pNtQueryInformationProcess(NULL, ProcessTimes, NULL, sizeof(spti), NULL);
669     ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_HANDLE,
670         "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08x\n", status);
671
672     status = pNtQueryInformationProcess(NULL, ProcessTimes, &spti, sizeof(spti), NULL);
673     ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
674
675     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessTimes, &spti, 24, &ReturnLength);
676     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
677
678     process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, one_before_last_pid);
679     if (!process)
680     {
681         trace("Could not open process with ID : %d, error : %u. Going to use current one.\n", one_before_last_pid, GetLastError());
682         process = GetCurrentProcess();
683         trace("ProcessTimes for current process\n");
684     }
685     else
686         trace("ProcessTimes for process with ID : %d\n", one_before_last_pid);
687
688     status = pNtQueryInformationProcess( process, ProcessTimes, &spti, sizeof(spti), &ReturnLength);
689     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
690     ok( sizeof(spti) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
691     CloseHandle(process);
692
693     FileTimeToSystemTime((const FILETIME *)&spti.CreateTime, &UTC);
694     SystemTimeToTzSpecificLocalTime(NULL, &UTC, &Local);
695     trace("CreateTime : %02d/%02d/%04d %02d:%02d:%02d\n", Local.wMonth, Local.wDay, Local.wYear,
696            Local.wHour, Local.wMinute, Local.wSecond);
697
698     FileTimeToSystemTime((const FILETIME *)&spti.ExitTime, &UTC);
699     SystemTimeToTzSpecificLocalTime(NULL, &UTC, &Local);
700     trace("ExitTime   : %02d/%02d/%04d %02d:%02d:%02d\n", Local.wMonth, Local.wDay, Local.wYear,
701            Local.wHour, Local.wMinute, Local.wSecond);
702
703     FileTimeToSystemTime((const FILETIME *)&spti.KernelTime, &Local);
704     trace("KernelTime : %02d:%02d:%02d.%03d\n", Local.wHour, Local.wMinute, Local.wSecond, Local.wMilliseconds);
705
706     FileTimeToSystemTime((const FILETIME *)&spti.UserTime, &Local);
707     trace("UserTime   : %02d:%02d:%02d.%03d\n", Local.wHour, Local.wMinute, Local.wSecond, Local.wMilliseconds);
708
709     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessTimes, &spti, sizeof(spti) * 2, &ReturnLength);
710     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
711     ok( sizeof(spti) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
712 }
713
714 static void test_query_process_handlecount(void)
715 {
716     DWORD status;
717     ULONG ReturnLength;
718     DWORD handlecount;
719     HANDLE process;
720
721     status = pNtQueryInformationProcess(NULL, ProcessHandleCount, NULL, sizeof(handlecount), NULL);
722     ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_HANDLE,
723         "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_HANDLE(W2K3), got %08x\n", status);
724
725     status = pNtQueryInformationProcess(NULL, ProcessHandleCount, &handlecount, sizeof(handlecount), NULL);
726     ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
727
728     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessHandleCount, &handlecount, 2, &ReturnLength);
729     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
730
731     process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, one_before_last_pid);
732     if (!process)
733     {
734         trace("Could not open process with ID : %d, error : %u. Going to use current one.\n", one_before_last_pid, GetLastError());
735         process = GetCurrentProcess();
736         trace("ProcessHandleCount for current process\n");
737     }
738     else
739         trace("ProcessHandleCount for process with ID : %d\n", one_before_last_pid);
740
741     status = pNtQueryInformationProcess( process, ProcessHandleCount, &handlecount, sizeof(handlecount), &ReturnLength);
742     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
743     ok( sizeof(handlecount) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
744     CloseHandle(process);
745
746     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessHandleCount, &handlecount, sizeof(handlecount) * 2, &ReturnLength);
747     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
748     ok( sizeof(handlecount) == ReturnLength, "Inconsistent length %d\n", ReturnLength);
749
750     /* Check if we have some return values */
751     trace("HandleCount : %d\n", handlecount);
752     todo_wine
753     {
754         ok( handlecount > 0, "Expected some handles, got 0\n");
755     }
756 }
757
758 static void test_query_process_image_file_name(void)
759 {
760     DWORD status;
761     ULONG ReturnLength;
762     UNICODE_STRING image_file_name;
763     void *buffer;
764     char *file_nameA;
765     INT len;
766
767     status = pNtQueryInformationProcess(NULL, ProcessImageFileName, &image_file_name, sizeof(image_file_name), NULL);
768     ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
769
770     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileName, &image_file_name, 2, &ReturnLength);
771     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
772
773     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileName, &image_file_name, sizeof(image_file_name), &ReturnLength);
774     ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
775
776     buffer = HeapAlloc(GetProcessHeap(), 0, ReturnLength);
777     status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessImageFileName, buffer, ReturnLength, &ReturnLength);
778     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
779     memcpy(&image_file_name, buffer, sizeof(image_file_name));
780     len = WideCharToMultiByte(CP_ACP, 0, image_file_name.Buffer, image_file_name.Length/sizeof(WCHAR), NULL, 0, NULL, NULL);
781     file_nameA = HeapAlloc(GetProcessHeap(), 0, len + 1);
782     WideCharToMultiByte(CP_ACP, 0, image_file_name.Buffer, image_file_name.Length/sizeof(WCHAR), file_nameA, len, NULL, NULL);
783     file_nameA[len] = '\0';
784     HeapFree(GetProcessHeap(), 0, buffer);
785     trace("process image file name: %s\n", file_nameA);
786     HeapFree(GetProcessHeap(), 0, file_nameA);
787 }
788
789
790 static void test_readvirtualmemory(void)
791 {
792     HANDLE process;
793     DWORD status;
794     SIZE_T readcount;
795     static const char teststring[] = "test string";
796     char buffer[12];
797
798     process = OpenProcess(PROCESS_VM_READ, FALSE, GetCurrentProcessId());
799     ok(process != 0, "Expected to be able to open own process for reading memory\n");
800
801     /* normal operation */
802     status = pNtReadVirtualMemory(process, teststring, buffer, 12, &readcount);
803     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
804     ok( readcount == 12, "Expected to read 12 bytes, got %ld\n",readcount);
805     ok( strcmp(teststring, buffer) == 0, "Expected read memory to be the same as original memory\n");
806
807     /* no number of bytes */
808     memset(buffer, 0, 12);
809     status = pNtReadVirtualMemory(process, teststring, buffer, 12, NULL);
810     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
811     ok( strcmp(teststring, buffer) == 0, "Expected read memory to be the same as original memory\n");
812
813     /* illegal remote address */
814     todo_wine{
815     status = pNtReadVirtualMemory(process, (void *) 0x1234, buffer, 12, &readcount);
816     ok( status == STATUS_PARTIAL_COPY, "Expected STATUS_PARTIAL_COPY, got %08x\n", status);
817     ok( readcount == 0, "Expected to read 0 bytes, got %ld\n",readcount);
818     }
819
820     /* 0 handle */
821     status = pNtReadVirtualMemory(0, teststring, buffer, 12, &readcount);
822     ok( status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got %08x\n", status);
823     ok( readcount == 0, "Expected to read 0 bytes, got %ld\n",readcount);
824
825     /* pseudo handle for current process*/
826     memset(buffer, 0, 12);
827     status = pNtReadVirtualMemory((HANDLE)-1, teststring, buffer, 12, &readcount);
828     ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
829     ok( readcount == 12, "Expected to read 12 bytes, got %ld\n",readcount);
830     ok( strcmp(teststring, buffer) == 0, "Expected read memory to be the same as original memory\n");
831
832     /* this test currently crashes wine with "wine client error:<process id>: read: Bad address"
833      * because the reply from wine server is directly read into the buffer and that fails with EFAULT
834      */
835     /* illegal local address */
836     /*status = pNtReadVirtualMemory(process, teststring, (void *)0x1234, 12, &readcount);
837     ok( status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got %08lx\n", status);
838     ok( readcount == 0, "Expected to read 0 bytes, got %ld\n",readcount);
839     */
840
841     CloseHandle(process);
842 }
843
844 START_TEST(info)
845 {
846     if(!InitFunctionPtrs())
847         return;
848
849     /* NtQuerySystemInformation */
850
851     /* 0x0 SystemBasicInformation */
852     trace("Starting test_query_basic()\n");
853     test_query_basic();
854
855     /* 0x1 SystemCpuInformation */
856     trace("Starting test_query_cpu()\n");
857     test_query_cpu();
858
859     /* 0x2 SystemPerformanceInformation */
860     trace("Starting test_query_performance()\n");
861     test_query_performance();
862
863     /* 0x3 SystemTimeOfDayInformation */
864     trace("Starting test_query_timeofday()\n");
865     test_query_timeofday();
866
867     /* 0x5 SystemProcessInformation */
868     trace("Starting test_query_process()\n");
869     test_query_process();
870
871     /* 0x8 SystemProcessorPerformanceInformation */
872     trace("Starting test_query_procperf()\n");
873     test_query_procperf();
874
875     /* 0xb SystemModuleInformation */
876     trace("Starting test_query_module()\n");
877     test_query_module();
878
879     /* 0x10 SystemHandleInformation */
880     trace("Starting test_query_handle()\n");
881     test_query_handle();
882
883     /* 0x15 SystemCacheInformation */
884     trace("Starting test_query_cache()\n");
885     test_query_cache();
886
887     /* 0x17 SystemInterruptInformation */
888     trace("Starting test_query_interrupt()\n");
889     test_query_interrupt();
890
891     /* 0x23 SystemKernelDebuggerInformation */
892     trace("Starting test_query_kerndebug()\n");
893     test_query_kerndebug();
894
895     /* 0x25 SystemRegistryQuotaInformation */
896     trace("Starting test_query_regquota()\n");
897     test_query_regquota();
898
899     /* NtQueryInformationProcess */
900
901     /* 0x0 ProcessBasicInformation */
902     trace("Starting test_query_process_basic()\n");
903     test_query_process_basic();
904
905     /* 0x2 ProcessIoCounters */
906     trace("Starting test_query_process_io()\n");
907     test_query_process_io();
908
909     /* 0x3 ProcessVmCounters */
910     trace("Starting test_query_process_vm()\n");
911     test_query_process_vm();
912
913     /* 0x4 ProcessTimes */
914     trace("Starting test_query_process_times()\n");
915     test_query_process_times();
916
917     /* 0x14 ProcessHandleCount */
918     trace("Starting test_query_process_handlecount()\n");
919     test_query_process_handlecount();
920
921     /* 27 ProcessImageFileName */
922     trace("Starting test_query_process_image_file_name()\n");
923     test_query_process_image_file_name();
924
925     /* belongs into it's own file */
926     trace("Starting test_readvirtualmemory()\n");
927     test_readvirtualmemory();
928 }