Monitoring plug and unplug USB device

Hello,
I have read discussions about Usb filter driver and monitoring USB device.
If I understand correctly there isn’t a way in the filter driver for monitoring plug and unplug USB device, as Mark Roddy wrote:

You have to attach your filter driver to each pdo enumerated by each hub device.This is known as a “bus filter driver” and is undocumented and unsupported by Microsoft, but if you search this list you will find plenty of discussion and documentation.f
If you just want to monitor usb devices and do not need to capture usb data traffic you can do that from user mode, see the usbview app in the WDK.

Best regards
Mark

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Saturday, June 27, 2015 20:49
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] keyboard filter errors

Have you tried adding wdmlib.lib? The import name is giving you a big hint

Sent from Outlook Mailhttp: for Windows 10

From: xxxxx@edu.salford.ac.ukmailto:xxxxx
Sent: Saturday, June 27, 2015 7:05 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] keyboard filter errors

I still seem to be getting an error, the following is the additional dependencies I have added:
%(AdditionalDependencies);$(ddk_lib_path)\wdmsec.lib;$(ddk_lib_path)\ntstrsafe.lib;

This is the error:
error LNK2019: unresolved external symbol xxxxx@4 referenced in function _CreateRawPdo@8


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></http:>

Hello,
I have read discussions about Usb filter driver and monitoring USB device.
If I understand correctly there isn’t a way in the filter driver for monitoring plug and unplug USB device, as Mark Roddy wrote:

You have to attach your filter driver to each pdo enumerated by each hub device.This is known as a “bus filter driver” and is undocumented and unsupported by Microsoft, but if you search this list you will find plenty of discussion and documentation.f
If you just want to monitor usb devices and do not need to capture usb data traffic you can do that from user mode, see the usbview app in the WDK.

Best regards
Mark

Mark Shnaider wrote:

Hello,

I have read discussions about Usb filter driver and monitoring USB
device.

If I understand correctly there isn’t a way in the filter driver for
monitoring plug and unplug USB device, as Mark Roddy wrote:

You have to attach your filter driver to each pdo enumerated by each
hub device.This is known as a “bus filter driver” and is undocumented
and unsupported by Microsoft, but if you search this list you will
find plenty of discussion and documentation.f

If you just want to monitor usb devices and do not need to capture usb
data traffic you can do that from user mode, see the usbview app in
the WDK.

Are you asking a question, answering a question, or just making a speech?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hi Tim,
Can I have a question?
I’m not sure whether the usb hub driver has the capability to enumerate child-device,or all the usb child devices are enumerated by usb host driver?
if usb hub is able to do so, what’s the software process flow in windows kernel’s usb stack?
//dlcu

Subject: Re: [ntdev] Monitoring plug and unplug USB device
To: xxxxx@lists.osr.com
From: xxxxx@probo.com
Date: Thu, 3 Sep 2015 11:01:01 -0700

Mark Shnaider wrote:
>
> Hello,
>
> I have read discussions about Usb filter driver and monitoring USB
> device.
>
> If I understand correctly there isn’t a way in the filter driver for
> monitoring plug and unplug USB device, as Mark Roddy wrote:
>
>
>
> You have to attach your filter driver to each pdo enumerated by each
> hub device.This is known as a “bus filter driver” and is undocumented
> and unsupported by Microsoft, but if you search this list you will
> find plenty of discussion and documentation.f
>
> If you just want to monitor usb devices and do not need to capture usb
> data traffic you can do that from user mode, see the usbview app in
> the WDK.
>

Are you asking a question, answering a question, or just making a speech?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

The hub driver enumerates the devices attached to it. The pnp device tree will closely resemble the physical device tree, with composite and complex devices enumerating into more than one devic. For instance if you plug hub2 into hub1, h1 will enumerate h2 as a child device. Devices attached to h2 will be enumerated by h2

Sent from Outlook Mailhttp: for Windows 10

From: DL CU
Sent: Tuesday, September 8, 2015 7:51 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Monitoring plug and unplug USB device

Hi Tim,

Can I have a question?

I’m not sure whether the usb hub driver has the capability to enumerate child-device,
or all the usb child devices are enumerated by usb host driver?

if usb hub is able to do so, what’s the software process flow in windows kernel’s usb stack?

//dlcu

> Subject: Re: [ntdev] Monitoring plug and unplug USB device
> To: xxxxx@lists.osr.com
> From: xxxxx@probo.com
> Date: Thu, 3 Sep 2015 11:01:01 -0700
>
> Mark Shnaider wrote:
> >
> > Hello,
> >
> > I have read discussions about Usb filter driver and monitoring USB
> > device.
> >
> > If I understand correctly there isn’t a way in the filter driver for
> > monitoring plug and unplug USB device, as Mark Roddy wrote:
> >
> >
> >
> > You have to attach your filter driver to each pdo enumerated by each
> > hub device.This is known as a “bus filter driver” and is undocumented
> > and unsupported by Microsoft, but if you search this list you will
> > find plenty of discussion and documentation.f
> >
> > If you just want to monitor usb devices and do not need to capture usb
> > data traffic you can do that from user mode, see the usbview app in
> > the WDK.
> >
>
> Are you asking a question, answering a question, or just making a speech?
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</http:>

DL CU wrote:

I’m not sure whether the usb hub driver has the capability to
enumerate child-device,
or all the usb child devices are enumerated by usb host driver?

if usb hub is able to do so, what’s the software process flow in
windows kernel’s usb stack?

There’s nothing special about USB in this regard. The process is
exactly the same as every other bus driver. Any PnP driver can create
child devices. When you have a device that needs a driver, you notify
PnP. PnP then asks you what your current child device list is, and from
that it figures out which ones are new and which ones are gone. It then
starts the process of loading a driver.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.