microsoft / Windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
6.79k stars 4.89k forks source link

simbatt: warning 1324: [Version] section should specify PnpLockdown=1 #1061

Closed forderud closed 3 months ago

forderud commented 7 months ago

I'm experiencing the following warning when building the simbatt sample:

1>------ Build started: Project: simbatt, Configuration: Debug x64 ------
>Building 'simbatt' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform.
>Stamping x64\Debug\simbatt-wdfcoinstall.inf
>Stamping [Version] section with DriverVer=12/06/2023,10.1.41.844
>Stamping x64\Debug\simbatt.inf
>Stamping [Version] section with DriverVer=12/06/2023,10.1.41.978
>C:\Windows-driver-samples\simbatt\func\simbatt-wdfcoinstall.inx(21-21): warning 1324: [Version] section should specify PnpLockdown=1 to prevent external apps from modifying installed driver files.
>C:\Windows-driver-samples\simbatt\func\simbatt.inx(15-15): warning 1324: [Version] section should specify PnpLockdown=1 to prevent external apps from modifying installed driver files.
>miniclass.c
...

Maybe the INF files can be updated accordingly to resolve the warning?

NeoAdonis commented 3 months ago

Hi! Sorry for the late reply.

Thanks for letting us know. We've been working in fixing this issue for all samples on the develop branch. After the latest kit is released, the changes will be migrated to main. You can use the develop branch version of the drivers if you want to get rid of this warning. However, many of the samples require the usage of the preview version of the WDK to build properly, so be aware of that.

forderud commented 3 months ago

Thanks a lot for taking polishing the sample drivers @NeoAdonis so that external developers like me gets a cleaner starting point for driver developments.

By the way, what's the contribution policy for this repo? I've over the past year tried to submit some PR's for addressing various issues with the sample drivers. However, there doesn't seem to be anyone from Microsoft responding. Is there something I can do from my end to get review feedback to my suggestions?

tomtom994386 commented 1 month ago

simple just write in the ,inf file

[Version] Signature="$WINDOWS NT$" Class=YOUR_CLASS_NAME ClassGuid=YOUR_CLASS_GUID Provider=%ProviderName% CatalogFile=YOUR_CATALOG_FILE_NAME DriverVer=YOUR_DRIVER_VERSION PnpLockdown=1 <<----------- THIS

forderud commented 1 month ago

Thanks for fixing this. I hereby confirm that the reported PnpLockdown warning appear to have been fixed by f20a01318ddb570731de91f62e94b37550139b28.