Skip to content

Commit b5c2bfa

Browse files
nefariusSyniurge
authored andcommitted
Updated build settings and documentation (#7)
- Fixed build error occurring with latest WDK version - Flattened signing settings - Removed test certificate - Adapted README to reflect signed binary downloads - Renamed solution - Introduced version information - Added ViGEm signing helper scripts and documentation
1 parent c467d97 commit b5c2bfa

16 files changed

+1787
-102
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
################################################################################
2+
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3+
################################################################################
4+
5+
/sys/Debug
6+
/nvshldctrl.VC.VC.opendb
7+
/nvshldctrl.VC.db
8+
/hidusbfx2.VC.db
9+
/.vs/nvshldctrl/v14/.suo
10+
/.vs/nvshldctrl/v14
11+
/sys/Release/nvshldctrl.tlog
12+
/sys/Release/nvshldctrl
13+
/sys/Release
14+
/sys/x64/Release
15+
/sys/x64/Debug

README.md

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
**IMPORTANT: this driver doesn't support the 2017 Shield Controller yet. Support is planned but until then, the new model is already partially supported out-of-the-box by the generic Windows driver.**
22

3-
NVIDIA Shield Controller Windows driver
4-
=======================
3+
# NVIDIA Shield Controller Windows driver
54
This small USB filter driver intercepts and tweaks the HID Report Descriptor to make DirectInput detect it as a gamepad. It also emulates a force feedback device for rumble support in both DirectInput and Xinput games, tweaks the input data of the trackpad to make it usable, and adds support for the volume increment/decrement buttons.
65

76
NVIDIA previously released a driver that was bundled with GeForce Experience and only usable by NVIDIA graphics card users, and also suffered from a variety of issues according to forum discussions. Excluding AMD and Intel graphics card owners has made a lot of people extremely displeased. I've bought Tegra hardware (nVidia Shield tablet and Jetson) and used to applaud their open source efforts, but screwing their game controller buyers like this makes me regret my decision.
87

9-
What was the issue?
10-
--------------
8+
## What was the issue?
119
The controller is a HID-compliant game controller, it's supported out-of-the-box on Linux and applications accessing it through raw HID. So theoretically it should be supported by generic Windows drivers, but it wasn't being detected by DirectInput.
1210

1311
By playing with the `vhidmini` driver from the DDK which provides a virtual HID device, I managed to find what prevented the detection inside the HID Report Descriptor:
@@ -39,35 +37,10 @@ Finally, the trackpad input gets tweaked to work like a standard trackpad, and b
3937

4038
Making this driver was helped tremendously by `usbhid-dump`, `hidrd-convert`, UsbLyzer, Wireshark, the `gc_n64_usb` firmware source code, and the vague yet helpful instructions that someone who managed to change a USB descriptor gave on the ntdev mailing-list.
4139

42-
Binaries (Windows 7 and later)
43-
--------------
44-
* 64 bits: http://homo-nebulus.fr/shieldcontrollerusbfilter/ShieldControllerDriver_64.zip
45-
* 32 bits: http://homo-nebulus.fr/shieldcontrollerusbfilter/ShieldControllerDriver_32.zip
46-
47-
Installation and signing issue
48-
--------------
49-
50-
The driver is test-signed (signing a driver for public release would cost me $260), test-signed drivers must first be enabled:
51-
52-
1. Open the task manager (`Ctrl+Alt+Del`)
53-
2. *File* -> *Run new task*
54-
3. Type "cmd", check "Create this task with administrator privileges"
55-
4. Run the following command: `Bcdedit.exe /set TESTSIGNING ON`
56-
5. Reboot
57-
58-
You should see "Test mode" in the bottom-right corner of the desktop. Sorry about that, but Windows will now let you install and load the driver.
40+
## Binaries (Windows 7 and later)
41+
[Download latest release](https://github.com/nefarius/ShieldControllerWinDriver/releases/latest).
5942

43+
## Installation
6044
To install the driver right-click on the .inf file and select `Install`.
6145

62-
The generic driver still takes precedence over test-signed drivers, so you now have to manually select the driver for your Shield controller in the device manager. First display devices by connection, so you can find your controller easily:
63-
64-
![alt text](https://github.com/Syniurge/ShieldControllerWinDriver/blob/master/doc/DevMgrByConnection.png "DevMgrByConnection")
65-
![alt text](https://github.com/Syniurge/ShieldControllerWinDriver/blob/master/doc/ShieldControllerPID.png "ShieldControllerPID")
66-
67-
Then select the **root** `USB input device` node and choose "Update the driver..", and then:
68-
69-
![alt text](https://github.com/Syniurge/ShieldControllerWinDriver/blob/master/doc/ShieldCtrlDriverStep1.png "ShieldCtrlDriverStep1")
70-
![alt text](https://github.com/Syniurge/ShieldControllerWinDriver/blob/master/doc/ShieldCtrlDriverStep2.png "ShieldCtrlDriverStep2")
71-
![alt text](https://github.com/Syniurge/ShieldControllerWinDriver/blob/master/doc/ShieldCtrlDriverStep3.png "ShieldCtrlDriverStep3")
72-
73-
Finally disconnect and reconnect the controller as switching drivers sometimes causes problems. It should now be detected as a DirectInput gamepad, in games, x360ce, etc.
46+
Disconnect and reconnect the controller as switching drivers sometimes causes problems. It should now be detected as a DirectInput gamepad, in games, x360ce, etc.

Signing/Readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# How to production-sign for Windows 7 to 10
2+
3+
**Note:** the scripts and commands listed here are customized for my needs, adjust accordingly and use with care.
4+
5+
1. Run `SIGN4PORTAL.CMD`
6+
2. Upload the resulting `*.cab` files to the [Microsoft portal](https://developer.microsoft.com/en-us/dashboard/hardware/Driver/)
7+
3. Download signed files from portal
8+
4. Extract contents and move to folder containing the files
9+
5. Append EV-Signature to binaries with `signtool sign /v /ac "C:\Program Files (x86)\Windows Kits\10\CrossCertificates\GlobalSign Root CA.crt" /n "Wohlfeil.IT e.U." /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /fd sha256 /td sha256 /as *.sys *.dll`
10+
6. Remove catalog files provided by Microsoft
11+
7. Create new catalog files with `Inf2Cat.exe /driver:"." /os:8_X64,8_X86,Server8_X64,Server2008R2_X64,7_X64,7_X86,10_X86,10_X64,Server10_X64`
12+
8. Sign new catalog files with `signtool sign /v /ac "C:\Program Files (x86)\Windows Kits\10\CrossCertificates\GlobalSign Root CA.crt" /n "Wohlfeil.IT e.U." /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /fd sha256 /td sha256 *.cat`

Signing/SIGN4PORTAL.CMD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
SET mypath=%~dp0
3+
4+
cd /d "%mypath%"
5+
6+
rem amd64
7+
makecab /d SourceDir="%mypath%\..\sys\x64\Release\nvshldctrl" /d CabinetNameTemplate=nvshldctrl_x64.cab /f nvshldctrl.ddf
8+
rem x86
9+
makecab /d SourceDir="%mypath%\..\sys\Release\nvshldctrl" /d CabinetNameTemplate=nvshldctrl_x86.cab /f nvshldctrl.ddf
10+
11+
SignTool sign /v /ac "C:\Program Files (x86)\Windows Kits\10\CrossCertificates\GlobalSign Root CA.crt" /n "Wohlfeil.IT e.U." /t http://timestamp.verisign.com/scripts/timstamp.dll "%mypath%\Disk1\*.cab"
12+
pause

Signing/nvshldctrl.ddf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.OPTION EXPLICIT ; Generate errors
2+
.Set CabinetFileCountThreshold=0
3+
.Set FolderFileCountThreshold=0
4+
.Set FolderSizeThreshold=0
5+
.Set MaxCabinetSize=0
6+
.Set MaxDiskFileCount=0
7+
.Set MaxDiskSize=0
8+
.Set CompressionType=MSZIP
9+
.Set Cabinet=on
10+
.Set Compress=on
11+
; nvshldctrl
12+
.Set DestinationDir=nvshldctrl
13+
nvshldctrl.sys
14+
nvshldctrl.inf
15+
WdfCoinstaller01009.dll

cert/ShieldController.cer

-756 Bytes
Binary file not shown.

cert/ShieldController.pfx

-2.44 KB
Binary file not shown.

cert/ShieldController.pvk

-1.18 KB
Binary file not shown.

cert/ShieldController.spc

-803 Bytes
Binary file not shown.
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25420.1
5-
MinimumVisualStudioVersion = 12.0
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sys", "Sys", "{6D46B6EF-E350-4AFB-8AE4-470C61F8F756}"
7-
EndProject
8-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hidusbfx2", "sys\hidusbfx2.vcxproj", "{0C56E492-CEB9-49C4-B127-FE437B55A879}"
9-
EndProject
10-
Global
11-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12-
Debug|Win32 = Debug|Win32
13-
Debug|x64 = Debug|x64
14-
Release|Win32 = Release|Win32
15-
Release|x64 = Release|x64
16-
EndGlobalSection
17-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|Win32.ActiveCfg = Debug|Win32
19-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|Win32.Build.0 = Debug|Win32
20-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|x64.ActiveCfg = Debug|x64
21-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|x64.Build.0 = Debug|x64
22-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|Win32.ActiveCfg = Release|Win32
23-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|Win32.Build.0 = Release|Win32
24-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|x64.ActiveCfg = Release|x64
25-
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|x64.Build.0 = Release|x64
26-
EndGlobalSection
27-
GlobalSection(SolutionProperties) = preSolution
28-
HideSolutionNode = FALSE
29-
EndGlobalSection
30-
GlobalSection(NestedProjects) = preSolution
31-
{0C56E492-CEB9-49C4-B127-FE437B55A879} = {6D46B6EF-E350-4AFB-8AE4-470C61F8F756}
32-
EndGlobalSection
33-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 12.0
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sys", "Sys", "{6D46B6EF-E350-4AFB-8AE4-470C61F8F756}"
7+
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hidusbfx2", "sys\hidusbfx2.vcxproj", "{0C56E492-CEB9-49C4-B127-FE437B55A879}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Win32 = Debug|Win32
13+
Debug|x64 = Debug|x64
14+
Release|Win32 = Release|Win32
15+
Release|x64 = Release|x64
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|Win32.ActiveCfg = Debug|Win32
19+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|Win32.Build.0 = Debug|Win32
20+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|x64.ActiveCfg = Debug|x64
21+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Debug|x64.Build.0 = Debug|x64
22+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|Win32.ActiveCfg = Release|Win32
23+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|Win32.Build.0 = Release|Win32
24+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|x64.ActiveCfg = Release|x64
25+
{0C56E492-CEB9-49C4-B127-FE437B55A879}.Release|x64.Build.0 = Release|x64
26+
EndGlobalSection
27+
GlobalSection(SolutionProperties) = preSolution
28+
HideSolutionNode = FALSE
29+
EndGlobalSection
30+
GlobalSection(NestedProjects) = preSolution
31+
{0C56E492-CEB9-49C4-B127-FE437B55A879} = {6D46B6EF-E350-4AFB-8AE4-470C61F8F756}
32+
EndGlobalSection
33+
EndGlobal

0 commit comments

Comments
 (0)