diff options
author | Tormod Volden <debian.tormod@gmail.com> | 2022-02-09 12:35:17 +0100 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2022-03-18 19:09:06 +0100 |
commit | 0d880bf47a7381613bdca42b05741433fecedbaf (patch) | |
tree | fa9ff5a23c548ccd8bfea9b06b5a364eab4787a5 | |
parent | d6253e94a36d6eeac163268bc4386d1d092e5160 (diff) | |
download | libusb-0d880bf47a7381613bdca42b05741433fecedbaf.tar.gz |
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>
-rw-r--r-- | libusb/os/windows_common.c | 5 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 5 insertions, 2 deletions
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 @@ static enum windows_version get_windows_version(void) 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 |