summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-02-27build: fix build of Debug_NoSignHEADv1.00-22masterYuri Benditovich1-1/+1
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-27build: remove binary DLL from the repositoryYuri Benditovich3-1/+6
Collect all the 'before-build' actions in single batch file. Download the DLL required for AppVeyor during the build. Remove the DLL from the repository. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-27driver: bring device to D0 before redirectionYuri Benditovich4-8/+39
Device redirection often fails when the device is in D3/D2 when we start redirecting it. Current commit brings the device to D0 before sending 'cycle power' command to the device port if the device is in low power mode at the moment of starting redirection. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-27driver: add procedure for getting power data by PDOYuri Benditovich3-1/+21
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-27driver: fix driver verifier assertion in FileCreate callbackYuri Benditovich1-3/+11
Previous commit 4de57a9ff causes driver verifier assertion with latest Windows builds. Note that this assertion is not in latest WDF sources on GitHub. The verifier does not allow to forward the MJ_CREATE requestto local IO target using "send-and-forget". It requires the request to set completion callback. There is an option to remove the file create callback at all, but we prefer to have printout on file open for better diagnostics. So we add completion callback for forwarded request and complete the request in it. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-26build: adjust appveyor scriptYuri Benditovich2-2/+1
Discard wdf folder renaming, it is not needed. Discard WiX renaming, we use WIX environment variable. Populate proper VS2015 build DLL. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02build: fix build of TMF filesYuri Benditovich1-2/+27
tracepdb utility does not work as expected, it overrides TMF file with each processed PDB file. Build each TMF file separately and concatenate all the TMF files to one. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02installer: Use WIX environment variableYuri Benditovich1-8/+8
Use %WIX% instead of absolute path Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: pass current process id in file close flowYuri Benditovich1-1/+2
https://github.com/daynix/UsbDk/issues/81 OnClose -> RemoveRedirect -> NotifyRedirectorRemovalStarted NotifyRedirectorRemovalStarted passes process id to ModifyOne in order to avoid stopping redirection if another not related process just opens the filter device and then closes it. Example (before this commit): Start VM and use remote-viewer to it. Separate application 'App' registers notification on USB device interface arrival. When new device comes, the application opens a file using symbolic link name and closes it. Redirect USB device to VM. The UsbDk forces device to be reenumerated. Open-close operation from the 'App' unexpectedly discards device redirection. After this commit: because the 'App' process is not an owner of the redirection, OnClose will not cause removal of the redirection. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: extend ModifyOne templateYuri Benditovich1-2/+10
Add optional process id parameter to the template arguments. If process id is provided, the entry will be additionally checked for match of owner process id saved in the redirection object and caller process id. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: maintain owner process id field of CUsbDkRedirectionYuri Benditovich2-0/+12
Set owner process id when device redirection successfully established (i.e. filter device is open and respective user mode handle created for the process). Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: add log on filter file closeYuri Benditovich1-0/+1
Currently we stop redirection when filter device file handle closed. This might be incorrect if some application just opens and closes the file. Log entry with process id will help diagnosing such problems. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: add file open callback for tracingYuri Benditovich2-1/+15
Add callback when filter device receives file open request. Propagate open operation down the stack and log it. ETW log will contain process id of open request. It is possible that more than one process opens the device. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: prevent access to already deleted objectYuri Benditovich1-0/+8
https://github.com/daynix/UsbDk/issues/81 If during redirection the redirection object is deleted we may try accessing the deleted object in the loop of attempts to create the redirection handle. To avoid this we reference the redirection object until the redirection request completely satisfied or failed. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: add printout on redirection object deletionYuri Benditovich1-0/+1
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2020-01-02driver: add optional message to Dump() procedureYuri Benditovich2-3/+4
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15Hider API: add ability to delete all persistent rulesv1.00-21Yuri Benditovich5-2/+78
The application that uses Hider API does not have an ability to query which persistent rules exist. So in order to use UsbDk_DeletePersistentHideRule the application shall guess which rule it needs to delete. Current commit adds ability to delete all existing the persistent rules. This API requires administrative privileges as all APIs related to persistent hide rules. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15Add documention for extended Hider featureYuri Benditovich1-0/+83
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15Use also extended rules to decide whether device should be hiddenYuri Benditovich3-5/+54
Extended rules processing uses bitmask OR between device type determination bitmap and class/type bitmap provided in 'Class' parameter of the extended rule. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15Load extended rules in the driverYuri Benditovich2-4/+36
Load dynamic and persistent rules with type == 1 to extended rules sets. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15Add ability to dump rules with configurable trace levelYuri Benditovich2-4/+5
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15hider: calculate device type bitmask for each child deviceYuri Benditovich3-3/+132
Device type bitmask is calculated for device class and classes of all its interfaces by narrowing set of device classes to set of device types. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15hider: maintain additional extended hiding rulesYuri Benditovich2-0/+3
Add set of dynamic and persistent rules for advanced device hiding feature. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15implement UsbDkController operations for extended rulesYuri Benditovich1-20/+31
Extending UsbDkController commands by adding 'Type' parameter. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15implement read/write/compare operations for extended rulesYuri Benditovich2-1/+5
This commit adds implementation of registry operation for extended rules in user-mode. Kernel driver still recognizes all the entries as default ones (it ignores the Type value). Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15extend Hider API by adding extended hide rulesYuri Benditovich2-5/+80
Added: UsbDk_AddExtendedHideRule UsbDk_AddExtendedPersistentHideRule UsbDk_DeleteExtendedPersistentHideRule All existing APIs continue working as before. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15Preparation for extended rules for device hideYuri Benditovich4-18/+78
Extend structure USB_DK_HIDE_RULE by adding 'Type' member derived from backward-compatible structure USB_DK_HIDE_RULE_PUBLIC. Public API procedures of UsbDkHelper receive USB_DK_HIDE_RULE_PUBLIC describing hiding rules. Internally UsbDk works with extended structure. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15MSI installer: add ability to suppress message boxesYuri Benditovich1-1/+3
Added option MSGBOX=n to MSI package that forces the installer to run without pop-up message boxes in case of failure or request to reboot. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-15InstallHelper: optionally suppress message boxesYuri Benditovich1-6/+26
Add optional command-line parameter to suppress message box in case the installation requires reboot or aborted. This supports use case when the UsbDk is installed along with other product and restart is required regardless installation status of UsbDk. When installation helper runs with -in or -iN, the message boxes are suppressed. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-01-29Populate initial packet length in ISOCH OUT URBYuri Benditovich1-0/+11
https://github.com/daynix/UsbDk/issues/66 According to interface definition, the UsbDk shall return actual length on transfer completion. For isoch OUT transfers the controller does not return it on respective URB field on Win10 and the updated WDK documentation states this field is not used for ISOCH OUT transfers. Current commit populates the initial packet length in the URB, making the result consistent on both Win7 and Win10. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-01-27Updated MAINTAINERS fileYuri Benditovich1-3/+5
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-01-27Update project files for build with higher WDK installedYuri Benditovich6-0/+39
When higher WDK than 14393 is installed on the machine, the modified files related to build of drivers and driver-related applications may produce errors on build using VS2015. Fixed project files solve this. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2018-10-17Report superspeed properly on Win7Yuri Benditovich1-0/+9
Win7 with USB 3.0 stack might not report superspeed the same way as Win8 does. Use bcdUSB field of device descriptor for that (USB 3.0 device connected to USB 2.x port usually falls to USB 2 compatible configuration). Getting the speed from HUB driver via IOCTL is more complicated. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2018-10-10Prevent USB operation with non-USB devicesYuri Benditovich1-20/+26
This commit aims to address https://bugzilla.redhat.com/show_bug.cgi?id=1575043 The driver definitely may try accessing USB device where it is not USB and sending 'Submit URB' IOCTL down the stack may cause unpredictable result. Current commit change the order of checks when the device is enumerated by its parent device: first ensure this is USB device, then try to get USB-specific information. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2018-10-10Revert commit f2dae22029e2c8d2cd94577aa40bdcee84d31bc0Yuri Benditovich1-0/+5
This reverts previous commit that actually has removed the check that the driver is accessible. Prior to removal this at least should be investigated in corner cases which are also to be defined (like UsbDk uninstall when it has active redirected device). Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2018-04-11Delete unused local variablegolden1-1/+0
Closes #56
2017-07-12Use lower device for queries during initializationYuri Benditovich3-1/+14
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-06-07ci: Integrate with AppVeyorDmitry Fleytman2-0/+21
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
2017-05-29Installer: Abort installation if the driver fails to startSameeh Jubran6-1/+53
Currently, in some cases, attempting to start the driver can fail and cause Usb devices to become non functional. An example of such case is attemteting to install an unsigned version of UsbDk on Windows where the driver signature enforcement is enabled. The reason why this happens is not making sure the driver can start on the system prior to attaching it to all of the devices. This patch solves this issue by checking that the driver can start on the system prior to step 2 in the list below. UsbDk's installation process: 1) Create and register UsbDk's service 2) Add UsbDk to the registry 3) Reset all Usb host conrollers on the system 4) PNP manager attaches and starts the driver for each Usb device's stack Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-05-29ServiceManager: Add Start and Stop methodsSameeh Jubran2-13/+34
Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-05-29Documentation: Update tracing documentationYuri Benditovich1-2/+16
Include getting traces using logman and converting binary traces to text using installed TMF file. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-05-29tools: Add BAT file for recording of binary traceYuri Benditovich1-0/+14
Existing batch file records binary trace using TraceView that shall be copied from WDK, which is not always installed on end user machine. Added batch file allows recording without additional tools, using built-in logman application. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-05-29build: Include TMF file to installation packageYuri Benditovich1-0/+6
Single TMF file contains all the data required for converting binary trace to text for all the operating systems. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-05-29build: Build TMF files after building all binariesYuri Benditovich1-0/+10
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-05-25Documentation: Add Uninstallation.txtSameeh Jubran1-0/+40
Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
2017-04-06Build: Introduce debug configurations without test signingv1.00-19v1.00-18Dmitry Fleytman10-4/+2663
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
2017-04-03Documentation: Update for VS 2015 and Windows 10Sameeh Jubran2-5/+7
Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-04-03Build: Add Windows 10 to MSISameeh Jubran1-1/+17
According to msdn [1]: "When you install an .msi installation package on Windows 10 or Windows Server 2016, the VersionNT value is 603." which is the same value for Windows 8.1. In order to differentiate between Windows 8.1 and Windows 10 the trick in [2] was used. [1] https://support.microsoft.com/en-us/help/3202260/versionnt-value-for-windows-10-and-windows-server-2016 [2] http://stackoverflow.com/questions/31932646/versionnt-msi-property-on-windows-10 Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-04-03Build: Delete unnecessary build configurationsSameeh Jubran1-64/+0
This commit deletes "Release" and "Debug" build configuration which weren't used. Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-04-03Build: Migrate to VS 2015 and add Win10 configurationsSameeh Jubran13-4658/+5930
This commit migrates from VS 2013 to VS 2015. Beside the auto conversion which was performed by VS this commit includes the following fixes which enabled the builld to work: Win (7, 8, 8.1, 10): * Set the KMDF Version Major to 1. * Set the KMDF Version Minor to 11. Win XP: * Add _When_ define. * Add empty implementation to guard functions which else would cause an unresolved symbols. * Add path to WinDDK's wdfinstaller.h in UsbDkHelper project. * Add "GetDriverProjectAttributes" and "GetPackageFiles" targets to UsbDkController, UsbDkHelper and UsbDkInstHelper project files. Signed-off-by: Sameeh Jubran <sameeh@daynix.com> Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>