osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx (&osvi);
typedef struct _OSVERSIONINFOEX {
DWORD dwOSVersionInfoSize;
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
TCHAR dwPlatformId;
TCHAR szCSDVersion[128];
WORD wServicePackMajor; //wServicePackMajor; //sp
WORD wServicePackMinor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEX,
*POSVERSIONINFOEX,
*LPOSVERSIONINFOEX;
dwMajorVersion Major version number of the operating system. This member can be one of the following values.
Value | Meaning |
4 |
Windows NT 4.0 |
5 |
Windows Server 2003, Windows XP, or Windows 2000 |
dwMinorVersion Minor version number of the operating system. This member can be one of the following values.
Value | Meaning |
0 |
Windows 2000 or Windows NT 4.0 |
1 |
Windows XP |
2 |
Windows Server 2003 |