From: Maxim S. Shatskih on
> OK, I've got the code for devcon, but did not find any command named "Enum"

Sorry, devcon dp_enum

The implementation scans c:\windows\inf for oem%d.inf files.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: Mike [MSFT] on
What's wrong with just passing SP_COPY_NOOVERWRITE to SetupCopyOEMInf?

-Mike

"JY" <sd(a)nospamgroup.com> wrote in message
news:F85ED77F-6AD1-43EE-97EE-A7C708078EB2(a)microsoft.com...
> Hi,
>
> I have an MFC application which needs to install a driver (I could use
> SetupCopyOEMInf() or DriverPackageInstall() , etc), but I have to check if
> it
> is already installed, and proceed only if it isn't. How do I check this?
> Is
> there any API available for this?
>
> TIA,
> JY

From: JY on


"Mike [MSFT]" wrote:

> What's wrong with just passing SP_COPY_NOOVERWRITE to SetupCopyOEMInf?
>
> -Mike
I guess that would check for only 1 version of an installed driver/ only 1
..inf file. I would like to check for any version of a driver installed for
that device, not just a specific one.
Regards,
JY

From: Pavel A. on
"JY" <sd(a)nospamgroup.com> wrote in message
news:EF1DE005-3B5D-4584-A842-FDD8A2833398(a)microsoft.com...
>
>
> "Mike [MSFT]" wrote:
>
>> What's wrong with just passing SP_COPY_NOOVERWRITE to SetupCopyOEMInf?
>>
>> -Mike
> I guess that would check for only 1 version of an installed driver/ only 1
> .inf file. I would like to check for any version of a driver installed for
> that device, not just a specific one.
> Regards,

Enumerate all devices of your bus type, and look for your hw id.
Then get the device state - if there is some PnP problem,
like device disabled, failed, etc - and details of the installed driver.

--pa


From: Mike [MSFT] on
You can enumerate all drivers using SetupDiBuildDriverInfoList and then look
for yours. There's lots of ways to filter the list with that API; by setup
class is probably ideal.

You can also do like Maxim suggested and follow the "devcon DP_enum" example
and scan %windir%\inf\ for oem*.inf files. However that isn't guaranteed to
work after Win 7.

-Mike

"JY" <sd(a)nospamgroup.com> wrote in message
news:EF1DE005-3B5D-4584-A842-FDD8A2833398(a)microsoft.com...
>
>
> "Mike [MSFT]" wrote:
>
>> What's wrong with just passing SP_COPY_NOOVERWRITE to SetupCopyOEMInf?
>>
>> -Mike
> I guess that would check for only 1 version of an installed driver/ only 1
> .inf file. I would like to check for any version of a driver installed for
> that device, not just a specific one.
> Regards,
> JY
>