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

AutoLaunch Application Example

1 view
Skip to first unread message

Scott

unread,
May 20, 2003, 10:22:00 PM5/20/03
to
Hello,

I have tried to modify the sample code provided by Walter Oney which
provide an AutoLaunch service for Win 2K. I want to launch an
application for a network device where I did not write the driver. My
code snipet looks like --

DEV_BROADCAST_DEVICEINTERFACE filter = {0};
filter.dbcc_size = sizeof(filter);
filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
filter.dbcc_classguid = GUID_DEVCLASS_NET;

m_hNotification = RegisterDeviceNotification(m_hService, (PVOID)
&filter, DEVICE_NOTIFY_SERVICE_HANDLE);

I realize that all GUID_DEVCLASS_NET events will be sent to the
service and I will need to find out if any particular event is of
interest. That part I have figured out. My problem is that I do not
see the "plug" or "unplug" events being sent to the m_hService handler
in the first place. What am I doing wrong?

Thanks,

Scott

Scott

unread,
May 21, 2003, 9:31:06 PM5/21/03
to
scott.n...@shaw.ca (Scott) wrote in message news:<3b37a365.03052...@posting.google.com>...

Hi,

For anyone that cares, I found the answer after much toil. The filter
should be set as follows:
filter.dbcc_classguid = GUID_NDIS_LAN_CLASS
which is defined in ndisguid.h

This produces events on my particular Network card. I'm not sure if it
will work for all but give it a try. You can then parse the devices to
find of if your particular device in there.

Scott

0 new messages