Windows: Fix detection of Windows 10 when manifest declares support
authorAxel Gembe <derago@gmail.com>
Sat, 3 Aug 2019 02:15:41 +0000 (09:15 +0700)
committerNathan Hjelm <hjelmn@google.com>
Fri, 9 Aug 2019 16:09:36 +0000 (09:09 -0700)
On Windows 10 GetVersionEx will return version 10.0 when the running
application has a manifest that declares Windows 10 compatibility.

https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests#supportedOS

When no such manifest is found, the call will report version 6.2,
which is Windows 8.

The 6.4 version is returned by early Windows 10 Insider Previews
and Windows Server 2017 Technical Preview 1.

Closes #604

Signed-off-by: Axel Gembe <derago@gmail.com>
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/os/windows_nt_common.c
libusb/version_nano.h

index 7ead83d..54338a7 100644 (file)
@@ -470,7 +470,8 @@ static void get_windows_version(void)
        case 0x61: windows_version = WINDOWS_7;     w = (ws ? "7" : "2008_R2");   break;
        case 0x62: windows_version = WINDOWS_8;     w = (ws ? "8" : "2012");      break;
        case 0x63: windows_version = WINDOWS_8_1;   w = (ws ? "8.1" : "2012_R2"); break;
-       case 0x64: windows_version = WINDOWS_10;    w = (ws ? "10" : "2016");     break;
+       case 0x64: // Early Windows 10 Insider Previews and Windows Server 2017 Technical Preview 1 used version 6.4
+       case 0xA0: windows_version = WINDOWS_10;    w = (ws ? "10" : "2016");     break;
        default:
                if (version < 0x50) {
                        return;
index ba8b13c..5469eb2 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11379
+#define LIBUSB_NANO 11380