5 Commits

Author SHA1 Message Date
Benjamin Höglinger-Stelzer
3a3f41887d Changed hardware ID from Root\ViGEmBus to Nefarius\ViGEmBus\Gen1
Applied manufacturer name fix
2018-10-17 19:56:50 +02:00
Benjamin Höglinger-Stelzer
4497df456d Removed unnecessary dependencies 2018-10-17 19:48:32 +02:00
Benjamin Höglinger-Stelzer
f4a7b575fe Re-introduced "old" version stamping until new method is rock-solid 2018-10-17 19:45:33 +02:00
Benjamin Höglinger-Stelzer
14c16243c6 Attempt to fix #8 2018-10-05 19:26:16 +02:00
Benjamin Höglinger-Stelzer
c34afa953d Fixed issues #6, #7
Moved another few bytes to heap
2018-10-03 19:55:13 +02:00
11 changed files with 153 additions and 64 deletions

2
.gitignore vendored
View File

@@ -33,3 +33,5 @@
/Debug
/sys/Debug
/sys/ARM/Debug
/lib/Debug (dynamic)/*.log
/sys/RCa25584

View File

@@ -5,7 +5,14 @@ install:
build_script:
- ps: .\build.ps1 -configuration release
after_build:
- cmd: makecab.exe /f ViGEmBus.ddf
- ps: |
Invoke-WebRequest "https://downloads.vigem.org/other/pavel-a/ddverpatch/verpatch-1.0.15.1-x86-codeplex.zip" -OutFile verpatch-1.0.15.1-x86-codeplex.zip
Expand-Archive verpatch-1.0.15.1-x86-codeplex.zip -DestinationPath .
.\verpatch.exe .\artifacts\x64\ViGEmBus.sys "$env:APPVEYOR_BUILD_VERSION"
.\verpatch.exe .\artifacts\x64\ViGEmBus.sys /pv "$env:APPVEYOR_BUILD_VERSION"
.\verpatch.exe .\artifacts\x86\ViGEmBus.sys "$env:APPVEYOR_BUILD_VERSION"
.\verpatch.exe .\artifacts\x86\ViGEmBus.sys /pv "$env:APPVEYOR_BUILD_VERSION"
makecab.exe /f ViGEmBus.ddf
artifacts:
- path: disk1\ViGEmBus.cab
name: ViGEmBus_unsigned_x86_amd64

View File

@@ -1,6 +1,5 @@
using System;
using System.IO;
using JsonConfig;
using Nuke.Common;
using Nuke.Common.BuildServers;
using Nuke.Common.Git;
@@ -91,20 +90,6 @@ internal class Build : NukeBuild
);
#endregion
if (Configuration.Equals("release", StringComparison.InvariantCultureIgnoreCase))
{
var version =
new Version(IsLocalBuild ? GitVersion.GetNormalizedFileVersion() : AppVeyor.Instance.BuildVersion);
StampVersion(
Path.Combine(ArtifactsDirectory, @"x64\ViGEmBus.sys"),
version);
StampVersion(
Path.Combine(ArtifactsDirectory, @"x86\ViGEmBus.sys"),
version);
}
});
private Target Pack => _ => _
@@ -123,38 +108,4 @@ internal class Build : NukeBuild
{
return Execute<Build>(x => x.Compile);
}
private static void StampVersion(string path, Version version)
{
var versionResource = new VersionResource
{
FileVersion = version.ToString(),
ProductVersion = version.ToString()
};
var stringFileInfo = new StringFileInfo();
versionResource[stringFileInfo.Key] = stringFileInfo;
var stringFileInfoStrings = new StringTable
{
LanguageID = 1033,
CodePage = 1200
};
stringFileInfo.Strings.Add(stringFileInfoStrings.Key, stringFileInfoStrings);
stringFileInfoStrings["CompanyName"] = Config.Global.Version.CompanyName;
stringFileInfoStrings["FileDescription"] = Config.Global.Version.FileDescription;
stringFileInfoStrings["FileVersion"] = version.ToString();
stringFileInfoStrings["InternalName"] = Config.Global.Version.InternalName;
stringFileInfoStrings["LegalCopyright"] = Config.Global.Version.LegalCopyright;
stringFileInfoStrings["OriginalFilename"] = Config.Global.Version.OriginalFilename;
stringFileInfoStrings["ProductName"] = Config.Global.Version.ProductName;
stringFileInfoStrings["ProductVersion"] = version.ToString();
var varFileInfo = new VarFileInfo();
versionResource[varFileInfo.Key] = varFileInfo;
var varFileInfoTranslation = new VarTable("Translation");
varFileInfo.Vars.Add(varFileInfoTranslation.Key, varFileInfoTranslation);
varFileInfoTranslation[ResourceUtil.USENGLISHLANGID] = 1300;
versionResource.SaveTo(path);
}
}

View File

@@ -10,7 +10,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nefarius.JsonConfig" Version="1.0.2" />
<PackageReference Include="Nuke.Common" Version="0.9.1" />
<PackageReference Include="GitVersion.CommandLine" Version="3.6.5" />
<PackageReference Include="Vestris.ResourceLib" Version="2.0.0" />

View File

@@ -34,10 +34,10 @@ WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll = 1
%ManufacturerName%=Standard,NTamd64,NTx86
[Standard.NTamd64]
%ViGEmBus.DeviceDesc%=ViGEmBus_Device, Root\ViGEmBus
%ViGEmBus.DeviceDesc%=ViGEmBus_Device, Nefarius\ViGEmBus\Gen1
[Standard.NTx86]
%ViGEmBus.DeviceDesc%=ViGEmBus_Device, Root\ViGEmBus
%ViGEmBus.DeviceDesc%=ViGEmBus_Device, Nefarius\ViGEmBus\Gen1
[ViGEmBus_Device.NT]
CopyFiles=Drivers_Dir
@@ -78,7 +78,7 @@ KmdfLibraryVersion = $KMDFVERSION$
[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName="Benjamin H<EFBFBD>glinger-Stelzer"
ManufacturerName="Benjamin Hoeglinger-Stelzer"
DiskName = "ViGEmBus Installation Disk"
ViGEmBus.DeviceDesc = "Virtual Gamepad Emulation Bus"
ViGEmBus.SVCDESC = "Virtual Gamepad Emulation Service"

100
sys/ViGEmBus.rc Normal file
View File

@@ -0,0 +1,100 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// German (Austria) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA)
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,14,3,0
PRODUCTVERSION 1,14,3,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0xe9L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000904b0"
BEGIN
VALUE "CompanyName", "Benjamin H<>glinger-Stelzer"
VALUE "FileDescription", "Virtual Gamepad Emulation Bus Driver"
VALUE "FileVersion", "1.14.3.0"
VALUE "InternalName", "Virtual Gamepad Emulation Bus Driver"
VALUE "LegalCopyright", "Copyright (C) Benjamin H<>glinger-Stelzer 2016"
VALUE "OriginalFilename", "vigembus.sys"
VALUE "ProductName", "Virtual Gamepad Emulation Bus Driver"
VALUE "ProductVersion", "1.14.3.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x9, 1200
END
END
#endif // German (Austria) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -185,12 +185,16 @@
<ClInclude Include="Context.h" />
<ClInclude Include="Ds4.h" />
<ClInclude Include="Queue.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="trace.h" />
<ClInclude Include="UsbPdo.h" />
<ClInclude Include="Util.h" />
<ClInclude Include="Xgip.h" />
<ClInclude Include="Xusb.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="ViGEmBus.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="busenum.c" />
<ClCompile Include="buspdo.c" />

View File

@@ -49,7 +49,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_XUSB_UNKNOWN_2,
#define XUSB_LEDSET_SIZE 0x03
#define XUSB_LEDNUM_SIZE 0x01
#define XUSB_INIT_STAGE_SIZE 0x03
#define XUSB_BLOB_STORAGE_SIZE 0x26
#define XUSB_BLOB_STORAGE_SIZE 0x2A
#define XUSB_BLOB_00_OFFSET 0x00
#define XUSB_BLOB_01_OFFSET 0x03
@@ -58,6 +58,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_XUSB_UNKNOWN_2,
#define XUSB_BLOB_04_OFFSET 0x0C
#define XUSB_BLOB_05_OFFSET 0x20
#define XUSB_BLOB_06_OFFSET 0x23
#define XUSB_BLOB_07_OFFSET 0x26
#define XUSB_IS_DATA_PIPE(_x_) ((BOOLEAN)(_x_->PipeHandle == (USBD_PIPE_HANDLE)0xFFFF0081))
#define XUSB_IS_CONTROL_PIPE(_x_) ((BOOLEAN)(_x_->PipeHandle == (USBD_PIPE_HANDLE)0xFFFF0083))

View File

@@ -442,7 +442,7 @@ NTSTATUS Bus_CreatePdo(
// Create and assign queue for user-land notification requests
WDF_IO_QUEUE_CONFIG_INIT(&notificationsQueueConfig, WdfIoQueueDispatchManual);
status = WdfIoQueueCreate(hChild, &notificationsQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &pdoData->PendingNotificationRequests);
status = WdfIoQueueCreate(Device, &notificationsQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &pdoData->PendingNotificationRequests);
if (!NT_SUCCESS(status))
{
TraceEvents(TRACE_LEVEL_ERROR,
@@ -598,6 +598,8 @@ VOID Pdo_EvtIoInternalDeviceControl(
PURB urb;
PPDO_DEVICE_DATA pdoData;
PIO_STACK_LOCATION irpStack;
PXUSB_DEVICE_DATA pXusbData;
PUCHAR blobBuffer;
TraceEvents(TRACE_LEVEL_VERBOSE, TRACE_BUSPDO, "%!FUNC! Entry");
@@ -629,13 +631,20 @@ VOID Pdo_EvtIoInternalDeviceControl(
switch (urb->UrbControlTransfer.SetupPacket[6])
{
case 0x04:
//
// Xenon magic
//
COPY_BYTE_ARRAY(urb->UrbControlTransfer.TransferBuffer, P99_PROTECT({
0x31, 0x3F, 0xCF, 0xDC
}));
status = STATUS_SUCCESS;
if (pdoData->TargetType == Xbox360Wired)
{
pXusbData = XusbGetData(hDevice);
blobBuffer = WdfMemoryGetBuffer(pXusbData->InterruptBlobStorage, NULL);
//
// Xenon magic
//
RtlCopyMemory(
urb->UrbControlTransfer.TransferBuffer,
&blobBuffer[XUSB_BLOB_07_OFFSET],
0x04
);
status = STATUS_SUCCESS;
}
break;
case 0x14:
//

14
sys/resource.h Normal file
View File

@@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ViGEmBus.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -295,7 +295,9 @@ NTSTATUS Xusb_AssignPdoContext(WDFDEVICE Device)
// 5
0x01, 0x03, 0x03,
// 6
0x05, 0x03, 0x00
0x05, 0x03, 0x00,
// 7
0x31, 0x3F, 0xCF, 0xDC
}));
// I/O Queue for pending IRPs