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>
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>
Added:
UsbDk_AddExtendedHideRule
UsbDk_AddExtendedPersistentHideRule
UsbDk_DeleteExtendedPersistentHideRule
All existing APIs continue working as before.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
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>
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>
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>
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>
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>
unpackHandle checks if the provided HANDLE is null or has an
INVALID_HANDLE_VALUE and casts it to the suitable data type.
This check can prevent the UsbDkHelper from crashing becuase of api misuse.
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
This is a cosmetic change that unifies naming convention
in UsbDk public API.
WARNING: This change breaks compilation of client code.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit fixes issues with accessing USB devices on
some USB host controllers.
Before this fix UsbDk assumed IO type NEITHER for
ReadFile/WriteFile operations performed on captured
USB device. This assumption is not true in some cases
because UsbDk creates filter devices which use the
same IO type as device being filtered, i.e. IO type
is effectively defined by USB host controller driver.
While some host controllers work in NEITHER IO mode,
others use DIRECT IO instead. When capturing device
plugged into such a controller UsbDk failed to retrieve
ReadFile/WriteFile buffers because there are different API
used different IO types and UsbDk used the wrond one.
This patch changes UsbDk DLL/Driver interface to use IOCTL
for ReadPipe/WritePipe operations. Since IO type for IOCTL
requests is determined by IOCTL code and not by target device
settings UsbDk need not consider IO type used by the host
controller being filtered.
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit contains user mode adaptations for
driver interface changes introduced by previous commit.
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
With new kernel mode code redirection stops automatically
when redirector handle is closed.
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>