FreeRDP
TestGetNativeSystemInfo.c
1 
2 #include <winpr/crt.h>
3 #include <winpr/sysinfo.h>
4 
5 int TestGetNativeSystemInfo(int argc, char* argv[])
6 {
7  SYSTEM_INFO sysinfo = { 0 };
8 
9  WINPR_UNUSED(argc);
10  WINPR_UNUSED(argv);
11 
12  GetNativeSystemInfo(&sysinfo);
13 
14  const UINT16 wProcessorArchitecture =
15  sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wProcessorArchitecture;
16  const UINT16 wReserved = sysinfo.DUMMYUNIONNAME.DUMMYSTRUCTNAME.wReserved;
17 
18  printf("SystemInfo:\n");
19  printf("\twProcessorArchitecture: %" PRIu16 "\n", wProcessorArchitecture);
20  printf("\twReserved: %" PRIu16 "\n", wReserved);
21  printf("\tdwPageSize: 0x%08" PRIX32 "\n", sysinfo.dwPageSize);
22  printf("\tlpMinimumApplicationAddress: %p\n", sysinfo.lpMinimumApplicationAddress);
23  printf("\tlpMaximumApplicationAddress: %p\n", sysinfo.lpMaximumApplicationAddress);
24  printf("\tdwActiveProcessorMask: %p\n", (void*)sysinfo.dwActiveProcessorMask);
25  printf("\tdwNumberOfProcessors: %" PRIu32 "\n", sysinfo.dwNumberOfProcessors);
26  printf("\tdwProcessorType: %" PRIu32 "\n", sysinfo.dwProcessorType);
27  printf("\tdwAllocationGranularity: %" PRIu32 "\n", sysinfo.dwAllocationGranularity);
28  printf("\twProcessorLevel: %" PRIu16 "\n", sysinfo.wProcessorLevel);
29  printf("\twProcessorRevision: %" PRIu16 "\n", sysinfo.wProcessorRevision);
30  printf("\n");
31 
32  return 0;
33 }