http-equiv=“Content-Type”>
HI Dave
thanks for your reply
On 23/12/2010 6:45 a.m., Dave Cattley wrote:
type=“cite”>
S_FALSE (IIRC) is the return code that results when the component
cannot be found (is not installed).
You say this occurs when your detect your component is installed
by inference from the registry data. A better way is to use
BindView from the WDK and verify your component is installed. I
am not convinced that your component is actually installed if you
call FindComponent() with your component Id and it returns
S_FALSE. I also presume that when it returns S_FALSE that the
output interface pointer is NULL. Is that correct?
I changed my code from checking for S_OK to checking for
SUCCEEDED(hr) and a non-null interface pointer. Since I can’t repro
the problem (customer site) I’ve asked the customer to run another
installer which should give me the answer to this question a bit
later.
type=“cite”>
Finding the name of the OEMnn.INF file(s) that will install your
component is an operation consisting of a number of SetupDi
calls. Essentially you create a device info set and a new root
enumerated device with a device id that matches your component
id. Yes, I know that sounds silly since your component is not a
‘device’ but that is irrelevant to how SetupDi views the issue.
You ‘create’ the device and specify a flag to avoid calling the
CFGMGR to actually involve PnP and then ask SetupDi to enumerate
all drivers for the device, then grok the list of drivers for the
name(s) of the INF file in which the system has found the
drivers. You then delete the device and cleanup up now that you
know the list of INF files.
Actually since we have a netcfginstance UUID it’s “safe” to grep the
.inf files in Windows\ini ?
We are of course also dealing with a bunch of legacy issues, where
previous versions of our driver uninstaller didn’t remove the
oemxx.inf files, so there would be multiple copies of the driver in
the driver repository.
So I grep the files, look for the device class GUID and our net
config instance GUID and remove all old inf files that way. Seems
to work great.
As for finding the current instance in the registry. I work on the
basis that MS won’t change this radically any time soon, since it
hasn’t changed in aeons. Otherwise we’d need to store the reported
oemx.inf file when we installed (which our old installer didn’t do).
I can see reliably that the reg key is removed / added when I remove
/ add the component using netcfg.exe or from the network interface
properties UI.
type=“cite”>
Wandering about the registry is not a good idea 
Oh, and that GUID? I don’t think you actually control that value
do you?
it’s in our .inf file under NetCfgInstanceId
the value we provide there seems to be used by the os.
refer to
http://msdn.microsoft.com/en-us/library/ff554951(VS.85).aspx under
the DDInstall Section.
type=“cite”>NetCfg allocates that for its own use. Nothing that I
know of guarantees that GUID to be same through an
install->uninstall->install cycle.
type=“cite”>Good Luck,
thanks!
Adrien
type=“cite”>
Dave Cattley
NTDEV is sponsored by OSR
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
--
Adrien de Croy - WinGate Proxy Server -[http://www.wingate.com](http://www.wingate.com)