2 * This example demonstrates dynamical loading of (internal) Win32 DLLS.
7 int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
10 void (CALLBACK *fnGetSystemInfo)(LPSYSTEM_INFO si);
13 kernel32 = LoadLibrary("KERNEL32");
15 fprintf(stderr,"FATAL: could not load KERNEL32!\n");
18 fnGetSystemInfo = (void (CALLBACK*)(LPSYSTEM_INFO))GetProcAddress(kernel32,"GetSystemInfo");
19 if (!fnGetSystemInfo) {
20 fprintf(stderr,"FATAL: could not find GetSystemInfo!\n");
24 fprintf(stderr,"QuerySystemInfo returns:\n");
25 fprintf(stderr," wProcessorArchitecture: %d\n",si.u.x.wProcessorArchitecture);
26 fprintf(stderr," dwPageSize: %ld\n",si.dwPageSize);
27 fprintf(stderr," lpMinimumApplicationAddress: %p\n",si.lpMinimumApplicationAddress);
28 fprintf(stderr," lpMaximumApplicationAddress: %p\n",si.lpMaximumApplicationAddress);
29 fprintf(stderr," dwActiveProcessorMask: %ld\n",si.dwActiveProcessorMask);
30 fprintf(stderr," dwNumberOfProcessors: %ld\n",si.dwNumberOfProcessors);
31 fprintf(stderr," dwProcessorType: %ld\n",si.dwProcessorType);
32 fprintf(stderr," dwAllocationGranularity: %ld\n",si.dwAllocationGranularity);
33 fprintf(stderr," wProcessorLevel: %d\n",si.wProcessorLevel);
34 fprintf(stderr," wProcessorRevision: %d\n",si.wProcessorRevision);