It is more correct to use lower device in stack for queries
during filter initialization. Lower device is in initialized
state and can process all kinds of requests, when current one is
not ready yet.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Change ExecutionLevel for redirector data queue
to WdfExecutionLevelDispatch.
There is no real reason to force USB transfers exection
on PASSIVE_LEVEL and DISPATCH_LEVEL execution is definitely
faster.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit moves processing of AddRedirect IOCTL from
IoInCallerContext callback of control device to normal
default queue DeviceIoControl callback.
This change eliminates posibility for parallel execution
of AddRedirect and other operations, particularly RemoveRedirect.
Initially AddRedirect was perfomed in IoInCallerContext callback
to open user mode handle to the device being redirected in context
of correct user mode process. This patch achieves the same goal
by storing caller's process handle in request context in
IoInCallerContext callback and duplicating handle to the original
calling process from queue's DeviceIoControl callback.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
During user mode redirector handle creation we wait for
device to appear. During this process we may take a few
unsuccessfull attempts to open device handle.
Do not print error messages for this attempts.
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This makes include policy more strict and ensures
all system includes properly wrapped with extern "C"
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Introduce separate queues for different types of requests:
1. Read/Write queue
2. Configuration (IOCTL) queue
This is needed to stop transfers during reconfiguration.
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
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>
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>