1

Topic: Obtaining wSuiteMask from GetVersionEx

I should receive only wSuiteMask.
It is not present in GetVersion, but is in GetVersionEx.
However that it to receive, whether because of any error, whether it only in early versions Delphi, it is necessary to do a heap of things:
To declare type TOSVersionInfoEx

type
TOSVersionInfoEx = packed record
dwOSVersionInfoSize: DWORD;
dwMajorVersion: DWORD;
dwMinorVersion: DWORD;
dwBuildNumber: DWORD;
dwPlatformId: DWORD;
szCSDVersion: array [0. 127] of AnsiChar;
wServicePackMajor: WORD;
wServicePackMinor: WORD;
wSuiteMask: WORD;
wProductType: Byte;
wReserved: Byte;
end;

because Delphi5 does not know that such TOSVersionInfoEx.
To rewrite function GetVersionEx

function GetVersionEx (var lpVersionInformationEx: TOSVERSIONINFOEX): BOOL; stdcall; overload;
external kernel32 name ' GetVersionExA ';

because Delphi5 and for GetVersionEx (as well as for GetVersion), uses TOSVersionInfo, and instead of nonexistent at it TOSVersionInfoEx.
Here actually and a question: Can there is a simple method as in one line to receive wSuiteMask not to create all infrastructure for operation with TOSVersionInfoEx.
P.S. wSuiteMask to me it is necessary only for determination that at me Windows Home Server.

2

Re: Obtaining wSuiteMask from GetVersionEx

InterSky wrote:

Can there is a simple method

It it also is.

3

Re: Obtaining wSuiteMask from GetVersionEx

InterSky, you use the mechanism (Delphi 5), to which more than 20 years. Therefore for implementation of this  it is necessary to add missing structures hands. Or to use the modern mechanism (modern Delphi).

4

Re: Obtaining wSuiteMask from GetVersionEx

goldmi45 wrote:

Therefore for implementation of this  it is necessary to add missing structures hands

I would look in Jedi Windows API Library and Jedi Code Library
I assume, there it is already written
Whether but here it is supported D5 till now at least in JCL - a question.
However, for the declaration of types of distinction D7 and D5 are insignificant