Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output OS version/Service pack info

Status
Not open for further replies.

Pyramus

Programmer
Dec 19, 2001
237
GB
What's the best way to get this information?
 
I've found the answer to this in using GetVersionEx which uses the OSVERSIONINFOEX structure.

But what I don't understand is some of the members of the structure don't seem to be defined, contradicting what MSDN says. On MSDN the structure is

Code:
typedef struct _OSVERSIONINFOEX {
  DWORD dwOSVersionInfoSize;
  DWORD dwMajorVersion;
  DWORD dwMinorVersion;
  DWORD dwBuildNumber;
  DWORD dwPlatformId;
  TCHAR szCSDVersion[ 128 ];
  WORD wServicePackMajor;
  WORD wServicePackMinor;
  WORD wSuiteMask;
  BYTE wProductType;
  BYTE wReserved;
} OSVERSIONINFOEX, *POSVERSIONINFOEX, *LPOSVERSIONINFOEX;

But, for example, wProductType does not exist when I try this. Has anyone found this?
 
MSDN shows that the GetVersionEx function really takes an OSVERSIONINFO structure, not an OSVERSIONINFOEX structure.
VerifyVersionInfo does take the OSVERSIONINFOEX structure, however. Did you look at MSDN's sample : "getting the system version"?
Steve [dazed]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top