Skip to content

Commit aeacb8b

Browse files
committed
[misc] fix version detection for Windows 10
* Also set Zadig next to 2.1.2 * Also fix minor issues/typos and update VID list
1 parent 55a9653 commit aeacb8b

File tree

12 files changed

+106
-30
lines changed

12 files changed

+106
-30
lines changed

examples/common_controls_and_elevation.manifest

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,22 @@
2121
</requestedPrivileges>
2222
</security>
2323
</trustInfo>
24+
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
25+
<!-- If you don't have those in your app, Windows 10's GetVersionEx() -->
26+
<!-- DELIBERATELY reports the WRONG version... which brings us to -->
27+
<!-- tonight's spelling bee: "How do you spell 'spineless morons'?" -->
28+
<!-- The answer: "M-I-C-R-O-S-O-F-T; 'spineless morons'!" -->
29+
<application>
30+
<!-- Windows 10 -->
31+
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
32+
<!-- Windows 8.1 -->
33+
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
34+
<!-- Windows 8 -->
35+
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
36+
<!-- Windows 7 -->
37+
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
38+
<!-- Windows Vista -->
39+
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
40+
</application>
41+
</compatibility>
2442
</assembly>

examples/wdi-simple.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#endif
88

99
VS_VERSION_INFO VERSIONINFO
10-
FILEVERSION 1,2,4,676
11-
PRODUCTVERSION 1,2,4,676
10+
FILEVERSION 1,2,4,677
11+
PRODUCTVERSION 1,2,4,677
1212
FILEFLAGSMASK 0x17L
1313
#ifdef _DEBUG
1414
FILEFLAGS 0x1L
@@ -25,13 +25,13 @@ BEGIN
2525
BEGIN
2626
VALUE "CompanyName", "akeo.ie"
2727
VALUE "FileDescription", "WDI-Simple"
28-
VALUE "FileVersion", "1.2.4.676"
28+
VALUE "FileVersion", "1.2.4.677"
2929
VALUE "InternalName", "WDI-Simple"
3030
VALUE "LegalCopyright", "� 2010-2014 Pete Batard (LGPL v3)"
3131
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/lesser.html"
3232
VALUE "OriginalFilename", "wdi-simple.exe"
3333
VALUE "ProductName", "WDI-Simple"
34-
VALUE "ProductVersion", "1.2.4.676"
34+
VALUE "ProductVersion", "1.2.4.677"
3535
VALUE "Comments", "http://libwdi.akeo.ie"
3636
END
3737
END

examples/zadic.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ END
5656
//
5757

5858
VS_VERSION_INFO VERSIONINFO
59-
FILEVERSION 1,2,4,676
60-
PRODUCTVERSION 1,2,4,676
59+
FILEVERSION 1,2,4,677
60+
PRODUCTVERSION 1,2,4,677
6161
FILEFLAGSMASK 0x17L
6262
#ifdef _DEBUG
6363
FILEFLAGS 0x1L
@@ -74,13 +74,13 @@ BEGIN
7474
BEGIN
7575
VALUE "CompanyName", "akeo.ie"
7676
VALUE "FileDescription", "Zadic"
77-
VALUE "FileVersion", "1.2.4.676"
77+
VALUE "FileVersion", "1.2.4.677"
7878
VALUE "InternalName", "Zadic"
7979
VALUE "LegalCopyright", "� 2010-2014 Pete Batard (LGPL v3)"
8080
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/lesser.html"
8181
VALUE "OriginalFilename", "zadic.exe"
8282
VALUE "ProductName", "Zadic"
83-
VALUE "ProductVersion", "1.2.4.676"
83+
VALUE "ProductVersion", "1.2.4.677"
8484
VALUE "Comments", "http://libwdi.akeo.ie"
8585
END
8686
END

