1. Wait for reset and redirector creation completion on IOCTL handler
2. Return RedirectorID from driver to user mode caller
3. Open corresponding redirector device using RedirectorID returned
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This patch make redirectors notify control device
on creation and destruction. These notifications
are needed to make Add/Remove redirection operations
synchronous from user mode client's point of view.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Just a helper function that fills USB_DK_DEVICE_ID structure
havind DeviceID and InstanceID strings provided.
Available for both user mode and kernel mode.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
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>
This patch makes device enumeration API return array of
device info structures instead of array of device IDs.
This change is needed to return per-device information
in addition to device ID.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This patch implements better scheme for USB device
IDs patching. Instead of replacing PDO on QDR completion
and processing all requests coming to the PDO explicitely
we attach filter device to the PDO and indicate is as-is
to PnP Manager.
WDF implements direct pass-through for all requests
coming to PDO implicitely and we only intercept requests
we really have to filter.
Though both schemes are not fully documented the later
one doesn't require explicit coding to preserve PnP state
machine correctness. It also requires much less code overall.
This patch passed basic verification (install, redirect, uninstall)
with driver verifier.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
API doesn't fill IOSTATUS->STATUS field when IRP
processing finished synchronously. In this case IoCallDriver
returns proper status directly.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
For some requests API requires iostatus->status
IRP field to be initialized with STATUS_NOT_SUPPORTED.
Driver verifier checks this and produces BSOD on violation.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
MatchPrefix() checks whether given string is a prefix
of at least one string held by CRegText object
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Update test application with new interface of UsbDkHelper
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Integrate redirection functionality in driver with UsbDkHelper.
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Make UsbDkDriverAccess inherited from UsbDkDriverFile
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
UsbDkRedirectorAccess is responsible for redirected device interfacing
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
UsbDkDriverFile is responsible for operations on driver symlinks
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Reset should be part of start/stop redirection. No separate API needed
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
QDR processing greatly simplified by using "Forward-Wait-Process"
scheme instead of "Forward-Completion-Workitem-Process".
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
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>