Commit graph

20 commits

Author SHA1 Message Date
Sameeh Jubran
5dda7555c5 Installer: Abort installation if the driver fails to start
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-29 16:45:38 +03:00
Sameeh Jubran
2cd4aa5262 Build: Migrate to VS 2015 and add Win10 configurations
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>
2017-04-03 15:06:47 +03:00
Dmitry Fleytman
a80fa35e1d UsbDkHelper: Fix debug traces for WoW64 operation
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-03-31 11:13:18 +03:00
Dmitry Fleytman
ec04c9a874 trivial: cleanup comments
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-03-25 17:38:00 +02:00
Pavel Gurvich
6c1f136844 UsbDkHelper: Fix processing of reboot needed case on install
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-08-11 13:23:51 +03:00
Dmitry Fleytman
447de6ad71 build: add XP/2003 configurations
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-06-01 23:01:13 +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
Pavel Gurvich
1ca133b506 UsbDkHelper: Fix bug: second install leads to configuration corruption
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:15 +03:00
Dmitry Fleytman
6d5b7151ee UsbDk: Trivial: Replace NULL with nullptr
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:15 +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
8f545c05e8 UsbDkHelper: Do not fail uninstall due to non-existing items to be deleted
Do not fail uninstall if driver file does not exist in windows/system32
Also do not fail uninstall in other cases when something does not exist - i.e. service, UpperFilters entry etc.

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
4041e40878 UsbDkHelper: Beautify exception syntax.
Insert general string to constructor. Add Constructor with error code.

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
48802f27a9 UsbDk: Driver copy/delete function names clarification
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
800676db2b UsbDkHandler: Exception handling beautification
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
4a41a01289 UsbDkHelper: Query UpperFilters value size before read
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Pavel Gurvich
998fd9a996 UsbDkHelper: Introduce DeviceMgr class with reset logic
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
7fa28c0312 UsbDkHelper: Verify UpperFilters zero termination
Bug: Assertion on install/uninstall when UpperFilter
     value is not zero-terminated properly.

Fixed by checking size of registry data.

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:09 +03:00
Pavel Gurvich
c9d093ab2d UsbDkHelper: Fix unhandled exception in case of error
Type of exception should comply to throw type.

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:09 +03:00
Dmitry Fleytman
b36f2a0ac6 UsbDkHelper: Move names definitions to Public.h
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:09 +03:00
Pavel Gurvich
7abe649fbf UsbDk: Add .dll and .exe with installer logic
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:09 +03:00