Driver Load Issues in Windows 11 HLK INF Verification: Error with AddReg Operation

hanish gopi 10 Reputation points
2024-12-24T02:51:25.1066667+00:00

Hello everyone I'm using Infverif.exe tool from WDK 10.0.22621 to verify my INF file.

Command used to execute is infverif.exe /u "absolute inf file path".

For INF AddReg directive section i have created the entries as follows.

HKLM, %SmartCardName%
HKLM, %SmartCardName%,"ValueName1",0x00000001,"ValueData1" 
HKLM, %SmartCardName%,"ValueName2",0x00000001,"ValueData2"

and when I validate the file using infverif.exe tool it reports error code "1304" saying "Registry root of value 'ValueName1' is not isolated to HKR".

Referred to the error code description link https://dori-uw-1.kuma-moon.com/en-us/windows-hardware/drivers/devtest/inf-validation-errors-and-warnings and found the error can be solve by replacing the non-relative registry root value with a relative registry root value which is replacing by HKLM to HKR.

After replacing as above the infverif.exe pass the validation of INF file which is good to be.

but the driver enumeration fails by not creating those particular registry entries anymore.
Which lead to failure in complete automatic loading of the driver.
Help me figure out how to ensure my registry entries are created when the driver loads.

Windows 11 24H2 Build 26100

Windows development | Windows Driver Kit (WDK)
{count} vote

1 answer

Sort by: Most helpful
  1. Darth Tester 20 Reputation points
    2025-12-10T15:41:08.83+00:00

    Yes, the registry entries are created, but into a different path, for instance:

    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class{990a2bd7-e738-46c7-b26f-1cf8fb9f1391}\0000\SOFTWARE\Microsoft\Cryptography\Calais\SmartCards

    Try to search your driver's name on registry editor starting from HKEY_LOCAL_MACHINE and you will find them.

    When you use HKR, the path where registry entries are created changes, but you did not change the path you read from.

    There is no choice, you have to touch driver source code.

    I guess I found official doc to use registry according to isolation rules:

    https://dori-uw-1.kuma-moon.com/en-us/windows-hardware/drivers/develop/driver-isolation#registry-state

    Hope this helps.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.