🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #268

Re: SetupDiGetClassDevs and DIGCF_PRESENT

#268
From: Bob Gonder
Date: Thu, 15 May 2008 16:50
20 lines
1706 bytes
JohnG wrote:

>In sample code below SetupDiGetClassDevs always returns 
>INVALID_HANDLE_VALUE. GetLastError() returns 87, which I 
>believe is incorrect parameter. If I replace DIGCF_PRESENT  
>with DIGCF_PRESENT | DIGCF_ALLCLASSES, the code works however 
>when I enumerate the hardware I get much more then just the 
>hardware that is currently in the system. Any ideas why I cant 
>use only the DIGCF_PRESENT flag? I am trying to query only the 
>hardware that is in the system.

Read the comment section in the docs here:
http://msdn.microsoft.com/en-us/library/ms792959.aspx

You must either specify a device guid in ClassGuid,
or use DIGCF_ALLCLASSES. So, your use of NULL for
ClassGuid was in fact an incorrect parameter.

See also example code here
http://support.microsoft.com/kb/259695
Technical Details
Message-ID: <96qo24t2i0qffqsn42il8qpjtf3ovhoovu@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.buerger.net!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <482c5a83$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f5fa50a86f1465be
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: SetupDiGetClassDevs and DIGCF_PRESENT
Date: Thu, 15 May 2008 09:50:12 -0700
Message-ID: <96qo24t2i0qffqsn42il8qpjtf3ovhoovu@4ax.com>
References: <482c5a83$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.144.112
X-Trace: newsgroups.borland.com 1210870210 67.77.144.112 (15 May 2008 09:50:10 -0700)
Lines: 22
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.buerger.net!news.isoc.lu!newsgroups.borland.com!not-for-mail