examples/zadig.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,6 @@ static const char* PrintWindowsVersion(void)
881881
ws = (vi.wProductType <= VER_NT_WORKSTATION);
882882
nWindowsVersion = vi.dwMajorVersion << 4 | vi.dwMinorVersion;
883883
switch (nWindowsVersion) {
884-
case 0x50: w = "2000";
885-
break;
886884
case 0x51: w = "XP";
887885
break;
888886
case 0x52: w = (!GetSystemMetrics(89)?"2003":"2003_R2");
@@ -895,10 +893,13 @@ static const char* PrintWindowsVersion(void)
895893
break;
896894
case 0x63: w = (ws?"8.1":"2012_R2");
897895
break;
898-
case 0x64: w = (ws?"10":"2015");
896+
case 0x64: w = (ws?"10 (Preview 1)":"Server 10 (Preview 1)");
897+
break;
898+
// Starting with Windows 10 Preview 2, the major is the same as the public-facing version
899+
case 0xA0: w = (ws?"10":"Server 10");
899900
break;
900901
default:
901-
if (nWindowsVersion < 0x50)
902+
if (nWindowsVersion < 0x51)
902903
nWindowsVersion = WINDOWS_UNSUPPORTED;
903904
else
904905
w = "11 or later";

examples/zadig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#define FIELD_ORANGE RGB(255,240,200)
6060
#define ARROW_GREEN RGB(92,228,65)
6161
#define ARROW_ORANGE RGB(253,143,56)
62-
#define APP_VERSION "Zadig 2.1.1.676"
62+
#define APP_VERSION "Zadig 2.1.2.677"
6363

6464
// These are used to flag end users about the driver they are going to replace
6565
enum driver_type {

examples/zadig.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ END
248248
//
249249

250250
VS_VERSION_INFO VERSIONINFO
251-
FILEVERSION 2,1,1,676
252-
PRODUCTVERSION 2,1,1,676
251+
FILEVERSION 2,1,2,677
252+
PRODUCTVERSION 2,1,2,677
253253
FILEFLAGSMASK 0x17L
254254
#ifdef _DEBUG
255255
FILEFLAGS 0x1L
@@ -266,13 +266,13 @@ BEGIN
266266
BEGIN
267267
VALUE "CompanyName", "akeo.ie"
268268
VALUE "FileDescription", "Zadig"
269-
VALUE "FileVersion", "2.1.1.676"
269+
VALUE "FileVersion", "2.1.2.677"
270270
VALUE "InternalName", "Zadig"
271271
VALUE "LegalCopyright", "� 2010-2014 Pete Batard (GPL v3)"
272272
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
273273
VALUE "OriginalFilename", "zadig.exe"
274274
VALUE "ProductName", "Zadig"
275-
VALUE "ProductVersion", "2.1.1.676"
275+
VALUE "ProductVersion", "2.1.2.677"
276276
VALUE "Comments", "http://libwdi.akeo.ie"
277277
END
278278
END

examples/zadig_README.creole

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
=== v2.1.2 (2015.04.30) ===
2+
* Fix freezout when listing all devices on some systems
3+
* Update version detection for Windows 10
4+
* Embedded drivers: WinUSB v6.1.7600.16385, libusb-win32 v1.2.6.0 & libusbK v3.0.7.0
5+
16
=== v2.1.1 (2014.11.30) ===
27
* Fix a possible crash when listing devices
38
* Set logging to debug by default

examples/zadig_net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
534534

535535
dwSize = sizeof(mime);
536536
HttpQueryInfoA(hRequest, HTTP_QUERY_CONTENT_TYPE, (LPVOID)&mime, &dwSize, NULL);
537-
if (strcmp(mime, "text/plain") != 0)
537+
if (strncmp(mime, "text/plain", sizeof("text/plain")-1) != 0)
538538
goto out;
539539

540540
// We also get a date from Apache, which we'll use to avoid out of sync check,

examples/zadig_stdlg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ int detect_windows_version(void)
190190
if (vi.dwMajorVersion > 6 || (vi.dwMajorVersion == 6 && vi.dwMinorVersion >= 2)) {
191191
// Starting with Windows 8.1 Preview, GetVersionEx() does no longer report the actual OS version
192192
// See: http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx
193+
// And starting with Windows 10 Preview 2, Windows enforces the use of the application/supportedOS
194+
// manifest in order for VerSetConditionMask() to report the ACTUAL OS major and minor...
193195

194196
major_equal = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL);
195197
for (major = vi.dwMajorVersion; major <= 9; major++) {

libwdi/installer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void __cdecl syslog_reader_thread(void* param)
454454
goto out;
455455
}
456456

457-
plog("sylog reader thread started");
457+
plog("syslog reader thread started");
458458
SetEvent(syslog_ready_event);
459459
processed_size = 0;
460460

0 commit comments

Comments
 (0)