From: Kerem Gümrükcü on
Hi,

i get with SetupDiGetClassDevs and DIGCF_ALLCLASSES all devices
on my system, including the ones that are not attached to my system. This
is exactly what i want, but how can i see which device in my list ist
attached to the system and which one is not, Is there some flag somewhere
in a data structure i can get by calling something,...?

TIA,...

Regards

Kerem

--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Latest Project: http://www.codeplex.com/restarts
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

From: Pavel A. on
Use the DIGCF_PRESENT flag.

--PA

"Kerem G�mr�kc�" <kareem114(a)hotmail.com> wrote in message
news:OEt#Dn26IHA.4292(a)TK2MSFTNGP02.phx.gbl...
> Hi,
>
> i get with SetupDiGetClassDevs and DIGCF_ALLCLASSES all devices
> on my system, including the ones that are not attached to my system. This
> is exactly what i want, but how can i see which device in my list ist
> attached to the system and which one is not, Is there some flag somewhere
> in a data structure i can get by calling something,...?
>
> TIA,...
>
> Regards
>
> Kerem
>
> --
> -----------------------
> Beste Gr�sse / Best regards / Votre bien devoue
> Kerem G�mr�kc�
> Latest Project: http://www.codeplex.com/restarts
> Latest Open-Source Projects: http://entwicklung.junetz.de
> -----------------------
> "This reply is provided as is, without warranty express or implied."

From: Kerem Gümrükcü on
Hi Pavel,

i either use DIGCF_PRESENT or the DIGCF_ALLCLASSES, depending
on what i need, but mostly i have to see ALL devices on my system, so the
point is to select between devices that are attached physically to my system
and those who are not,...there must be some flag somewhere or a SetupDi*
function that can do this for me,...

Regards

Kerem

--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Latest Project: http://www.codeplex.com/restarts
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

From: Wilhelm Noeker on
Kerem G�mr�kc� schrieb:

> i either use DIGCF_PRESENT or the DIGCF_ALLCLASSES, depending
> on what i need, but mostly i have to see ALL devices on my system, so the
> point is to select between devices that are attached physically to my
> system
> and those who are not,...there must be some flag somewhere or a SetupDi*
> function that can do this for me,...

Here's what I do, using the devInfo returned by SetupDiEnumDeviceInfo():

if( CM_Get_DevNode_Status( &lStatus, &lProblem, devInfo.DevInst, 0 ) !=
CR_SUCCESS )
printf( "device is currently not attached\n" );
else
{
if( lProblem == 0 )
printf( "device is running\n" );
else if( lProblem == CM_PROB_DISABLED )
printf( "device has been disabled\n" );
else
printf( "device has a problem, code %d\n", lProblem );
}
From: Stefan Kuhr on
Kerem,

Kerem G�mr�kc� wrote:
> Hi Pavel,
>
> i either use DIGCF_PRESENT or the DIGCF_ALLCLASSES, depending
> on what i need, but mostly i have to see ALL devices on my system, so the
> point is to select between devices that are attached physically to my
> system
> and those who are not,...there must be some flag somewhere or a SetupDi*
> function that can do this for me,...
>
> Regards
>
> Kerem
>

In addition to what Wilhelm noeker wrote: You might want to do a
CM_Get_DevNode_Status/CM_Get_DevNode_Status_Ex on the device node and
examine the status for the device that is returned. If the flag
DN_NO_SHOW_IN_DM is set, you can leave out that device.

--
S