Skip to content

Commit

Permalink
[arm64] add support for libusb0 on arm64
Browse files Browse the repository at this point in the history
* Closes #314.
  • Loading branch information
dontech authored and pbatard committed Jun 13, 2024
1 parent 6e8214c commit 63dbca8
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 16 deletions.
8 changes: 4 additions & 4 deletions examples/wdi-simple.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,5,0,786
PRODUCTVERSION 1,5,0,786
FILEVERSION 1,5,0,787
PRODUCTVERSION 1,5,0,787
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -25,13 +25,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "WDI-Simple"
VALUE "FileVersion", "1.5.0.786"
VALUE "FileVersion", "1.5.0.787"
VALUE "InternalName", "WDI-Simple"
VALUE "LegalCopyright", "� 2010-2023 Pete Batard (LGPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/lesser.html"
VALUE "OriginalFilename", "wdi-simple.exe"
VALUE "ProductName", "WDI-Simple"
VALUE "ProductVersion", "1.5.0.786"
VALUE "ProductVersion", "1.5.0.787"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down
2 changes: 1 addition & 1 deletion examples/zadig.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#define FIELD_ORANGE RGB(255,240,200)
#define ARROW_GREEN RGB(92,228,65)
#define ARROW_ORANGE RGB(253,143,56)
#define APP_VERSION "Zadig 2.8.786"
#define APP_VERSION "Zadig 2.8.787"

// These are used to flag end users about the driver they are going to replace
enum driver_type {
Expand Down
8 changes: 4 additions & 4 deletions examples/zadig.rc
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,8,786,0
PRODUCTVERSION 2,8,786,0
FILEVERSION 2,8,787,0
PRODUCTVERSION 2,8,787,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -264,13 +264,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Zadig"
VALUE "FileVersion", "2.8.786"
VALUE "FileVersion", "2.8.787"
VALUE "InternalName", "Zadig"
VALUE "LegalCopyright", "� 2010-2023 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "zadig.exe"
VALUE "ProductName", "Zadig"
VALUE "ProductVersion", "2.8.786"
VALUE "ProductVersion", "2.8.787"
VALUE "Comments", "https://zadig.akeo.ie"
END
END
Expand Down
5 changes: 5 additions & 0 deletions libwdi/embedder_files.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ struct emb embeddable_fixed[] = {
{ 0, LIBUSB0_DIR "\\bin\\amd64\\libusb0.sys", "amd64" },
{ 0, LIBUSB0_DIR "\\bin\\amd64\\install-filter.exe", "amd64" },
# endif // OPT_M64
# if defined(OPT_ARM)
{ 0, LIBUSB0_DIR "\\bin\\arm64\\libusb0.dll", "arm64" },
{ 0, LIBUSB0_DIR "\\bin\\arm64\\libusb0.sys", "arm64" },
{ 0, LIBUSB0_DIR "\\bin\\arm64\\install-filter.exe", "arm64" },
# endif // OPT_ARM
{ 0, LIBUSB0_DIR "\\installer_license.txt", "license\\libusb0" },
#endif // LIBUSB0_DIR

Expand Down
19 changes: 17 additions & 2 deletions libwdi/libusb0.inf.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ HKR,,,0,"libusb-win32 devices"
HKR,,Icon,,-20

[Manufacturer]
%VendorName% = Devices, NT, NTAMD64
%VendorName% = Devices, NT, NTAMD64, NTARM64

;--------------------------------------------------------------------------
; libusb-win32 files
Expand All @@ -42,7 +42,10 @@ libusb0.sys = 1,amd64
libusb0.dll = 1,amd64
#LK_DLL# #LK_EQ_X64#
libusb0_x86.dll = 1,x86
#LK_X86_DLL# #LK_EQ_X86#

[SourceDisksFiles.arm64]
libusb0.sys = 1,arm64
libusb0.dll = 1,arm64

[DestinationDirs]
libusb_files_sys = 10,system32\drivers
Expand Down Expand Up @@ -73,6 +76,8 @@ CopyFiles = libusb_files_sys, libusb_files_dll_x86
[LIBUSB_WIN32_DEV.NTAMD64]
CopyFiles = libusb_files_sys, libusb_files_dll, libusb_files_dll_wow64

[LIBUSB_WIN32_DEV.NTARM64]
CopyFiles = libusb_files_sys, libusb_files_dll
[LIBUSB_WIN32_DEV.NT.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw
Expand All @@ -81,12 +86,19 @@ AddReg = libusb_add_reg_hw
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_WIN32_DEV.NTARM64.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_WIN32_DEV.NT.Services]
AddService = libusb0, 0x00000002, libusb_add_service

[LIBUSB_WIN32_DEV.NTAMD64.Services]
AddService = libusb0, 0x00000002, libusb_add_service

[LIBUSB_WIN32_DEV.NTARM64.Services]
AddService = libusb0, 0x00000002, libusb_add_service

; Older versions of this .inf file installed filter drivers. They are not
; needed any more and must be removed
[libusb_del_reg_hw]
Expand Down Expand Up @@ -129,3 +141,6 @@ ServiceBinary = %12%\libusb0.sys

[Devices.NTAMD64]
%DeviceName% = LIBUSB_WIN32_DEV.NTAMD64, USB\%DeviceID%

[Devices.NTARM64]
%DeviceName% = LIBUSB_WIN32_DEV.NTARM64, USB\%DeviceID%
2 changes: 1 addition & 1 deletion libwdi/libwdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ BOOL LIBWDI_API wdi_is_driver_supported(int driver_type, VS_FIXEDFILEINFO* drive
#endif
case WDI_LIBUSB0:
#if defined(LIBUSB0_DIR)
return (platform_arch == IMAGE_FILE_MACHINE_AMD64 || platform_arch == IMAGE_FILE_MACHINE_I386);
return (platform_arch == IMAGE_FILE_MACHINE_ARM64 || platform_arch == IMAGE_FILE_MACHINE_AMD64 || platform_arch == IMAGE_FILE_MACHINE_I386);
#else
return FALSE;
#endif
Expand Down
8 changes: 4 additions & 4 deletions libwdi/libwdi.rc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,5,0,786
PRODUCTVERSION 1,5,0,786
FILEVERSION 1,5,0,787
PRODUCTVERSION 1,5,0,787
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -68,13 +68,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "libwdi: Windows Driver Installer Library"
VALUE "FileVersion", "1.5.0.786"
VALUE "FileVersion", "1.5.0.787"
VALUE "InternalName", "libwdi"
VALUE "LegalCopyright", "� 2010-2023 Pete Batard (LGPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/lesser.html"
VALUE "OriginalFilename", "libwdi"
VALUE "ProductName", "libwdi"
VALUE "ProductVersion", "1.5.0.786"
VALUE "ProductVersion", "1.5.0.787"
VALUE "Comments", "http://libwdi.akeo.ie"
END
END
Expand Down

0 comments on commit 63dbca8

Please sign in to comment.