From: kapil.surlaker@gmail.com on
Hi:

I am trying to automatically install an IM driver given the .sys, .inf
and the _m.inf files. I used the code from the Bindview application:

hr = GetPnpID( lpszInfFile, &lpszPnpID );

if ( hr == S_OK ) {

hr = InstallSpecifiedComponent( lpszInfFile,
lpszPnpID,
&GUID_DEVCLASS_NETSERVICE );

CoTaskMemFree( lpszPnpID );
}

This completes without any errors but does not complain about the
"driver not being signed" as it does if I install the driver manually.
When I check the network interfaces, the driver appears in the list and
the .sys file is also present in the Drivers directory. However, this
doesn't quite work as when I try to use the driver later in another
application, it errors out saying "driver not loaded".

Interestingly, if I install the driver manually followed by a manual
uninstall and then run the installer using the above code segment, it
works just fine. This makes me think I might not be calling the right
call in the BindView app or missing some other call that is required
for a complete install.

The steps for a manual install that works are:

1. On the desktop, right-click the My Network Places icon and choose
Properties.
2. Right-click on the relevant Local Area Connection icon and choose
Properties.
3. Click Install, then Service, then Add, then Have Disk.
4. Browse to the drive/directory containing the inf file. Click OK


I am totally stumped by this and any help would be highly appreciated.

Thanks!