Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM64 target to all projects, upgrade driver project to VS2022 and latest WDK for x64 and ARM64 build + minor corrections (typos) + Upgrading to latest VS2022 toolset for all projects #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sonatique
Copy link

@sonatique sonatique commented Sep 21, 2023

With this upgrade I was able to build libusbK.sys from ARM64 easily. Ongoing test on Windows ARM seems to indicate everything is working seamlessly

Note: support for building with makefile is sill there, but I did not upgrade it for building for ARM64.
Building libusbK.sys for ARM64 / X64 is now directly done from within Visual Studio (current libusbK.sys project is only there for convenience when editing files, the actual build process is based on makefile

@mcuee
Copy link
Owner

mcuee commented Sep 21, 2023

@TravisRo

Hi Travis, this seems to be a nice feature to add for libusbK. Please help to review when you got some time. Thanks.

@sonatique sonatique force-pushed the Wdk2022-Sys-Project branch 2 times, most recently from 44d1229 to 390c42e Compare September 21, 2023 13:11
@TravisRo
Copy link
Collaborator

Great! Thanks for the contribution. I will ask if I can sign this with my work certificate.

@tormodvolden
Copy link
Contributor

Is the addition of the .inf file intentional? It was not mentioned in the commit message.

@sonatique
Copy link
Author

Is the addition of the .inf file intentional? It was not mentioned in the commit message.

This file was generated by the KDMF template project, and is used by the last step when building the project to create a nice inf + car + sys folder ready to use for testing or for production given the correct signing key was specified in the project properties.

I am sure we could do without it but I thought it was a convenient way to have a example / template inf file that people could directly complete with their VID/PID and produce a driver package.

@tormodvolden
Copy link
Contributor

Thanks. Yes it seems interesting and useful, that's why I got curious about it. That it was generated from the project data answers my question.

@sonatique sonatique changed the title ARM64 driver: Upgrade driver project to VS2022 and latest WDK + Upgrade to latest VS 2022 toolset ARM64 driver: Upgrade driver project to VS2022 and latest WDK + minor (typos) corrections + Upgrade to latest VS 2022 toolset Sep 22, 2023
@mcuee
Copy link
Owner

mcuee commented Sep 25, 2023

As of now the projects files may not be totally correct for ARM64 build.

Example: ARM64 build --> libusbK.sys is for ARM64 but not for other projects.

Rebuild started...
1>------ Rebuild All started: Project: dpscat, Configuration: Release x64 ------
2>------ Rebuild All started: Project: libusbK (sys\libusbK), Configuration: Release ARM64 ------
3>------ Rebuild All started: Project: libusbK (dll\libusbK), Configuration: Release x64 ------
4>------ Rebuild All started: Project: libusbK (lib\libusbK), Configuration: Release x64 ------
1>lusbk_debug_view_output.c
3>lusbk_bknd_libusb0.c
4>lusbk_bknd_libusb0.c
2>Building 'libusbK' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform.
2>Stamping ARM64\Release\libusbK.inf
1>difx_dyn.c
3>lusbk_bknd_libusbk.c
2>Stamping [Version] section with DriverVer=09/25/2023,22.11.41.651
4>lusbk_bknd_libusbk.c
3>lusbk_bknd_unsupported.c
1>dpscat.c
4>lusbk_bknd_unsupported.c
3>lusbk_bknd_winusb.c
4>lusbk_bknd_winusb.c
1>inf_parser.c
2>drv_device.c
3>lusbk_debug_view_output.c
4>lusbk_debug_view_output.c
1>pki.c
2>drv_driver.c
3>lusbk_device_list.c
4>lusbk_device_list.c
2>drv_general.c
2>drv_interface.c
3>lusbk_handles.c
4>lusbk_handles.c
2>drv_pipe.c
1>Generating code
1>Previous IPDB not found, fall back to full compilation.
3>lusbk_hot_plug.c
1>All 28 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
1>Finished generating code
4>lusbk_hot_plug.c
2>drv_policy.c
1>dpscat.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\bin\Release\dpscat\x64\dpscat.exe
3>lusbk_ioctl.c
2>drv_queue_default.c
4>lusbk_ioctl.c
2>drv_queue_pipe.c
3>lusbk_overlapped.c
4>lusbk_overlapped.c
2>drv_registry.c
3>lusbk_queued_stream.c
4>lusbk_queued_stream.c
2>drv_request.c
2>drv_xfer_bulk.c
3>lusbk_stack_collection.c
4>lusbk_stack_collection.c
2>drv_xfer_control.c
3>lusbk_usb.c
4>lusbk_usb.c
2>drv_xfer_iso.c
4>lusbk_usb_iso.c
3>lusbk_usb_iso.c
2>drv_xfer_simple.c
4>lusbk_usb_isoch.c
3>lusbk_usb_isoch.c
4>lusbk_wrapper_winusb.c
3>lusbk_wrapper_winusb.c
2>Generating code
3>lusbk_dllmain.c
4>libusbK_lib.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\bin\lib\x64\Release\libusbK.lib
3>   Creating library C:\work\libusb\libusbK_vs2022\libusbK\bin\dll\x64\Release\libusbK.lib and object C:\work\libusb\libusbK_vs2022\libusbK\bin\dll\x64\Release\libusbK.exp
3>Generating code
3>Previous IPDB not found, fall back to full compilation.
2>Finished generating code
2>libusbK_sys.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\ARM64\Release\libusbK.sys
5>------ Rebuild All started: Project: xfer-iso-asap, Configuration: Release x64 ------
6>------ Rebuild All started: Project: xfer-control-loop, Configuration: Release x64 ------
7>------ Rebuild All started: Project: xfer-stream-loop, Configuration: Release x64 ------
8>------ Rebuild All started: Project: enum_descriptors, Configuration: Release x64 ------
9>------ Rebuild All started: Project: pipe-policy-other, Configuration: Release x64 ------
10>------ Rebuild All started: Project: xfer-control, Configuration: Release x64 ------
3>All 320 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
3>Finished generating code
3>libusbK_dll.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\bin\dll\x64\Release\libusbK.dll
5>examples.c
6>examples.c
2>Done Adding Additional Store
8>examples.c
2>Successfully signed: C:\work\libusb\libusbK_vs2022\libusbK\ARM64\Release\libusbK.sys
2>
7>examples.c
6>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
6>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
6>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
6>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
6>xfer-control-loop.c
5>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
5>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
5>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
5>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
5>xfer-iso-asap.c
8>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
9>examples.c
8>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
8>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
8>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
8>enum_descriptors.c
7>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
7>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
7>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
7>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
7>xfer-stream-loop.c
10>examples.c
11>------ Rebuild All started: Project: power-policy-suspend, Configuration: Release x64 ------
9>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
9>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
9>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
9>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
9>pipe-policy-other.c
5>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
11>examples.c
5>Generating code
10>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
10>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
10>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
10>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
10>xfer-control.c
7>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
11>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
5>Finished generating code
11>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
11>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
11>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
11>power-policy-suspend.c
7>Generating code
9>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
7>Finished generating code
5>xfer-iso-asap.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-iso-asap\Release\x64\xfer-iso-asap.exe
9>Generating code
10>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
10>Generating code
7>xfer-stream-loop.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-stream-loop\Release\x64\xfer-stream-loop.exe
9>Finished generating code
11>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
11>Generating code
10>Finished generating code
9>pipe-policy-other.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\pipe-policy-other\Release\x64\pipe-policy-other.exe
11>Finished generating code
10>xfer-control.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-control\Release\x64\xfer-control.exe
11>power-policy-suspend.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\power-policy-suspend\Release\x64\power-policy-suspend.exe
2>Driver is 'Universal'.
5>Done building project "xfer-iso-asap.vcxproj".
12>------ Rebuild All started: Project: pipe-policy-timeout, Configuration: Release x64 ------
12>examples.c
7>Done building project "xfer-stream-loop.vcxproj".
13>------ Rebuild All started: Project: xfer-stream, Configuration: Release x64 ------
9>Done building project "pipe-policy-other.vcxproj".
14>------ Rebuild All started: Project: xfer-sync, Configuration: Release x64 ------
13>examples.c
14>examples.c
10>Done building project "xfer-control.vcxproj".
15>------ Rebuild All started: Project: xfer-async, Configuration: Release x64 ------
12>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
12>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
12>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
11>Done building project "power-policy-suspend.vcxproj".
16>------ Rebuild All started: Project: xfer-async-loop, Configuration: Release x64 ------
12>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
12>pipe-policy-timeout.c
16>examples.c
15>examples.c
13>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
14>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
13>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
13>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
13>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
13>xfer-stream.c
14>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
14>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
14>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
14>xfer-sync.c
12>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
15>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
15>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
16>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
16>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
12>Generating code
15>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
15>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
15>xfer-async.c
16>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
16>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
16>xfer-async-loop.c
2>........................
2>Signability test complete.
2>
2>Errors:
2>None
2>
2>Warnings:
2>None
2>
2>Catalog generation complete.
2>C:\work\libusb\libusbK_vs2022\libusbK\ARM64\Release\libusbK\libusbk.cat
13>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
15>C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-async\xfer-async.c(167,63): warning C4474: 'printf' : too many arguments passed for format string
12>Finished generating code
14>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
15>C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-async\xfer-async.c(167,63): message : placeholders and their parameters expect 1 variadic arguments, but 2 were provided
13>Generating code
14>Generating code
12>pipe-policy-timeout.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\pipe-policy-timeout\Release\x64\pipe-policy-timeout.exe
6>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
13>Finished generating code
15>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
2>Done Adding Additional Store
16>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
6>Generating code
14>Finished generating code
15>Generating code
16>Generating code
2>Successfully signed: C:\work\libusb\libusbK_vs2022\libusbK\ARM64\Release\libusbK\libusbk.cat
2>
6>Finished generating code
13>xfer-stream.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-stream\Release\x64\xfer-stream.exe
15>Finished generating code
16>Finished generating code
14>xfer-sync.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-sync\Release\x64\xfer-sync.exe
6>xfer-control-loop.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-control-loop\Release\x64\xfer-control-loop.exe
15>xfer-async.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-async\Release\x64\xfer-async.exe
16>xfer-async-loop.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-async-loop\Release\x64\xfer-async-loop.exe
12>Done building project "pipe-policy-timeout.vcxproj".
17>------ Rebuild All started: Project: xfer-iso, Configuration: Release x64 ------
17>examples.c
13>Done building project "xfer-stream.vcxproj".
18>------ Rebuild All started: Project: hot-plug-monitor, Configuration: Release x64 ------
14>Done building project "xfer-sync.vcxproj".
19>------ Rebuild All started: Project: config-interface, Configuration: Release x64 ------
18>examples.c
6>Done building project "xfer-control-loop.vcxproj".
20>------ Rebuild All started: Project: load-driver-api, Configuration: Release x64 ------
15>Done building project "xfer-async.vcxproj".
21>------ Rebuild All started: Project: open-device, Configuration: Release x64 ------
19>examples.c
16>Done building project "xfer-async-loop.vcxproj".
22>------ Rebuild All started: Project: show-device, Configuration: Release x64 ------
17>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
17>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
17>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
17>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
17>xfer-iso.c
20>examples.c
21>examples.c
22>examples.c
18>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
18>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
18>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
18>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
18>hot-plug-monitor.c
19>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
19>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
19>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
19>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
19>config-interface.c
20>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
21>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
20>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
20>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
20>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
20>load-driver-api.c
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(48,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
21>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
21>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
21>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
21>open-device.c
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(107,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(131,20): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\examples.c(99,20): warning C4267: 'initializing': conversion from 'size_t' to 'const UINT', possible loss of data
22>show-device.c
17>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
17>Generating code
18>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\show-device\show-device.c(97,11): warning C4477: 'printf' : format string '%u' requires an argument of type 'unsigned int', but variadic argument 1 has type 'UINT_PTR'
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\show-device\show-device.c(97,11): message : consider using '%llu' in the format string
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\show-device\show-device.c(97,11): message : consider using '%Iu' in the format string
22>C:\work\libusb\libusbK_vs2022\libusbK\examples\show-device\show-device.c(97,11): message : consider using '%I64u' in the format string
18>Generating code
19>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
23>------ Rebuild All started: Project: kList, Configuration: Release x64 ------
17>Finished generating code
19>Generating code
21>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
18>Finished generating code
21>Generating code
20>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
20>Generating code
17>xfer-iso.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\xfer-iso\Release\x64\xfer-iso.exe
19>Finished generating code
21>Finished generating code
22>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
22>Generating code
8>examples.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
8>Generating code
20>Finished generating code
22>Finished generating code
18>hot-plug-monitor.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\hot-plug-monitor\Release\x64\hot-plug-monitor.exe
8>Finished generating code
20>load-driver-api.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\load-driver-api\Release\x64\load-driver-api.exe
19>config-interface.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\config-interface\Release\x64\config-interface.exe
22>show-device.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\show-device\Release\x64\show-device.exe
21>open-device.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\open-device\Release\x64\open-device.exe
8>enum_descriptors.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\examples\enum_descriptors\Release\x64\enum_descriptors.exe
23>kList.c
17>Done building project "xfer-iso.vcxproj".
24>------ Rebuild All started: Project: kBench, Configuration: Release x64 ------
18>Done building project "hot-plug-monitor.vcxproj".
20>Done building project "load-driver-api.vcxproj".
21>Done building project "open-device.vcxproj".
22>Done building project "show-device.vcxproj".
24>kBench.c
23>C:\work\libusb\libusbK_vs2022\libusbK\src\kList\kList.c(515,20): warning C4477: 'scanf_s' : format string '%u' requires an argument of type 'unsigned int *', but variadic argument 1 has type 'LONG_PTR *'
19>Done building project "config-interface.vcxproj".
23>C:\work\libusb\libusbK_vs2022\libusbK\src\kList\kList.c(515,20): message : consider using '%llu' in the format string
23>C:\work\libusb\libusbK_vs2022\libusbK\src\kList\kList.c(515,20): message : consider using '%Iu' in the format string
23>C:\work\libusb\libusbK_vs2022\libusbK\src\kList\kList.c(515,20): message : consider using '%I64u' in the format string
23>UsbIds.c
8>Done building project "enum_descriptors.vcxproj".
24>C:\work\libusb\libusbK_vs2022\libusbK\src\kBench\kBench.c(929,44): warning C4456: declaration of 'tmpWriteVerifyBuffer' hides previous local declaration
24>C:\work\libusb\libusbK_vs2022\libusbK\src\kBench\kBench.c(855,40): message : see declaration of 'tmpWriteVerifyBuffer'
24>C:\work\libusb\libusbK_vs2022\libusbK\src\kBench\kBench.c(1502,8): warning C4456: declaration of 'bufferIndex' hides previous local declaration
24>C:\work\libusb\libusbK_vs2022\libusbK\src\kBench\kBench.c(1375,17): message : see declaration of 'bufferIndex'
24>C:\work\libusb\libusbK_vs2022\libusbK\src\kBench\kBench.c(2063,22): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
24>C:\work\libusb\libusbK_vs2022\libusbK\src\kBench\kBench.c(2066,23): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
23>Generating code
23>Previous IPDB not found, fall back to full compilation.
23>All 261 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
23>Finished generating code
23>kList.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\bin\Release\kList\x64\kList.exe
23>Done building project "kList.vcxproj".
24>Generating code
24>Previous IPDB not found, fall back to full compilation.
24>All 243 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
24>Finished generating code
24>kBench.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\bin\kBench\x64\Release\kBench.exe
24>Done building project "kBench.vcxproj".
========== Rebuild All: 24 succeeded, 0 failed, 0 skipped ==========
========== Rebuild started at 10:11 pm 

@mcuee
Copy link
Owner

mcuee commented Sep 25, 2023

x64 build is good.

Build started...
1>------ Build started: Project: libusbK (sys\libusbK), Configuration: Release x64 ------
1>Building 'libusbK' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform.
1>Stamping x64\Release\libusbK.inf
1>Stamping [Version] section with DriverVer=09/25/2023,22.15.6.513
1>drv_device.c
1>drv_driver.c
1>drv_general.c
1>drv_interface.c
1>drv_pipe.c
1>drv_policy.c
1>drv_queue_default.c
1>drv_queue_pipe.c
1>drv_registry.c
1>drv_request.c
1>drv_xfer_bulk.c
1>drv_xfer_control.c
1>drv_xfer_iso.c
1>drv_xfer_simple.c
1>Generating Code...
1>libusbK_sys.vcxproj -> C:\work\libusb\libusbK_vs2022\libusbK\x64\Release\libusbK.sys
1>Done Adding Additional Store
1>Successfully signed: C:\work\libusb\libusbK_vs2022\libusbK\x64\Release\libusbK.sys
1>
1>Driver is 'Universal'.
1>........................
1>Signability test complete.
1>
1>Errors:
1>None
1>
1>Warnings:
1>None
1>
1>Catalog generation complete.
1>C:\work\libusb\libusbK_vs2022\libusbK\x64\Release\libusbK\libusbk.cat
1>Done Adding Additional Store
1>Successfully signed: C:\work\libusb\libusbK_vs2022\libusbK\x64\Release\libusbK\libusbk.cat
1>
========== Build: 1 succeeded, 0 failed, 23 up-to-date, 0 skipped ==========
========== Build started at 10:15 pm and took 04.689 seconds ==========

x86 build is good as well.

@mcuee
Copy link
Owner

mcuee commented Sep 25, 2023

@TravisRo and @sonatique

Another thing, this PR is based on VS2022 and latest WDK. As per Peter (@dontech), we can not support Windows 7/8 with this build.

Reference discussion:

@sonatique
Copy link
Author

sonatique commented Sep 25, 2023

@mcuee : regarding build: yes, indeed, ARM64 is only for libusbK.sys for now, I can try to add ARM64 for everything if there is interest for it.
And yes, I had to drop support for pre Win10 in order to add ARM64. My point is that (as far as I can tell) the traditional build system for libusbK, based on makefile (and not base on VS project) is still there and can still produce Win7/8 and x86 binaries.
For instance: I didn't required higher KDMF version numbers, so it is purely the build system that determines what targets are possible or not, it's not the code.

If maintaining everything in one code base becomes too difficult, we can fork to another project for "Win10" libusbK, or maintain a distinct branch alongside master.

I can also remove the toolset upgrade from this commit, but I thought that moving away from VS2019 would make sens.

@mcuee
Copy link
Owner

mcuee commented Sep 26, 2023

@mcuee : regarding build: yes, indeed, ARM64 is only for libusbK.sys for now, I can try to add ARM64 for everything if there is interest for it.

Yes, please help to update. Thanks.

@mcuee
Copy link
Owner

mcuee commented Sep 26, 2023

And yes, I had to drop support for pre Win10 in order to add ARM64. My point is that (as far as I can tell) the traditional build system for libusbK, based on makefile (and not base on VS project) is still there and can still produce Win7/8 and x86 binaries. For instance: I didn't required higher KDMF version numbers, so it is purely the build system that determines what targets are possible or not, it's not the code.

I am okay with upgrading to VS2022 and Windows 11 WDK (now Windows 11 WDK version 22H2), and drop support for Windows 7/8/8.1.

But let's hear the opinion of Travis. @TravisRo

If maintaining everything in one code base becomes too difficult, we can fork to another project for "Win10" libusbK, or maintain a distinct branch alongside master.

I can also remove the toolset upgrade from this commit, but I thought that moving away from VS2019 would make sense.

One option is to have two separate folders: but maybe this is too much work. Again let's hear the opinion of Travis. @TravisRo

  1. VS2019+Windows 10 WDK (latest version is 2004)
  2. VS2022+Windows 11 WDK (latest version is 22H2)

Reference:
https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
https://learn.microsoft.com/en-us/windows-hardware/drivers/other-wdk-downloads

…d latest WDK for x64 and ARM64 build + minor corrections (typos) + Upgrading to latest VS2022 toolset for all projects
@sonatique sonatique changed the title ARM64 driver: Upgrade driver project to VS2022 and latest WDK + minor (typos) corrections + Upgrade to latest VS 2022 toolset Add ARM64 target to all projects, upgrade driver project to VS2022 and latest WDK for x64 and ARM64 build + minor corrections (typos) + Upgrading to latest VS2022 toolset for all projects Sep 26, 2023
@sonatique
Copy link
Author

@mcuee : regarding build: yes, indeed, ARM64 is only for libusbK.sys for now, I can try to add ARM64 for everything if there is interest for it.

Yes, please help to update. Thanks.

Done

@mcuee
Copy link
Owner

mcuee commented Oct 7, 2023

@TravisRo

Please take a look at this PR when you get some time. Thanks.

@mcuee
Copy link
Owner

mcuee commented Oct 20, 2023

Great! Thanks for the contribution. I will ask if I can sign this with my work certificate.

@TravisRo

Any updates on this topic? It is indeed good to be able to sign the driver file (even for the current git master).

@mcuee
Copy link
Owner

mcuee commented Jul 11, 2024

@TravisRo
Ping. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants