Skip to content

Commit

Permalink
Add ARM64 target by upgrading driver project to VS2022 and latest WDK…
Browse files Browse the repository at this point in the history
… + Upgrading to latest VS2022 toolset
  • Loading branch information
Sylvain Fasel committed Sep 21, 2023
1 parent 7318e61 commit 35315bf
Show file tree
Hide file tree
Showing 37 changed files with 5,112 additions and 5,306 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.user
*.filters
Debug/
Release/
Backup/
libusbK/package/
*.AssemblyReference.cache
Expand Down
414 changes: 207 additions & 207 deletions libusbK/examples/config-interface/config-interface.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/enum_descriptors/enum_descriptors.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/hot-plug-monitor/hot-plug-monitor.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/load-driver-api/load-driver-api.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/open-device/open-device.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/pipe-policy-other/pipe-policy-other.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/pipe-policy-timeout/pipe-policy-timeout.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/power-policy-suspend/power-policy-suspend.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/show-device/show-device.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/xfer-async-loop/xfer-async-loop.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/xfer-async/xfer-async.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/xfer-control-loop/xfer-control-loop.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/xfer-control/xfer-control.vcxproj

Large diffs are not rendered by default.

412 changes: 206 additions & 206 deletions libusbK/examples/xfer-iso-asap/xfer-iso-asap.vcxproj

Large diffs are not rendered by default.

412 changes: 206 additions & 206 deletions libusbK/examples/xfer-iso/xfer-iso.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/xfer-stream-loop/xfer-stream-loop.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/xfer-stream/xfer-stream.vcxproj

Large diffs are not rendered by default.

414 changes: 207 additions & 207 deletions libusbK/examples/xfer-sync/xfer-sync.vcxproj

Large diffs are not rendered by default.

Binary file modified libusbK/libusbK.sln
Binary file not shown.
414 changes: 207 additions & 207 deletions libusbK/src/dll/libusbK_dll.vcxproj

Large diffs are not rendered by default.

460 changes: 230 additions & 230 deletions libusbK/src/dpscat/dpscat.vcxproj

Large diffs are not rendered by default.

410 changes: 205 additions & 205 deletions libusbK/src/kBench/kBench.vcxproj

Large diffs are not rendered by default.

426 changes: 213 additions & 213 deletions libusbK/src/kList/kList.vcxproj

Large diffs are not rendered by default.

358 changes: 179 additions & 179 deletions libusbK/src/lib/libusbK_lib.vcxproj

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions libusbK/src/sys/Trace.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*++
Module Name:
Trace.h
Abstract:
Header file for the debug tracing related function defintions and macros.
Environment:
Kernel mode
--*/

//
// Define the tracing flags.
//
// Tracing GUID - d751eb99-2ce3-4f86-b9fe-54d8a391a330
//

#define WPP_CONTROL_GUIDS \
WPP_DEFINE_CONTROL_GUID( \
libusbKTraceGuid, (d751eb99,2ce3,4f86,b9fe,54d8a391a330), \
\
WPP_DEFINE_BIT(MYDRIVER_ALL_INFO) \
WPP_DEFINE_BIT(TRACE_DRIVER) \
WPP_DEFINE_BIT(TRACE_DEVICE) \
WPP_DEFINE_BIT(TRACE_QUEUE) \
)

#define WPP_FLAG_LEVEL_LOGGER(flag, level) \
WPP_LEVEL_LOGGER(flag)

