Commit graph

23 commits

Author SHA1 Message Date
Yuri Benditovich
d902e99a2a Use lower device for queries during initialization
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>
2017-07-12 16:49:32 +03:00
Dmitry Fleytman
8624b1e0b6 WdfDevice: Add printout on device destruction
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-02-15 15:54:58 +02:00
Dmitry Fleytman
f5de68b75d WdfDevice: Fix severity of information printout
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-02-15 15:53:58 +02:00
Dmitry Fleytman
e46947dd23 UsbDk: Make USB transfers execute at dispatch level
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>
2015-12-24 10:35:34 +02:00
Dmitry Fleytman
192195f6f2 CWdfDevice: Pacify excessive traces
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 12:32:39 +02:00
Dmitry Fleytman
2cac450d17 UsbDk: Drop uneeded dynamic memory allocations 2015-11-24 12:32:35 +02:00
Dmitry Fleytman
2316e20751 WdfDevice: Cache device name on creation
Needed to allow user mode handle creation attempts
after underlying WDF device deletion.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 12:32:32 +02:00
Dmitry Fleytman
cbd15f5d55 ControlDevice: Do not process AddRedirect in IoInCallerContext
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>
2015-11-24 12:20:23 +02:00
Pavel Gurvich
77131d9ff5 UsbDk: fix traces on user mode handle creation
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>
2014-07-02 18:10:29 +03:00
Dmitry Fleytman
c95fb22cdb UsbDk: Introduce more CWdfDevice methods
Newly introduced:
    CreateUserModeHandle()
    Reference()
    Dereference()

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-06-12 00:54:35 +03: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
34dea22308 UsbDk: Separate transfer and configuration requests processing
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>
2014-05-26 18:41:14 +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
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
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
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
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
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
ac848be907 UsbDk: Introduce CPreAllocatedDeviceInit class
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
7ef0b11c79 UsbDk: Fix control device default queue creation
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
4847928216 UsbDk: CDeviceInit/CWdfQueue: fix error tracing
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
3eca24570d UsbDk: Introduce generic WDF device wrappers
Classes for WDFDEVICE, WDFQUEUE, WDFDEVICEINIT introduced

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:09 +03:00