Dmitry Fleytman
bd7c2fd950
UsbDk: Simplify QDR processing
...
QDR processing greatly simplified by using "Forward-Wait-Process"
scheme instead of "Forward-Completion-Workitem-Process".
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
fada79a253
UsbDk: Introduce CIrp::ForwardAndWait
...
A generic function for sending IRP synchronously
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
c4781f5a0a
UsbDk: Fix filter device context leak
...
Fixed leak of filter device context memory
on non-filtered device traversal.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
51b02ec56c
UsbDk: Fix children devices removal
...
Removal of control device requires passive level.
Children device list is locked and its enumeration
is performed on IRQL raised by lock which is a problem
for children removal case.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
fe447f627d
UsbDk: CIrp: Set event for async. completions only
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
780ea265cd
UsbDk: Make CWdmDeviceAccess return non-paged buffers
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
b9222c825a
UsbDk: Create redirector as control device, not PDO
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
bdeaae2b8e
UsbDk: Util: static buffer duplication function
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
d3c4ba2cd5
UsbDk: Fix CMemoryBuffer leaks
...
Make destructor virtual to avoid the classical problem
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
3ab3ebf502
UsbDk: make string comparator work on any IRQL
...
Do not use RtlCompare...String() functions because
they require PASSIVE_LEVEL.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
4e201d269f
UsbDk: Introduce ARRAY_SIZE macro for kernel mode
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
e4e10ca028
UsbDk: Filter device - store driver handle
...
Driver handle will be needed for redirector devices creation
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
f240ed2f29
UsbDk: Simplify redirector device init code
...
Make INIT and DEVICE classes friends to allow
INIT class access DEVICE callbacks directly.
Do not pass callback pointers from DEVICE to its INIT
via function parameters.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
bae8efb419
UsbDk: Trivial: remove dead code
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
2b6266aa10
UsbDk: Fix redirector device cleanup
...
Do not delete explicitely, use CWdfDevice::Delete()
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
2f94f30148
UsbDk: Trivial: fix control device traces
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
499019813b
UsbDk: Fix control device cleanup
...
Delete control device object on CleanupContext callback
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
396ee1ed68
UsbDk: Fix CWdfDevice class destruction
...
Proper WDF object destruction scheme is following:
1. WdfObjectDelete
2. WDF waits for all object counter to become zero
3. WDF calls ContextCleanup callback
4. ContextCleanup deletes all pointers in context
If CWdfDelete instance deleted explicitely context cleans up too early.
This patch introduces CWdfObject::Delete() function to be used instead
of delete operator.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
4db384084e
UsbDk: Generalize CRefCountingHolder class
...
Make object delete function configurable
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
010e4c2cf1
UsbDk: Generalize CObjHolder class
...
Make object delete function configurable
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
f2b1a12610
UsbDk: CObjHolder: Replace NULL with nullptr
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
5abd2b78c1
UsbDk: CPreAllocatedDeviceInit: Make minor functions array const
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
871c77ef82
UsbDk: Fix incorrect indentation
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
c6c5c88f20
UsbDk: Encapsulate redirector device into child device
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
0d87c0a69b
UsbDk: RedirectorDevice: Drop OS object accessor
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
c760152fd6
UsbDk: WdfDevice: Add accessors for OS objects
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
2db3b5c961
UsbDk: Additional traces in redirector logic
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
864f65021e
UsbDk: Rename RedirectorPDO -> RedirectorDevice
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
090c69bc73
UsbDk: Move redirector classes to a separate file
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
74c65795e1
UsbDk: Create symlink for redirector PDO
...
This patch creates symlink to allow user mode access to the device.
Symlink name is constant for now, to be changed in future commits.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
82960229b8
UsbDk: Name redirector PDO to allow symlinks
...
Device must have a name to create symlink pointing to it.
Device name is const and temporary, to be changed in future commits.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
d65b779fee
UsbDk: Move device names to a separate file
...
Move name strings definitions into a separate header
file to avoid unnecessary interdependencies while
accessing those strings from driver
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
172269f3b7
UsbDk: IRP_MJ_PNP callbacks for redirector device
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
7f2e713047
UsbDk: Extend redirector device configurations
...
Make redirector device PDO raw
Add preprocessing callback for IRP_MJ_PNP
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
72fc6cc3a2
UsbDk: Preprocess callback registration functions
...
Introduce overloaded functions for different cases of
WDF device preprocess callbacks registration
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
a1fa86148b
UsbDk: Drop unused driver interface GUID
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
4b1bcc5ecc
UsbDk: Add context cleanup for redirector PDOs
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
84a2ef8762
UsbDk: Test control device queue allocation result
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
871bbe335c
UsbDk: Redirector PDO creation and propagation
...
New PDO is created and passed to PnP manager
No code for redirected device yet
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
d9e2433635
UsbDk: Make child PDO reference counting external
...
CUsbDkChildDevice should not reference PDO for caller.
It is up to caller to reference PDO when needed.
This change simplifies CUsbDkChildDevice class and
makes its interface more flexible
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
d0a833584f
UsbDk: Introduce redirector PDO class
...
Minimal implementation - create logic only
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
1dc45a2c3d
UsbDk: Control device: redirection list access API
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
3d58cc6f75
UsbDk: Make CWdfDevice more generic
...
Control-device creation related logic moved
to corresponding class
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
e8d4b3e107
UsbDk: Make CWdfDevice cleanup safe
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
9c6c939a48
UsbDk: Filter: Preserve existing devices on QDR
...
USB devices list must be synchronized with QDR, not recreated.
Will be required by future patches to preserve redirection state
of specific device during QDR processing.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
17a328fb71
UsbDk: USB devices lists synchronization logic
...
This patch introduces logic for synchronization of our USB
devices list with DEVICE_RELATIONS structure received on QDR.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
ed5be722ea
UsbDk: Introduce PDEVICE_RELATIONS wrapper
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
76387cf611
UsbDk: Fail redirection of non-existing devices
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
1e946679ef
UsbDk: Introduce CUsbDkControlDevice::EnumUsbDevicesByID
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
524371a265
UsbDk: Filter device: Rename m_ChildDevices m_ChildrenDevices
...
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00