List Info

Thread: IsWinXPSP2OrLater should be fixed...




IsWinXPSP2OrLater should be fixed...
user name
2006-10-15 11:13:59

I recommend changing the top of IsWinXPSP2OrLater to dynamic binding, so
projects using EWB could be run on win98 system.
static binding for both VerifyVersionInfo and VerSetConditionMask, must
also be removed for this to work.

Regards,
Miha

function IsWinXPSP2OrLater(): Boolean;
var
osvi: TOSVersionInfoEx;
dwlConditionMask: LONGLONG;
op: Integer;
handle: Integer;
VerifyVersionInfo: function(var VersionInformation: OSVERSIONINFOEX;
dwTypeMask: DWORD; dwlConditionMask: LONGLONG): BOOL; stdcall;
VerSetConditionMask: function (ConditionMask: LONGLONG;
TypeMask: DWORD; Condition: Byte): LONGLONG; stdcall;

begin
Result := False;
VerifyVersionInfo := nil;
VerSetConditionMask := nil;
handle := GetModuleHandle('kernel32.dll');
if handle <> 0 then begin
VerifyVersionInfo := GetProcAddress(handle, 'VerifyVersionInfoA');
VerSetConditionMask := GetProcAddress(handle,
'VerSetConditionMask');
end;

if (not Assigned(VerifyVersionInfo)) or (not
Assigned(VerSetConditionMask)) then
Exit;

dwlConditionMask := 0;
op := VER_GREATER_EQUAL;

// Initialize the OSVERSIONINFOEX structure.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )