Prev: INF Questions ()
Next: Default struct alignment
From: elman on 12 Feb 2010 15:24 Hi, Does anyone know how to create a simple usb filter driver, all it does is when it receives a specific DeviceIoControl command from my application it will send a RESET command to the usb port for a particular usb device so that it will effectively power cycle that device ? I am not too familiar with filter drivers, how do i create one and how to install it so that its filtering all usb devices ?
From: Tim Roberts on 13 Feb 2010 15:16 elman <elmanlopez(a)gmail.com> wrote: > > Does anyone know how to create a simple usb filter driver, all it >does is when it receives a specific DeviceIoControl command from my >application it will send a RESET command to the usb port for a >particular usb device so that it will effectively power cycle that >device ? > I am not too familiar with filter drivers, how do i create one and >how to install it so that its filtering all usb devices ? Filter drivers are not hard -- there are several samples in the WDK. However, you do not need a filter driver for this. You can send IOCTL_USB_HUB_CYCLE_PORT to the hub to force a disconnect and reconnect. -- Tim Roberts, timr(a)probo.com Providenza & Boekelheide, Inc.
From: Kerem Gümrükcü on 13 Feb 2010 15:32 Hi Tim, thats a good idea, but AFAIK this is not available on Vista and 7 anymore,... Maybe a DICS_PROPCHANGE from Usermode to the particular Device Intance can do the job too, by using DIF_PROPERTYCHANGE and class params "SP_PROPCHANGE_PARAMS:: StateChange" set to DICS_PROPCHANGE. This will restart the device,...just maybe! Regards Kerem -- ----------------------- Beste Gr�sse / Best regards / Votre bien devoue Kerem G�mr�kc� Latest Project: http://www.pro-it-education.de/software/deviceremover Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "Tim Roberts" <timr(a)probo.com> schrieb im Newsbeitrag news:pq1en5h3ll217661r5o70at7u8e1du117p(a)4ax.com... > elman <elmanlopez(a)gmail.com> wrote: >> >> Does anyone know how to create a simple usb filter driver, all it >>does is when it receives a specific DeviceIoControl command from my >>application it will send a RESET command to the usb port for a >>particular usb device so that it will effectively power cycle that >>device ? >> I am not too familiar with filter drivers, how do i create one and >>how to install it so that its filtering all usb devices ? > > Filter drivers are not hard -- there are several samples in the WDK. > However, you do not need a filter driver for this. You can send > IOCTL_USB_HUB_CYCLE_PORT to the hub to force a disconnect and reconnect. > -- > Tim Roberts, timr(a)probo.com > Providenza & Boekelheide, Inc.
From: elman on 15 Feb 2010 12:56 @Tim, Yes Kerem is right, IOCTL_USB_HUB_CYCLE_PORT is no longer available on windows 7 according to the msdn docs, maybe there is something else ? I am just downloading the WDK, btw which example has a filter driver on it ? also how do I install a filter driver so that its for all usb devices and does it auto add itself as a filter to any new usb devices that will be installed in the future ? or do I need to run the installer again to add the filter to those new usb devices ? @Kerem, I am already using DICS_PROPCHANGE but it only works if the device is not being used or hung.
From: Kerem Gümrükcü on 16 Feb 2010 01:05 Ok, what about this: [WinUsb_ResetPipe] http://msdn.microsoft.com/en-us/library/aa476447.aspx I am not really sure if this will work for you, since it is not really clear to me what exactly will be reseted here. Maybe someone can explain,... There are WMI classes but they say, that they have not been implemented so far: http://msdn.microsoft.com/en-us/library/aa388644%28VS.85%29.aspx#methods http://msdn.microsoft.com/en-us/library/aa394504%28VS.85%29.aspx#methods Regards Kerem -- ----------------------- Beste Gr�sse / Best regards / Votre bien devoue Kerem G�mr�kc� Latest Project: http://www.pro-it-education.de/software/deviceremover Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "elman" <elmanlopez(a)gmail.com> schrieb im Newsbeitrag news:68fe846f-91bf-4bfe-85fc-d54a811fc5e8(a)s36g2000prh.googlegroups.com... > @Tim, > Yes Kerem is right, IOCTL_USB_HUB_CYCLE_PORT is no longer available > on windows 7 according to the msdn docs, maybe there is something > else ? > I am just downloading the WDK, btw which example has a filter driver > on it ? also how do I install a filter driver so that its for all usb > devices and does it auto add itself as a filter to any new usb devices > that will be installed in the future ? or do I need to run the > installer again to add the filter to those new usb devices ? > > @Kerem, I am already using DICS_PROPCHANGE but it only works if the > device is not being used or hung.
|
Pages: 1 Prev: INF Questions () Next: Default struct alignment |