Skip to content

Commit c0c4664

Browse files
committed
[core] fix DLL build
* Closes pbatard#238
1 parent d670251 commit c0c4664

File tree

6 files changed

+26
-21
lines changed

6 files changed

+26
-21
lines changed

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,4,1,765
11-
PRODUCTVERSION 1,4,1,765
10+
FILEVERSION 1,4,1,768
11+
PRODUCTVERSION 1,4,1,768
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.4.1.765"
28+
VALUE "FileVersion", "1.4.1.768"
2929
VALUE "InternalName", "WDI-Simple"
3030
VALUE "LegalCopyright", "� 2010-2021 Pete Batard (LGPL v3)"
3131
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/lesser.html"
3232
VALUE "OriginalFilename", "wdi-simple.exe"
3333
VALUE "ProductName", "WDI-Simple"
34-
VALUE "ProductVersion", "1.4.1.765"
34+
VALUE "ProductVersion", "1.4.1.768"
3535
VALUE "Comments", "http://libwdi.akeo.ie"
3636
END
3737
END

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.7.765"
62+
#define APP_VERSION "Zadig 2.7.768"
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
@@ -246,8 +246,8 @@ END
246246
//
247247

248248
VS_VERSION_INFO VERSIONINFO
249-
FILEVERSION 2,7,765,0
250-
PRODUCTVERSION 2,7,765,0
249+
FILEVERSION 2,7,768,0
250+
PRODUCTVERSION 2,7,768,0
251251
FILEFLAGSMASK 0x17L
252252
#ifdef _DEBUG
253253
FILEFLAGS 0x1L
@@ -264,13 +264,13 @@ BEGIN
264264
BEGIN
265265
VALUE "CompanyName", "akeo.ie"
266266
VALUE "FileDescription", "Zadig"
267-
VALUE "FileVersion", "2.7.765"
267+
VALUE "FileVersion", "2.7.768"
268268
VALUE "InternalName", "Zadig"
269269
VALUE "LegalCopyright", "� 2010-2021 Pete Batard (GPL v3)"
270270
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
271271
VALUE "OriginalFilename", "zadig.exe"
272272
VALUE "ProductName", "Zadig"
273-
VALUE "ProductVersion", "2.7.765"
273+
VALUE "ProductVersion", "2.7.768"
274274
VALUE "Comments", "http://libwdi.akeo.ie"
275275
END
276276
END

libwdi/installer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Library for WinUSB/libusb automated driver installation
3-
* Copyright (c) 2010-2013 Pete Batard <[email protected]>
2+
* Library for USB automated driver installation
3+
* Copyright (c) 2010-2022 Pete Batard <[email protected]>
44
*
55
* This library is free software; you can redistribute it and/or
66
* modify it under the terms of the GNU Lesser General Public
@@ -689,7 +689,7 @@ BOOL disable_system_restore(BOOL enabled)
689689
LONG r;
690690
DWORD disp, regtype, val, val_size=sizeof(DWORD);
691691
HRESULT hr;
692-
IGroupPolicyObject* pLGPO;
692+
IGroupPolicyObject* pLGPO = NULL;
693693
static DWORD original_val = -1; // -1 = key doesn't exist
694694
HKEY machine_key = NULL, disable_system_restore_key = NULL;
695695
// MSVC is finicky about these ones => redefine them

libwdi/libwdi.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,8 @@ static long wdi_tokenize_file(const char* src, char** dst, const token_entity_t*
11941194
int LIBWDI_API wdi_prepare_driver(struct wdi_device_info* device_info, const char* path,
11951195
const char* inf, struct wdi_options_prepare_driver* options)
11961196
{
1197+
PF_DECL_LIBRARY(Ntdll);
1198+
PF_TYPE_DECL(NTAPI, NTSTATUS, NtQuerySystemInformation, (SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG));
11971199
const wchar_t bom = 0xFEFF;
11981200
#if defined(ENABLE_DEBUG_LOGGING) || defined(INCLUDE_DEBUG_LOGGING)
11991201
const char* driver_display_name[WDI_NB_DRIVERS] = { "WinUSB", "libusb0.sys", "libusbK.sys", "Generic USB CDC", "user driver" };
@@ -1498,10 +1500,13 @@ int LIBWDI_API wdi_prepare_driver(struct wdi_device_info* device_info, const cha
14981500

14991501
// Check if testsigning is enabled
15001502
// https://social.msdn.microsoft.com/Forums/Windowsapps/en-US/e6c1be93-7003-4594-b8e4-18ab4a75d273/detecting-testsigning-onoff-via-api
1501-
sci.Length = sizeof(sci);
1502-
if (NtQuerySystemInformation((SYSTEM_INFORMATION_CLASS)0x67, &sci, sizeof(sci), &dwcbSz) >= 0 && dwcbSz == sizeof(sci))
1503-
is_test_signing_enabled = !!(sci.CodeIntegrityOptions & 0x02);
1504-
wdi_info("Test signing is: %s", is_test_signing_enabled ? "Enabled" : "Disabled");
1503+
PF_INIT(NtQuerySystemInformation, Ntdll);
1504+
if (pfNtQuerySystemInformation != NULL) {
1505+
sci.Length = sizeof(sci);
1506+
if (pfNtQuerySystemInformation((SYSTEM_INFORMATION_CLASS)0x67, &sci, sizeof(sci), &dwcbSz) >= 0 && dwcbSz == sizeof(sci))
1507+
is_test_signing_enabled = !!(sci.CodeIntegrityOptions & 0x02);
1508+
wdi_info("Test signing is: %s", is_test_signing_enabled ? "Enabled" : "Disabled");
1509+
}
15051510

15061511
// Failures on the following are fatal on Windows 10 when test signing is not enabled
15071512
if (!CreateCat(cat_path, hw_id, drv_path, cat_list, nb_entries)) {

libwdi/libwdi.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ END
5050
//
5151

5252
VS_VERSION_INFO VERSIONINFO
53-
FILEVERSION 1,4,1,765
54-
PRODUCTVERSION 1,4,1,765
53+
FILEVERSION 1,4,1,768
54+
PRODUCTVERSION 1,4,1,768
5555
FILEFLAGSMASK 0x17L
5656
#ifdef _DEBUG
5757
FILEFLAGS 0x1L
@@ -68,13 +68,13 @@ BEGIN
6868
BEGIN
6969
VALUE "CompanyName", "akeo.ie"
7070
VALUE "FileDescription", "libwdi: Windows Driver Installer Library"
71-
VALUE "FileVersion", "1.4.1.765"
71+
VALUE "FileVersion", "1.4.1.768"
7272
VALUE "InternalName", "libwdi"
73-
VALUE "LegalCopyright", "� 2010-2021 Pete Batard (LGPL v3)"
73+
VALUE "LegalCopyright", "� 2010-2022 Pete Batard (LGPL v3)"
7474
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/lesser.html"
7575
VALUE "OriginalFilename", "libwdi"
7676
VALUE "ProductName", "libwdi"
77-
VALUE "ProductVersion", "1.4.1.765"
77+
VALUE "ProductVersion", "1.4.1.768"
7878
VALUE "Comments", "http://libwdi.akeo.ie"
7979
END
8080
END

0 commit comments

Comments
 (0)