From: Jason K. <jas...@gm...> - 2015-03-05 01:57:43
|
Dmitry - I have successfully applied the patches. One thing to note, is you need to regenerate the configure scripts, so ./autogen.sh or bootstrap. Configured successfully, but I can’t compile. I needed to do the following: diff --git a/libusb/os/windows_usbdk.c b/libusb/os/windows_usbdk.c index 9d56da1..5e82538 100755 --- a/libusb/os/windows_usbdk.c +++ b/libusb/os/windows_usbdk.c @@ -23,11 +23,13 @@ #include <config.h> #include <stdio.h> -#include "ntstatus.h" +//#include "ntstatus.h" +#include <ddk/ntstatus.h> #include "libusbi.h" #include "windows_usbdk.h" -#include "cfgmgr32.h" +//#include "cfgmgr32.h" +#include <ddk/cfgmgr32.h> #include "windows_common.h" #include "windows_nt_common.h" After that, there are undefined enums: os/windows_usbdk.c: In function 'win_backend_get_overlapped_result': os/windows_usbdk.c:818:22: error: 'STATUS_REQUEST_CANCELED' undeclared (first use in this function) os/windows_usbdk.c:818:22: note: each undeclared identifier is reported only once for each function it appears in Thanks, would love to try this, let me know what I’m missing. Very Sincerely, Jason > On Mar 4, 2015, at 12:33 AM, Dmitry Fleytman <dm...@da...> wrote: > > > Hi Xiaofan, > >> On Mar 4, 2015, at 02:08 AM, Xiaofan Chen <xia...@gm...> wrote: >> >> On Tue, Mar 3, 2015 at 1:59 AM, Dmitry Fleytman <dm...@da...> wrote: >>> Some distinctive UsbDk properties are: >>> >>> 1. UsbDk supports all types of devices and interfaces - bulk, isochronous, >>> composite, HID etc. >>> 2. Device capture process is totally dynamic, i.e. no inf files and >>> self-signing needed, any device can be captured. >>> 3. UsbDk co-exists with original device driver, when the device is not >>> captured original driver is loaded by the system automatically. >>> 4. If user mode client terminates unexpectedly for any reason system reverts >>> to original device driver immediately. >>> 5. Being USB filter driver UsbDk doesn't require WHQL-ing >>> as per Microsoft requirements. >> >> From the above, it seems to me that when the device >> is captured, the original device driver is not loaded. >> So it is not really "co-exists", right? It seems to me it >> is more a type of dynamic switching of driver. Am I right? > > Exactly. > By co-existance with original driver I meant this dynamic switch ability. > >> >> http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE >> "UsbDk.sys is both USB filter driver and generic USB device driver. >> On installation it is being registered as USB filter driver and >> system invokes it for each new USB device being discovered including >> USB hubs. On invocation UsbDk.sys checks type of underlying device >> and creates filter instances for USB hubs only. >> >> Being a filter of USB hub UsbDk.sys receives all requests from upper >> part of USB stack including enumeration requests that originated by >> PNP manager (IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS)." >> >> The filter mentioned above means actually UsbDk acts as a upper >> filter driver of USB Root Hub, not really a upper filter driver >> of the USB device (which libusb-win32 filter driver is). > > Yes, UsbDk is USB hub filter driver and generic USB device driver, 2 in one. > >> >> "Upon enumeration request completion by USB hub driver UsbDk.sys scans >> array of child devices returned and in case there are devices to be >> redirected (according to current configuration) it attaches as filter >> to those devices as well. >> >> As a result all PNP manager requests pass via UsbDk.sys callbacks and the >> latter patches device ID properties as needed to make PNP manager recognize >> the device as a generic USB device. >> >> Besides that UsbDk.sys marks underlying device object as raw PDO so the system >> assigns the driver who created it (UsbDk.sys) to be the device driver as well." >> >> So it seems that UsbDk only acts as a upper filter driver for the device >> to be captured briefly and then forces re-enumeration of the device and >> then act as a device driver. Am I right? > > Exactly. > >> >> In that case, it seems UsbDk is really useful under Windows to implement >> dynamically attach/detach the UsbDk driver (similar to Linux where >> the original driver can be attached/detached, detached means to use >> usbfs driver). > > Yes, you are right. The thing UsbDk does is pretty much similar to Linux’s attach/detach. > >> >>> >>> Dmitry Fleytman (3): >>> windows: Move common definitions to a separate file >>> usbdk: Introduce usbdk backend >>> build: Integrate usbdk backend >>> >>> configure.ac | 9 + >>> libusb/Makefile.am | 14 +- >>> libusb/core.c | 6 + >>> libusb/libusbi.h | 1 + >>> libusb/os/UsbDk/UsbDkData.h | 100 +++++ >>> libusb/os/UsbDk/UsbDkHelper.h | 239 ++++++++++++ >>> libusb/os/windows_nt_common.c | 572 +++++++++++++++++++++++++++ >>> libusb/os/windows_nt_common.h | 67 ++++ >>> libusb/os/windows_usb.c | 556 ++------------------------ >>> libusb/os/windows_usb.h | 14 +- >>> libusb/os/windows_usbdk.c | 890 ++++++++++++++++++++++++++++++++++++++++++ >>> libusb/os/windows_usbdk.h | 24 ++ >>> 12 files changed, 1944 insertions(+), 548 deletions(-) >>> create mode 100644 libusb/os/UsbDk/UsbDkData.h >>> create mode 100644 libusb/os/UsbDk/UsbDkHelper.h >>> create mode 100644 libusb/os/windows_nt_common.c >>> create mode 100644 libusb/os/windows_nt_common.h >>> create mode 100755 libusb/os/windows_usbdk.c >>> create mode 100644 libusb/os/windows_usbdk.h >> >> Just wondering if the files can be compiled by MSVC. It would >> be good to provide VS solutions files (say VS2013) and >> WDK 7 build files. Take note libusb Windows backend >> supports MSVC along with MinGW.org, MinGW-w64 >> and Cygwin. > > I didn’t know that. Thanks for the information. > I’ll check MSVC build before submitting the next version. > > > ~Dmitry > >> >> >> -- >> Xiaofan > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > libusb-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel |