Commit graph

619 commits

Author SHA1 Message Date
Dmitry Fleytman
31ff0f4bb2 UsbDk: Make CObjHolder accessors const
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
2850bedb27 UsbDkHelper: Trivial: improve printout
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
6ce2f2ff8a UsbDkHelper: Fix devices number on enumeration
Devices number returned on enumeration was incorrect

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
2b2953bc2e UsbDkController: Fix DLL symbols import
Calling convention must be CDECL to import symbols properly

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
cc6412fca9 UsbDkHelper: Fix exports
Calling convention must be CDECL to export symbols properly

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
f4e565be17 UsbDkHelper: Make UsbDk interface files compilable with gcc
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
d0b377d1f7 UsbDk: Trivial: Put FilterDevice traces to proper group
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
0a484ff601 UsbDkController: Commands for start/stop redirection
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
e2275bb0f2 UsbDkHelper: Redirections collection management
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
838d1e3662 UsbDk: Redirections collection management
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
bfa21156bb UsbDk: Introduce class describing redirection entity
CUsbDkRedirection class introduced

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
3d4b8eda14 UsbDkHelper: Isolate common code for some ioctls
All IOCTLs that perform operation on USB device
identified by USB_DK_DEVICE_ID are pretty similar,
common code may be isolated.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
c4e8d29e50 UsbDkHelper: make CDriverAccess::ResetDevice return void
Return value is not needed, function
throws exception in case of error

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
0f4406c1ed UsbDk: Make control device use CWdfRequest
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
53250aec67 UsbDk: Introduce WDFREQUEST wrapper
class CWdfRequest introduced

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
48670040b3 UsbDk: Introduce (unicode) string classes
CStringHolder - for pre-allocated strings
CString - for strings allocated on creation

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
9be84cbed3 UsbDk: Introduce generic set class
class CWdmSet introduced

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
8dab75aecb UsbDkController: Beautifications
1. Debug output removed
2. Better device enumeration format

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
653ce6b4ad UsbDk: Drop ping IOCTL and children dump logic
Debugging code removed.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
2bdf99483e UsbDkController: Add ResetDevice functionality to Controller
Add ResetDevice functionality to Controller

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
9352d2887c UsbDkHelper: Add ResetDevice functionality to Helper
Add ResetDevice functionality to Helper

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
75dfc650a5 UsbDk: Implement ResedDevice IOCTL functionality in kernel
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
488ceb3b29 UsbDk: Comment out PDO cloning logic
Cloning code to be refactored and moved to corresponding classes

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
33bdbde394 UsbDk: Extend CUsbDkChildDevice with PDO and Match()
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
37c665c52b UsbDk: ControlDevice: Make all USB devices enumeration code generic
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
68baf5b6c8 UsbDk: Add conditional USB devices enumeration into filter device class
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
408b46fd15 UsbDk: Add constant predicates
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
bc3fe48519 UsbDk: Make lists return indication of whether iteration was stopped
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
03f1e8d59b UsbDk: Add ForEachIf method into list class
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
8ad530b07d UsbDk: Fix USB devices enumeration
USB devices enumeration logic  placed device information
into output buffer improperly

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Dmitry Fleytman
2f421af937 UsbDk: Introduce USB WDM device access class with reset logic
class CWdmUsbDeviceAccess introduced

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:11 +03:00
Pavel Gurvich
395491d18d UsbDk: Introduce class for DeviceIoControl IRPs
class CIoControlIrp added

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
d2dc75c14b UsbDk: Fix CIrp cleanup
Do not hold target device reference in case IRP allocation failure

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
dd4cfefbe9 UsbDk: CIrp beautifications
NULL --> nullptr
VOID --> void

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
a60dffc87a UsbDk: Make CIrp use CWdmEvent
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
462c365327 UsbDk: CDeviceAccess class factory dropped
Doesn't bring any added value, just makes code more complex

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
1061862779 UsbDk: Introduce WDM event class
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
5fc743fc07 Global: Adding .gitignore to repository
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
dc831178e5 UsbDk: Couple of build warnings fixed
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
9069176985 UsbDkController: add device enumeration to test application
Add device enumeration to UsbDkController

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
c0bf20d715 UsbDkHelper: add EnumerateDevice functionality to UsbDkHelper
Add flow of device enumeration to DriverAccess

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
139457073b UsbDk: add enumeration of USB devices to ControlDevice
Add functionality to ControlDevice that allows counting and enumerating USB devices

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
771555ed40 UsbDk: prepare FilterDevice for device enumeration
FilterDevice: fix functions of CUsbDkChildDevice;
add GetChildrenCount() to CUsbDkFilterDevice;
Make m_ChildDevices counting list

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
ce2c4e5ea7 UsbDk: Make list enumeration interruptible
Functor may return false to stop enumeration

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
8539bed118 UsbDkHelper: Improve exception messages
Add newline after exception message.

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
cd3c207b03 UsbDkHelper: Do not fail DeleteServiceObject when service does not exist
Return when OpenService fails because service does
not exist

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
ef0c3d33b9 UsbDkHelper: Add time flow to architecture doc
Add time flow of Time flow after reset USB Host Controller (or reboot of machine),
Time flow of configuration UsbDk driver,
Time flow of enumeration after reset specific device

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
440221e5b4 UsbDkHelper: Restrict install/uninstall under WoW64
Add check that user is not trying to install 32 bit package on 64 bit system

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
0f9d483c6f UsbDkHelper: Do full roll-back on install failure.
Run uninstall process if installation failed.

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
81180a2a83 UsbDkHelper: Print both error message and error number.
Print both error message and error number returned from GetLastError() on exception.

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00