1 #include "w32knapi.h"
2 
3 OSVERSIONINFOW g_OsVer;
4 UINT g_OsIdx;
5 
6 ASPI gNOPARAM_ROUTINE_CREATEMENU = {-1,-1,0x00,-1,0x00};
7 ASPI gNOPARAM_ROUTINE_CREATEMENUPOPUP = {-1,-1,0x01,-1,0x01};
8 ASPI gNOPARAM_ROUTINE_LOADUSERAPIHOOK = {-1,-1,0x1d,-1,0x0e};
9 ASPI gONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT = {-1, -1, 0x21, 0x21, 0x25};
10 ASPI gONEPARAM_ROUTINE_MAPDEKTOPOBJECT = {-1,-1,0x30,-1,0x31};
11 ASPI gONEPARAM_ROUTINE_SWAPMOUSEBUTTON = {-1,-1,0x42,-1,0x44};
12 
13 ASPI gHWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW = {-1,-1,0x45,-1,0x46};
14 ASPI gHWND_ROUTINE_GETWNDCONTEXTHLPID = {-1,-1,0x47,-1,0x48};
15 ASPI gHWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID = {-1,-1,0x51,-1,0x52};
16 
17 BOOL InitOsVersion()
18 {
19     g_OsVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
20     GetVersionExW((LPOSVERSIONINFOW)&g_OsVer);
21     if (g_OsVer.dwMajorVersion == 4)
22     {
23         g_OsIdx = 0;
24         return TRUE;
25     }
26     else if (g_OsVer.dwMajorVersion == 5)
27     {
28         if (g_OsVer.dwMinorVersion == 0)
29         {
30             g_OsIdx = 1;
31             return TRUE;
32         }
33         else if (g_OsVer.dwMinorVersion == 1)
34         {
35             g_OsIdx = 2;
36             return TRUE;
37         }
38         else if (g_OsVer.dwMinorVersion == 2)
39         {
40             g_OsIdx = 3;
41             return TRUE;
42         }
43     }
44     else if (g_OsVer.dwMajorVersion == 6)
45     {
46         g_OsIdx = 4;
47         return TRUE;
48     }
49     return FALSE;
50 }
51