The driver program cannot be compiled
Closed this issue · 5 comments
My environment is windows11, version number: 23H2. When I use vs2022 to compile the Driver driver, the final print information is as follows:
One of the function classes listed above. [G:\task\win_monitor_package\fort-3.13.5\src\driver\fortdrv.vcxproj]
69 warnings
0 errors
Used time 00:00:03.30
The system cannot find the specified file.
Unable to find G: \ task \ win_manitr_package \ port-3.13.5 \ build-driver-win10 \ x64 \ portfw *. cer
But fortfw.sys is not generated. What is the reason?
Do I need to create the fortfw*.cer certificate myself first?
First check the requirements for WDK: https://github.com/tnodir/fort/wiki/Building#visual-studio
Then see the build instructions: https://github.com/tnodir/fort/wiki/Building#driver
About driver's cert: https://github.com/tnodir/fort/wiki/Building#certificates
Dear Tnoder:
Thank you very much for your reply. Let me first tell you what I did before:
-
Confirmed that the system has installed: WDK, SDK;
-
The following commands have been run in PowerShell with administrator privileges, and the command returns are successful.
BcdEdit.exe -set loadoptions DISABLE_INTEGRITY_CHECKS
BcdEdit.exe -set NOINTEGRITYCHECKS ON
BcdEdit.exe -set TESTSIGNING ON -
I opened in VS 2022: Tools-->Command Line-->Developer PowerShell, and run the script program for compiling fortfw driver: .\msvcbuild-win10-64.bat.
I did not see any errors during the compilation process, only some warnings. The last few print messages after the compilation are as follows:
G:\task\win_monitor_package\fort-3.13.5\src\driver\fortdrv.c(107): warning C28023: The function to be assigned or passed should have a Function_class annotation for at least one class in "DRIVER_DISPATCH". Usually, this situation occurs when only one function class is used and the callback is not declared as an appropriate type. Prefixing the first declaration of the function with " fort_
device_shutdown" fixes this problem. should be one of the function classes listed above. [G:\task\win_monitor_package\fort-3.13.5\src\driver\fortdrv.vcxproj]
69 warnings
0 errors
Elapsed time 00:00:03.17
The system cannot find the file specified.
Cannot find G:\task\win_monitor_package\fort-3.13.5\build-driver-win10\x64\fortfw*.cer
PS G:\task\win_monitor_package\fort-3.13.5\src\driver>
PS G:\task\win_monitor_package\fort-3.13.5\src\driver>
My question is:
- The fortfw.sys file is not generated in the compilation directory;
- The program prompts: The system cannot find the specified file, but it does not prompt which file cannot be found. Do you know which file cannot be found?
- Is the fortfw*.cer certificate automatically generated? Or do I need to prepare it in advance and put it in the directory: build-driver-win10\x64?
Please help me answer, thank you very much!
2024-08-09
Is the fortfw*.cer certificate automatically generated?
Yes, it should be automatically generated.
I've tried to build the driver with VS 2022: Tools-->Command Line-->Developer PowerShell, but I'm getting error about missing WDK component.
Usually I use EWDK to build the driver:
- download latest EWDK (https://learn.microsoft.com/en-us/legal/windows/hardware/enterprise-wdk-license-2022)
- mount the downloaded .iso file in the Windows Explorer
- run
<EWDK_MOUNTED_DRIVE>:\LaunchBuildEnv.cmd amd64
- Change working directory to driver sources by
cd <PATH-TO>\fort\src\driver
- Run
msvcbuild-win10-64.bat
Dear Tnoder:
Thank you very much!
Using your EWDK link, the fortfw driver was compiled successfully, and the fortfw.sys file was generated.
Thank you again!
2024-08-09