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>
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>
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>