[Bug 40972] New: RtlVerifyVersionInfo returns wrong results

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jul 17 10:59:50 CDT 2016


https://bugs.winehq.org/show_bug.cgi?id=40972

            Bug ID: 40972
           Summary: RtlVerifyVersionInfo returns wrong results
           Product: Wine
           Version: 1.9.14
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ntdll
          Assignee: wine-bugs at winehq.org
          Reporter: marcinwiaz at poczta.onet.pl
      Distribution: ---

Created attachment 55126
  --> https://bugs.winehq.org/attachment.cgi?id=55126
Tiny test program - EXE and source

(Note: this a different problem than in Bug 36143)

Steps to reproduce:

1) Download and unpack Reproduce.exe, which is attached to this bug report
2) Configure Wine to emulate Windows 2003 (which has version number 5.2) for
Reproduce.exe
3) Launch Reproduce.exe - you will see in the console window:

CurrentOS is: 5.2
RequestedOS is >= than: 5.19
CurrentOS is < than RequestedOS (which is WRONG!)

4) Run true Microsoft Windows 2003 Server
5) Launch Reproduce.exe - you will see in the console window:

CurrentOS is: 5.2
RequestedOS is >= than: 5.19
CurrentOS is >= than RequestedOS



Explanation:
Minor version numbers should be treated similarly to digits after a decimal
point - so when comparing software versions:

version 5.1 is < than version 5.2
version 5.11 is < than version 5.2 (note that 11 is > than 2 !)
version 5.19 is < than version 5.2 (note that 19 is > than 2 !)



So when comparing for VER_MINORVERSION or VER_SERVICEPACKMINOR inside the
"VerifyVersionInfo" API, Microsoft uses a lexical comparison - which works as:

lstrcmp(tostring(dwMinorVersion1),tostring(dwMinorVersion2))
or 
lstrcmp(tostring(wServicePackMinor1),tostring(wServicePackMinor2))



Please note, that it's still different than comparing real numbers, because:

5.20 = 5.2
but
lstrcmp("5.20","5.2") != 0

So lstrcmp-like function must be used for VER_MINORVERSION and
VER_SERVICEPACKMINOR checking inside the "RtlVerifyVersionInfo" function (which
is called by the "VerifyVersionInfo" API in Wine) to be compatible with
Microsoft Windows.



Possible fix: in "version.c" file, add a new "version_compare_values_lexical"
function. It should be based on the original "version_compare_values" function,
but should use "lstrcmp" calls instead of integer comparisons. This
"version_compare_values_lexical" function should be called instead of
"version_compare_values" when checking for VER_MINORVERSION and
VER_SERVICEPACKMINOR inside the "RtlVerifyVersionInfo" function.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list