Commit graph

10 commits

Author SHA1 Message Date
Dmitry Fleytman
00cf4cbb04 FilterStrategy: Simplify requests forwarding code
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 12:04:07 +02:00
Dmitry Fleytman
4a0354fdcd UsbDk: Perform ReadPipe/WritePipe via IOCTLs
This commit fixes issues with accessing USB devices on
some USB host controllers.

Before this fix UsbDk assumed IO type NEITHER for
ReadFile/WriteFile operations performed on captured
USB device. This assumption is not true in some cases
because UsbDk creates filter devices which use the
same IO type as device being filtered, i.e. IO type
is effectively defined by USB host controller driver.

While some host controllers work in NEITHER IO mode,
others use DIRECT IO instead. When capturing device
plugged into such a controller UsbDk failed to retrieve
ReadFile/WriteFile buffers because there are different API
used different IO types and UsbDk used the wrond one.

This patch changes UsbDk DLL/Driver interface to use IOCTL
for ReadPipe/WritePipe operations. Since IO type for IOCTL
requests is determined by IOCTL code and not by target device
settings UsbDk need not consider IO type used by the host
controller being filtered.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-10-28 09:11:41 +02:00
Dmitry Fleytman
8e4d181f82 UsbDk: Add debug trace for request enqueue failure
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-10-28 09:11:40 +02:00
Dmitry Fleytman
d5d51dfd47 UsbDk: place all system includes into stdafx.h
This makes include policy more strict and ensures
all system includes properly wrapped with extern "C"

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-06-09 11:50:26 +03:00
Pavel Gurvich
a77d8161e4 UsbDk: Add license-related files and headers
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-20 11:56:20 +03:00
Dmitry Fleytman
8c2b454cae UsbDk: Simplify strategy interface
Make filter strategy methods accept raw WDF requests.
This simplifies overall request handling code.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:15 +03:00
Dmitry Fleytman
ad12e20e12 UsbDk: Introduce generic IO handlers for filter strategy
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:14 +03:00
Dmitry Fleytman
1fef4eee3c UsbDk: Make filter devices receive IoInCallerContext event
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:14 +03:00
Dmitry Fleytman
56c00f7d4b UsbDk: Make base filter strategy reference control device by default
1. Hub filter strategy requires control device to register with it.
2. Redirector strategy will require control device to
send attachment notifications.
3. Null strategy does't require control device.

So it's 2:1 vote ratio to reference filter device by default
and make null strategy override this logic explicitely.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:13 +03:00
Dmitry Fleytman
d9618e05e7 UsbDk: Move abstract filter strategy to a separate file
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:13 +03:00