What Can I Do If the Inf File Compiled by VS2022 Cannot Be Uninstalled Using DefaultUnInstall?

Sylvia Tsao 0 Reputation points
2024-09-03T01:56:39.77+00:00

Dear Microsoft,

Here's the part of my inf file uninstallation:

[DefaultUninstall.NTamd64]
LegacyUninstall=1
DelReg = EPWF.DelReg
DelFiles = EPWF.DeleteFiles

[DefaultUninstall.NTarm64]
LegacyUninstall=1
DelReg = EPWF.DelReg
DelFiles = EPWF.DeleteFiles

[DefaultUninstall.NTamd64.Services]
DelService = %DriverName%,,

[DefaultUninstall.NTarm64.Services]
DelService = %DriverName%,,

[EPWF.DelReg]
HKLM,SYSTEM\CurrentControlSet\Control\Class\{3F966BD9-FA04-4EC5-991C-D326973B5128},UpperFilters,0x00018002,%DriverName%

I run the command to execute the DefaultUnInstall section of the inf file to uninstall the driver.

rundll32.exe setupapi.dll,InstallHinfSection DefaultUnInstall 128 路径\EPWF.inf

However, when I run the command on a Windows 10 x64 machine, I can still see the servicr by 'sc query epwf'. I had to run this command twice to successfully uninstall the service.

When I run the command on another Windows 11 ARM64 machine, the service cannot be uninstalled. When I run the command again, a window is displayed, indicating that the installation fails. The ’sc query epwf‘ still shows the service.

Is there a problem with DefaultUninstall in the inf file?

Another problem is that the delReg can delete the registry normally, but it cannot be compiled on vs2022.

Error 1431 Well-known registry value'UpperFilters' has incorrect type, expected value type 7.

I tried a variety of modifications such as the following

HKLM,SYSTEM\CurrentControlSet\Control\Class\{3F966BD9-FA04-4EC5-991C-D326973B5128},REG_MULTI_SZ,UpperFilters,%DriverName% 

HKLM,SYSTEM\CurrentControlSet\Control\Class\{3F966BD9-FA04-4EC5-991C-D326973B5128},0x00018002,UpperFilters,%DriverName% 

HKLM,SYSTEM\CurrentControlSet\Control\Class\{3F966BD9-FA04-4EC5-991C-D326973B5128},REG_MULTI_SZ,UpperFilters,0x00018002,%DriverName% 

Although the above can be compiled, the registry cannot be deleted on the Windows 10 x64 machine.

I didn't find a clear case in the documentation for this type of registry deletion.

How should delreg write here, both can compile through or delete this registry?

English is not my mother tongue. Please forgive me if there are grammatical mistakes.

Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
86 questions
0 comments No comments
{count} votes

Your answer

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