#define WPP_FLAG_LEVEL_ENABLED(flag, level) \
(WPP_LEVEL_ENABLED(flag) && \
WPP_CONTROL(WPP_BIT_ ## flag).Level >= level)

#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) \
WPP_LEVEL_LOGGER(flags)

#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \
(WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)

//
// WPP orders static parameters before dynamic parameters. To support the Trace function
// defined below which sets FLAGS=MYDRIVER_ALL_INFO, a custom macro must be defined to
// reorder the arguments to what the .tpl configuration file expects.
//
#define WPP_RECORDER_FLAGS_LEVEL_ARGS(flags, lvl) WPP_RECORDER_LEVEL_FLAGS_ARGS(lvl, flags)
#define WPP_RECORDER_FLAGS_LEVEL_FILTER(flags, lvl) WPP_RECORDER_LEVEL_FLAGS_FILTER(lvl, flags)

//
// This comment block is scanned by the trace preprocessor to define our
// Trace function.
//
// begin_wpp config
// FUNC Trace{FLAGS=MYDRIVER_ALL_INFO}(LEVEL, MSG, ...);
// FUNC TraceEvents(LEVEL, FLAGS, MSG, ...);
// end_wpp
//
2 changes: 1 addition & 1 deletion libusbK/src/sys/drv_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ NTSTATUS Device_Configure(WDFDEVICE Device)
else
{
USBDBG("Using multiple interface configuration..\n");
settingPairs = ExAllocatePoolWithTag(
settingPairs = ExAllocatePool2(
PagedPool,
sizeof(WDF_USB_INTERFACE_SETTING_PAIR) * deviceContext->InterfaceCount,
POOL_TAG);
Expand Down
7 changes: 4 additions & 3 deletions libusbK/src/sys/drv_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Return Value:
{
WDF_DRIVER_CONFIG config;
NTSTATUS status;

#ifdef DEBUG
DbgPrint("[%s](%s) v%s built-on: %s %s\n", __FUNCTION__, RC_FILENAME_STR, RC_VERSION_STR, __DATE__, __TIME__);

#endif
//
// Initiialize driver config to control the attributes that
// are global to the driver. Note that framework by default
Expand Down Expand Up @@ -105,6 +105,7 @@ VOID DriverExit(__in WDFDRIVER Driver)
UNREFERENCED_PARAMETER(Driver);

PAGED_CODE();

#ifdef DEBUG
DbgPrint("[%s](%s) v%s built-on: %s %s\n", __FUNCTION__, RC_FILENAME_STR, RC_VERSION_STR, __DATE__, __TIME__);
#endif
}
6 changes: 1 addition & 5 deletions libusbK/src/sys/drv_lusbk_rc.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <windows.h>

#include "lusbk_version.h"

#define VER_COMPANYNAME_STR "http://libusb-win32.sourceforge.net"
Expand All @@ -16,6 +14,4 @@
#define VER_FILESUBTYPE VFT2_DRV_SYSTEM
#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#define VER_FILEOS VOS_NT_WINDOWS32
#define VER_FILEFLAGS (0)

#include "common.ver"
#define VER_FILEFLAGS (0)
16 changes: 2 additions & 14 deletions libusbK/src/sys/drv_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ VOID Pipe_InitQueueConfig(
__in PPIPE_CONTEXT pipeContext,
__out WDF_IO_QUEUE_CONFIG* queueConfig)
{
WDF_DRIVER_VERSION_AVAILABLE_PARAMS verParams;

if (!pipeContext->Pipe)
{
// Default (Control) pipe
Expand All @@ -258,21 +256,11 @@ VOID Pipe_InitQueueConfig(
In libusbK, RawIO means we use a parallel queue. Any pipe policies or functionality
that could cause multiple IO transactions per request are no longer supported. IE:
Transfer splitting, ALLOW_ARTIAL_READS, AUTO_FLUSH, IGNORE_SHORT_PACKETS, SHORT_PACKET_TERMINATE.
Transfer splitting, ALLOW_PARTIAL_READS, AUTO_FLUSH, IGNORE_SHORT_PACKETS, SHORT_PACKET_TERMINATE.
*/

WDF_DRIVER_VERSION_AVAILABLE_PARAMS_INIT(&verParams, KMDF_MAJOR_VERSION, KMDF_MINOR_VERSION);
if (WdfDriverIsVersionAvailable(gWdfDriver, &verParams))
{
# if ((KMDF_MAJOR_VERSION==1 && KMDF_MINOR_VERSION >= 9) || (KMDF_MAJOR_VERSION > 1))
if (pipeContext->SimulParallelRequests)
if (pipeContext->SimulParallelRequests)
queueConfig->Settings.Parallel.NumberOfPresentedRequests = pipeContext->SimulParallelRequests;
# endif
}
else
{
DbgPrint("Expected library version %u.%u!\n",KMDF_MAJOR_VERSION, KMDF_MINOR_VERSION);
}
}
else
{
Expand Down
88 changes: 88 additions & 0 deletions libusbK/src/sys/libusbK.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
;
; libusbK.inf
;

[Version]
Signature="$WINDOWS NT$"
Class=USBDevice
ClassGuid={88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider=%ManufacturerName%
CatalogFile=libusbK.cat
DriverVer=
PnpLockDown=1

[DestinationDirs]
DefaultDestDir = 12
libusbK_Device_CoInstaller_CopyFiles = 11

[SourceDisksNames]
1 = %DiskName%,,,""

[SourceDisksFiles]
libusbK.sys = 1,,
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1 ; make sure the number matches with SourceDisksNames

;*****************************************
; Install Section
;*****************************************

[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$

[Standard.NT$ARCH$]
%libusbK.DeviceDesc%=libusbK_Device, USB\VID_1500&PID_0008

[libusbK_Device.NT]
CopyFiles=Drivers_Dir

[Drivers_Dir]
libusbK.sys

[libusbK_Device.NT.HW]
AddReg=libusbK_AddReg

[libusbK_AddReg]
; By default, USBDevice class uses iProduct descriptor to name the device in
; Device Manager on Windows 8 and higher.
; Uncomment for this device to use %DeviceName% on Windows 8 and higher:
;HKR,,FriendlyName,,%libusbK.DeviceDesc%

;-------------- Service installation
[libusbK_Device.NT.Services]
AddService = libusbK,%SPSVCINST_ASSOCSERVICE%, libusbK_Service_Inst

; -------------- libusbK driver install sections
[libusbK_Service_Inst]
DisplayName = %libusbK.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\libusbK.sys

;
;--- libusbK_Device Coinstaller installation ------
;

[libusbK_Device.NT.CoInstallers]
AddReg=libusbK_Device_CoInstaller_AddReg
CopyFiles=libusbK_Device_CoInstaller_CopyFiles

[libusbK_Device_CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"

[libusbK_Device_CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll

[libusbK_Device.NT.Wdf]
KmdfService = libusbK, libusbK_wdfsect
[libusbK_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName="Ellisys" ;TODO: Replace with your manufacturer name
ClassName="Universal Serial Bus devices"
DiskName = "libusbK Installation Disk"
libusbK.DeviceDesc = "libusbK Device"
libusbK.SVCDESC = "libusbK Service"
REG_MULTI_SZ = 0x00010000
Loading

0 comments on commit 35315bf

Please sign in to comment.