Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enumerating devices on Win98 using SetupDi API

0 views
Skip to first unread message

Florin

unread,
Mar 12, 2003, 5:05:15 PM3/12/03
to
Hi,

I am having a problem trying to enumerate device interfaces that belong to a
certain class (GUID) on Win98. On WinXP the code works fine but on Win98 I
keep getting ERROR_NO_MORE_ITEMS error even at the first iteration:

HDEVINFO hInfo = ::SetupDiGetClassDevs(pInterfaceGUID, 0, 0,
DIGCF_DEVICEINTERFACE);

if (hInfo)
{
UINT32 index(0);
for(; ; ++index)
{
_SP_DEVICE_INTERFACE_DATA data = {0};
data.cbSize = sizeof data;

if (!::SetupDiEnumDeviceInterfaces(m_hInfo,
0,
const_cast<GUID*>(pInterfaceGUID),
index,
&data))
{
DWORD res = ::GetLastError();
break;
}
}
}

I tried different interface GUIDs but with no success. The same code works
fine on WinXP/2K.

I would appreciate it if someone can give a hint why this doesn't work on
Win98.

Thanks,

Florin.


Jeffrey Gu

unread,
Mar 12, 2003, 8:02:23 PM3/12/03
to
Are your OS WIN98 or WIN98SE? I also found this function will failed under
WIN98 but work fine under WIN98SE

"Florin" <a...@abc.com> 写入消息新闻:uZJ#6NO6CH...@TK2MSFTNGP12.phx.gbl...

Florin

unread,
Mar 12, 2003, 8:30:17 PM3/12/03
to
Win98SE/ IE6. I thought about this too...So, for you it works?! I don't
understand why...

Florin.

"Jeffrey Gu" <Jeff...@msn.com> wrote in message
news:#y87cxP6...@TK2MSFTNGP09.phx.gbl...

Wei Mao [MSFT]

unread,
Mar 14, 2003, 2:21:10 AM3/14/03
to
Hello Florin,
only wdm driver might register the interfaces. however we know that many
drivers on win9x are not wdm (e.g. storage, serial ports) and thus they do
not appear here.

another example is usb devices which *is* wdm driver even on win9x. I
tried GUID_DEVINTERFACE_USB_HUB, GUID_DEVINTERFACE_USB_DEVICE, and
GUID_DEVINTERFACE_USB_HOST_CONTROLLER (these constance are defined in
latest windows xp ddk). and it does find the root hub in my win98se
machine.

DEFINE_GUID(GUID_DEVINTERFACE_USB_HUB, 0xf18a0e88, 0xc30c, 0x11d0, 0x88,
0x15, 0x00, \
0xa0, 0xc9, 0x06, 0xbe, 0xd8);

thanks
wei

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com

Florin

unread,
Mar 14, 2003, 1:29:52 PM3/14/03
to
Thanks Wei for your response.

This still doesn't resolve my problem because what I want to do is to
enumerate all devices that belong to GUID_DEVINTERFACE_DISK class (all
disks) no matter how they are connected (USB, FireWire, etc).

Florin.

"Wei Mao [MSFT]" <wei...@online.microsoft.com> wrote in message
news:5Wv5Tpf6...@cpmsftngxa08.phx.gbl...

Wei Mao [MSFT]

unread,
Mar 17, 2003, 5:25:27 AM3/17/03
to
try this one (i.e. use 'setup class' instead of 'interface class'):

DEFINE_GUID( GUID_DEVCLASS_DISKDRIVE, 0x4d36e967L, 0xe325, 0x11ce,
0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18 );

SetupDiGetClassDevs(GUID_DEVCLASS_DISKDRIVE, NULL, hwnd, DIGCF_PRESENT);

0 new messages