是OSVersionInfo的扩展 Delphi的Windows.pas中没有定义。自己定义一下吧:
C++:
typedef struct _OSVERSIONINFOEXA {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wReserved[2];
} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
typedef struct _OSVERSIONINFOEXW {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wReserved[2];
} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW;
#ifdef UNICODE
typedef OSVERSIONINFOEXW OSVERSIONINFOEX;
typedef POSVERSIONINFOEXW POSVERSIONINFOEX;
typedef LPOSVERSIONINFOEXW LPOSVERSIONINFOEX;
#else
typedef OSVERSIONINFOEXA OSVERSIONINFOEX;
typedef POSVERSIONINFOEXA POSVERSIONINFOEX;
typedef LPOSVERSIONINFOEXA LPOSVERSIONINFOEX;
#endif // UNICODE
PASCAL:
type
_OSVERSIONINFOEXA = packed record
dwOSVersionInfoSize
WORD;
dwMajorVersion
WORD;
dwMinorVersion
WORD;
dwBuildNumber
WORD;
dwPlatformId
WORD;
szCSDVersion:array [0..127] of Char; // Maintenance string for PSS usage
wServicePackMajor:Word;
wServicePackMinor:Word;
wReserved:array [0..1] of Word;
end;
OSVERSIONINFOEXA = _OSVERSIONINFOEXA;
POSVERSIONINFOEXA = ^_OSVERSIONINFOEXA;
LPOSVERSIONINFOEXA = ^_OSVERSIONINFOEXA;
TOSVersionInfoEx = _OSVERSIONINFOEXA;
POSVersionInfoEx = ^TOSVersionInfoEx;
_OSVERSIONINFOEXW = packed record
dwOSVersionInfoSize
WORD;
dwMajorVersion
WORD;
dwMinorVersion
WORD;
dwBuildNumber
WORD;
dwPlatformId
WORD;
szCSDVersion:array [0..127] of WideChar; // Maintenance string for PSS usage
wServicePackMajor:Word;
wServicePackMinor:Word;
wReserved:array [0..1] of Word;
end;
OSVERSIONINFOEXW = _OSVERSIONINFOEXW;
POSVERSIONINFOEXW = ^_OSVERSIONINFOEXW;
LPOSVERSIONINFOEXW = ^_OSVERSIONINFOEXW;