98SE NDIS driver install application.

This concerns a program to install an NDIS driver on Win98 SE. In going
through the DDK, I came across Netdi.dll & the IPInst samples. The latter
appears to be appropriate for this case. However I am not yet positive
that this will achieve the desired goal; as such request experienced views
on this.

For now, I am trying a Win32 console application which essentially does
the following:
SetupDiCreateDeviceInfoList
SetupDiOpenDeviceInfo
SetupDiSetDeviceInstallParams
SetupDiBuildDriverInfoList
SetupDiEnumDriverInfo
SetupDiSetSelectedDevice/Driver
SetupDiInstallDevice

Also while doing SetupDiOpenDeviceInfo(), I get an unkown error
(0xE000020b), which I couldn’t find an explanation about so far - where
else does one look? It is being called as:
SetupDiOpenDeviceInfo(hndle, devID, NULL, 0, &dev);
where devID = “PCI\VEN_…&Dev_…&rev(as in reg)\000”

This (devID) seems to be the key to access the registry for the device.
However the device may not appear there always (e.g. if the user decides
to cancel the ‘Found New Hardware wizard’ immediately. Does this imply
that in such a situation the SetupDiOpenDeviceInfo will not be able to
return the device info.

I presume that the CWnd handle for the parent window is unnecessary for
such a console applicaiton though several SetupAPIs use it. If these are
reqd, how does one obtain the handle in a such a C application.

Thanks.
-ak