minor corrections by M.Taguchi
[reactos.git] / reactos / apps / tests / tests / GetSystemInfo / GetSystemInfo.c
1 /*
2 * This example demonstrates dynamical loading of (internal) Win32 DLLS.
3 * I dont know why this was called hello5 in the wine tree - sedwards
4 */
5 #include <stdio.h>
6 #include <windows.h>
7
8 int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
9 {
10 SYSTEM_INFO si;
11 void CALLBACK (*fnGetSystemInfo)(LPSYSTEM_INFO si);
12 HMODULE kernel32;
13
14 kernel32 = LoadLibrary("KERNEL32");
15 if (kernel32 == NULL) {
16 fprintf(stderr,"FATAL: could not load KERNEL32!\n");
17 return 0;
18 }
19 fnGetSystemInfo = (void*)GetProcAddress(kernel32,"GetSystemInfo");
20 if (!fnGetSystemInfo) {
21 fprintf(stderr,"FATAL: could not find GetSystemInfo!\n");
22 return 0;
23 }
24 fnGetSystemInfo(&si);
25 fprintf(stderr,"QuerySystemInfo returns:\n");
26 fprintf(stderr," wProcessorArchitecture: %d\n",si.u.s.wProcessorArchitecture);
27 fprintf(stderr," dwPageSize: %ld\n",si.dwPageSize);
28 fprintf(stderr," lpMinimumApplicationAddress: %p\n",si.lpMinimumApplicationAddress);
29 fprintf(stderr," lpMaximumApplicationAddress: %p\n",si.lpMaximumApplicationAddress);
30 fprintf(stderr," dwActiveProcessorMask: %ld\n",si.dwActiveProcessorMask);
31 fprintf(stderr," dwNumberOfProcessors: %ld\n",si.dwNumberOfProcessors);
32 fprintf(stderr," dwProcessorType: %ld\n",si.dwProcessorType);
33 fprintf(stderr," dwAllocationGranularity: %ld\n",si.dwAllocationGranularity);
34 fprintf(stderr," wProcessorLevel: %d\n",si.wProcessorLevel);
35 fprintf(stderr," wProcessorRevision: %d\n",si.wProcessorRevision);
36 return 0;
37 }