SetupAPI InstallHInfSection is not downgrading a driver file

Hello,

Environment: Windows x86 8.1 English

I am making use of the SetupAPI:InstallHInfSecton to install drivers. This API is used in my MSI package.
When the driver package is installed, the associated .sys file is copied to %windows%\system32\drivers.

One of the hotfix packages contains an updated driver package thereby resulting in an updated version of the .sys file being copied to %windows%\system32\drivers.

However, when the hotfix is uninstalled, the .sys file under %windows%\system32\drivers is not being reverted back to the base version.

i.e in other words, InstallHInfSection is unable to downgrade files in %windows%\system32\drivers. This always used to work properly in Win 7.
The strange part is that when i use the same API outside of my MSI package, the downgrade happens as expected.

This has always worked until now.

The following lines were logged in setupapi.app log file:
! flq: 10:30:50.621 A target file was not overwritten. Version of source file: 7.1.0.4043. Version of target file: 7.1.16.4043.
! flq: 10:30:50.621 The SPFQNOTIFY_TARGETNEWER flag was set.

Can someone tell me as to what coudl have gone wrong?

Regards,
Kiran Hegde

It turns out that InstallHInfSection is unable to downgrade files in **SYSTEM** context. However, it can downgrade files under **Logged in user** context.

Strangely, the API works properly on x64 windows 8/8.1.

Can anyone think of a reason why would there be a difference in behavior between x86 and x64 versions?

Also, is there an alternative API to InstallHInfSection.

Regards,
Kiran Hegde

Hello,

Does anyone has any pointers?

Regards,
Kiran Hegde