Home > Back-end >  XE8 win10 captured by the VerifyVersionInfo system version number prompt error
XE8 win10 captured by the VerifyVersionInfo system version number prompt error

Time:09-26

Microsoft expressly fail under win10 GetVersionEx, forced to switch to VerifyVersionInfo the egg painful function compares,
But write no matter how to compile the code, however, who is a great god can help me to modify or point where there is a problem, thank you!

Var
VsInfo: TOSVersionInfoEx;
Bl: Boolean;
DwlConditionMask: DWORDLONG;
The begin
FillChar (VsInfo, SizeOf (TOSVersionInfoEx), 0).
VsInfo. DwOSVersionInfoSize:=SizeOf (TOSVersionInfoEx);
VSInfo. DwMajorVersion:=10;
VSInfo. DwMinorVersion:=0;
DwlConditionMask:=0;
VerSetConditionMask (dwlConditionMask VER_MAJORVERSION, VER_GREATER_EQUAL);
VerSetConditionMask (dwlConditionMask VER_MINORVERSION, VER_GREATER_EQUAL);
Bl:=VerifyVersionInfo (TOSVersionInfoEx (Addr (VsInfo) ^), VER_MAJORVERSION and VER_MINORVERSION, dwlConditionMask);/* [dcc32 Error] APubUnit. Pas (852) : E2033 Types of actual and formal var parameters must be identical */
If bl then
Result:='Win10';
The end;

CodePudding user response:

Find the problem, must use TOSVersionInfoExW (Addr (VsInfo) ^, window declaration is the same, but in

Winapi. Windows

TOSVersionInfoExW=_OSVERSIONINFOEXW;
TOSVersionInfoEx=TOSVersionInfoExW;

CodePudding user response:

You can use the NTDLL RtlGetVersion,
GetVersionEx didn't fail, it returns under win10 6.2, very aptly illustrates the nature of the win10 (Windows 7 is 6.1),

CodePudding user response:

Unfortunately, the VerifyVersionInfo also not line, it seems that really can only use RtlGetVerSion

CodePudding user response:

Add a compatibility in application manifest is ok, see: https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241%28v=vs.85%29.aspx? F=255 & amp; MSPPError=- 2147217396
Looks like ms core is to want to make a distinction between core and product versions,

CodePudding user response:

Win10 ah

CodePudding user response:

It returns under win10 6.2
Win10 properties (Windows 7 is 6.1)
Not very big difference?

CodePudding user response:

The core difference is small, the differences between 7 and doing/8.1/10 is the difference between and win2000 winxp,

CodePudding user response:

Pick up points tieba
  • Related