windows: Discern Windows 11 (if manifest allows)
Pre-releases of Windows 11 had build numbers from 20000.
Thanks to Pete Batard for extensive explanation.
Fixes #1021
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
diff --git a/libusb/os/windows_common.c b/libusb/os/windows_common.c
index e3d93cb..d956bd9 100644
--- a/libusb/os/windows_common.c
+++ b/libusb/os/windows_common.c
@@ -390,7 +390,10 @@
case 0x62: winver = WINDOWS_8; w = (ws ? "8" : "2012"); break;
case 0x63: winver = WINDOWS_8_1; w = (ws ? "8.1" : "2012_R2"); break;
case 0x64: // Early Windows 10 Insider Previews and Windows Server 2017 Technical Preview 1 used version 6.4
- case 0xA0: winver = WINDOWS_10; w = (ws ? "10" : "2016"); break;
+ case 0xA0: winver = WINDOWS_10; w = (ws ? "10" : "2016");
+ if (vi.dwBuildNumber < 20000)
+ break;
+ // fallthrough
case 0xB0: winver = WINDOWS_11; w = (ws ? "11" : "2022"); break;
default:
if (version < 0x50)
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 375e693..710fa8e 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11704
+#define LIBUSB_NANO 11705