Andreas Mohr a écrit:
@@ -162,16 +174,18 @@ }, /* NT2K */ {
- "Windows 2000", 0x05005F03, 0x08930005, { sizeof(OSVERSIONINFOA), 5, 0, 0x893, VER_PLATFORM_WIN32_NT, "Service Pack 2",
2, 0, 0, VER_NT_WORKSTATION, 30 /* FIXME: Great, a reserved field with a value! */
2, 0, 0, VER_NT_WORKSTATION, 30 /* FIXME: Great, a reserved field with a value! Is this correct? */
I still have this value (30) on 2K SP3. What do others have for 2K and XP (see attached program)?
Besides, shouldn't we report SP3 for NT2K? And SP1 for XP?
Vincent
#include <windows.h> #include <stdio.h>
typedef struct _OSVERSIONINFOEXAB { DWORD dwOSVersionInfoSize; DWORD dwMajorVersion; DWORD dwMinorVersion; DWORD dwBuildNumber; DWORD dwPlatformId; CHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage WORD wServicePackMajor; WORD wServicePackMinor; WORD wSuiteMask; BYTE wProductType; BYTE wReserved; } OSVERSIONINFOEXAB, *POSVERSIONINFOEXAB, *LPOSVERSIONINFOEXAB;
int main(void) { OSVERSIONINFOEXAB ver; ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXAB);
GetVersionExA((OSVERSIONINFOA *) &ver); printf("%d %d %d %d %d "%s" %d %d %d %d %d\n", ver.dwOSVersionInfoSize, ver.dwMajorVersion, ver.dwMinorVersion, ver.dwBuildNumber, ver.dwPlatformId, ver.szCSDVersion, ver.wServicePackMajor, ver.wServicePackMinor, ver.wSuiteMask, ver.wProductType, ver.wReserved);
exit(0); return 0; }