Strange behavior of SetupAPI function : InstallHInfSection

Here is a description of the problem:
-Environment is Win 7 SP1 Enterprise x64
-We are executing a MSI package which contains numerous INF files. These INF files are associated with drivers. To install the drivers , we make use of the API: InstallHInfSection.

The exact usage of InstallHInfSection is as follows:
InstallHinfSection( NULL, NULL, INFFile, 0 );

However, what is happening is that, each and every time this API is invoked on a driver INF file, i am presented with a message box with the text: Installation Failed.

I inspected the setupapi.app log file and did not find any errors. Everything seems to be fine.
The driver .sys file is successfully copied to %windows%\system32\drivers.

To confirm is InstallHInfSection works as expected, i executed the following command from outside of the .msi package:
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 128
Strangely, the above command works without any error messages.

Do you have any pointers on what could be wrong? I am under tremendous pressure to provide an answer.

Any assistance would be very much appreciated.

Regards,
Kiran Hegde

Are these pnp drivers? If so, InstallHInfSection is not the right API to call. You need to use the driver package APIs (dpinst) to install the package.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, January 8, 2015 9:51 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Strange behavior of SetupAPI function : InstallHInfSection

Here is a description of the problem:
-Environment is Win 7 SP1 Enterprise x64 -We are executing a MSI package which contains numerous INF files. These INF files are associated with drivers. To install the drivers , we make use of the API: InstallHInfSection.

The exact usage of InstallHInfSection is as follows:
InstallHinfSection( NULL, NULL, INFFile, 0 );

However, what is happening is that, each and every time this API is invoked on a driver INF file, i am presented with a message box with the text: Installation Failed.

I inspected the setupapi.app log file and did not find any errors. Everything seems to be fine.
The driver .sys file is successfully copied to %windows%\system32\drivers.

To confirm is InstallHInfSection works as expected, i executed the following command from outside of the .msi package:
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 128 Strangely, the above command works without any error messages.

Do you have any pointers on what could be wrong? I am under tremendous pressure to provide an answer.

Any assistance would be very much appreciated.

Regards,
Kiran Hegde


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

kirann hegde wrote:

Here is a description of the problem:
-Environment is Win 7 SP1 Enterprise x64 -We are executing a MSI package which contains numerous INF files. These INF files are associated with drivers. To install the drivers , we make use of the API: InstallHInfSection.

The exact usage of InstallHInfSection is as follows:
InstallHinfSection( NULL, NULL, INFFile, 0 );

What does “INFFile” contain? Remember that it is not just the name of
the file. It needs to be a string containing exactly what you pass to
rundll32:
“DefaultInstall 128 ”


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for the response.

I dont think they are pnp drivers. This API has been in use for years together.

Yes, i am passing the right parameters… this is working everywhere else except for one customer.
I am at loss to understand why.

Regards,
Kiran hegde

On 08-Jan-2015 20:15, xxxxx@gmail.com wrote:

Thanks for the response.

I dont think they are pnp drivers. This API has been in use for years together.

Yes, i am passing the right parameters… this is working everywhere else except for one customer.
I am at loss to understand why.

Regards,
Kiran hegde

One customer is one machine or several at one location?
Have you scavenged for something peculiar there? Especially, 3rd party
filesystem filters… you know.
– pa

Hello,

Thanks for responding back.
I am not sure as to how many systems this is occuring on .
At the moment, we have seen this on just one test machine and have asked our customer to try it on other systems.

—Have you scavenged for something peculiar there? Especially, 3rd party
filesystem filters…

How do i do that? Why do you think that it would be a problem?
Is there any command that you would like me to run?

Also , i felt like the error was being thrown up when the .sys file was being copied to the drivers folder, eventhough the copy was successful

Regards,
Kiran Hegde

Hello,

Does anyone have any pointers?

Regards,
Kiran Hegde

On 12-Jan-2015 07:03, xxxxx@gmail.com wrote:

Hello,

Does anyone have any pointers?

Regards,
Kiran Hegde

Are your driver packages signed? If not: do you have any flag bits in
the copyfiles directives that affect copying?
Especially COPYFLG_WARN_IF_SKIP, COPYFLG_FORCE_FILE_IN_USE,
COPYFLG_NO_VERSION_DIALOG ?

– pa

No, flags are used in the CopyFiles section. The CopyFiles section contains just the name of the .sys file.

Thanks,
Kiran Hegde