Move inspection tools into their own subdirectory.
[wincetools.git] / inspection / get-system-info.c
1 #include <stdio.h>
2 #include <windows.h>
3
4 char const*
5 get_proc_arch (WORD proc_arch)
6 {
7   switch (proc_arch)
8     {
9     case PROCESSOR_ARCHITECTURE_INTEL:
10       return "INTEL";
11
12     case PROCESSOR_ARCHITECTURE_MIPS:
13       return "MIPS";
14
15     case PROCESSOR_ARCHITECTURE_ALPHA:
16       return "ALPHA";
17
18     case PROCESSOR_ARCHITECTURE_PPC:
19       return "PPC";
20
21     case PROCESSOR_ARCHITECTURE_SHX:
22       return "SHX";
23
24     case PROCESSOR_ARCHITECTURE_ARM:
25       return "ARM";
26
27     case PROCESSOR_ARCHITECTURE_IA64:
28       return "IA64";
29
30     case PROCESSOR_ARCHITECTURE_ALPHA64:
31       return "ALPHA64";
32
33     case PROCESSOR_ARCHITECTURE_MSIL:
34       return "MSIL";
35
36     case PROCESSOR_ARCHITECTURE_AMD64:
37       return "AMD64";
38
39     case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
40       return "WIN64";
41
42     case PROCESSOR_ARCHITECTURE_UNKNOWN:
43       return "UNKNOWN";
44
45     default:
46       return "(unknown)";
47     }
48 };
49
50
51 int
52 main (int argc, char* argv[])
53 {
54   SYSTEM_INFO si;
55   memset (&si, '\0', sizeof (si));
56
57   GetSystemInfo (&si);
58   printf ("Processor Architecture/Type/Level/Revision: %s/%i/%i/%i\n",
59           get_proc_arch (si.wProcessorArchitecture),
60           si.dwProcessorType, (int) si.wProcessorLevel, (int)si.wProcessorRevision);
61   printf ("Page Size: %i\n", si.dwPageSize);
62   printf ("Application Virtual Address Space: %p - %p\n",
63           si.lpMinimumApplicationAddress,
64           si.lpMaximumApplicationAddress);
65   printf ("Allocation Granularity: %i\n",
66           si.dwAllocationGranularity);
67
68   /* Give ssh time to flush buffers.  */
69   fflush (stdout);
70   Sleep (300);
71   return 0;
72 }