Fix typo: use dwMinorVersion instead of dwMajorVersion in Windows 8 version check#176
Open
keymaker-arch wants to merge 1 commit intoOpenVPN:masterfrom
Open
Fix typo: use dwMinorVersion instead of dwMajorVersion in Windows 8 version check#176keymaker-arch wants to merge 1 commit intoOpenVPN:masterfrom
keymaker-arch wants to merge 1 commit intoOpenVPN:masterfrom
Conversation
…version check In DriverEntry, the code intended to check for Windows 8/Server 2012 (version 6.2) by setting dwMajorVersion=6 and dwMinorVersion=2. However, dwMajorVersion was assigned twice, leaving dwMinorVersion uninitialized (zero). This caused the version check to compare against 6.0 (Windows Vista/Server 2008) instead of 6.2. Fix the second assignment to correctly use osInfo.dwMinorVersion = 2.
Contributor
|
From a first glance this looks like a real bug, thanks for the report. I'm not sure this has any real consequences since we do not really support anything older than Win10 anymore... ;-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Description
In
DriverEntry()(src/tapdrvr.c, line 236), the code intends to check whether the OS is Windows 8 / Server 2012 or later (version 6.2) to setGlobalData.RunningWindows8OrGreater. However,dwMajorVersionis assigned twice:This leaves
dwMinorVersionat its default value (0), so the check effectively compares against version 6.0 (Windows Vista / Server 2008) instead of 6.2.Fix
Change the second assignment to
osInfo.dwMinorVersion = 2:Impact
Without this fix,
RunningWindows8OrGreateris set toTRUEon Windows Vista and later, rather than specifically Windows 8 and later. This affects theMmGetSystemAddressForMdlSafeflag behavior described in the surrounding comments.