mirror of
https://github.com/nefarius/ViGEmBus.git
synced 2025-08-10 00:52:17 +00:00
Compare commits
21 Commits
v1.16.100.
...
v1.16.138.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d826f4ee5e | ||
|
|
1fdab3e8f9 | ||
|
|
e69d4c9621 | ||
|
|
b2a7453519 | ||
|
|
a1524ece8e | ||
|
|
1121efcfed | ||
|
|
feda88729f | ||
|
|
64e62600ad | ||
|
|
f9f2313372 | ||
|
|
0cf25d0c9f | ||
|
|
9f838ad396 | ||
|
|
d51a3bf5f4 | ||
|
|
e054f1f8aa | ||
|
|
3a3f41887d | ||
|
|
4497df456d | ||
|
|
f4a7b575fe | ||
|
|
643e4b3c77 | ||
|
|
de3622dbd7 | ||
|
|
14c16243c6 | ||
|
|
c34afa953d | ||
|
|
ca03977296 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -33,3 +33,7 @@
|
||||
/Debug
|
||||
/sys/Debug
|
||||
/sys/ARM/Debug
|
||||
/lib/Debug (dynamic)/*.log
|
||||
/sys/RCa25584
|
||||
Releases
|
||||
/sys/RCa19160
|
||||
|
||||
@@ -66,13 +66,17 @@ To grab the latest signed binaries for use or redistribution [follow the install
|
||||
|
||||
## Sponsors
|
||||
|
||||
Sponsors listed here have helped the project flourish by either financial support or by gifting licenses:
|
||||
|
||||
- [3dRudder](https://www.3drudder.com/)
|
||||
- [Wohlfeil.IT e.U.](https://wohlfeil.it/)
|
||||
- [Parsec](https://parsecgaming.com/)
|
||||
- [Rainway, Inc](https://rainway.io/)
|
||||
- [JetBrains](https://www.jetbrains.com/resharper/)
|
||||
|
||||
## Known users of ViGEm
|
||||
|
||||
A brief listing of projects/companies/vendors known to build upon the powers of ViGEm. This list is non-exhaustive, if you'd like to see your project included, contact us!
|
||||
|
||||
- [3dRudder](https://www.3drudder.com/)
|
||||
- [Parsec](https://parsecgaming.com/)
|
||||
- [GloSC](https://github.com/Alia5/GloSC)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
@@ -32,7 +32,7 @@ ULONG_PTR align_to_page_size(ULONG_PTR val)
|
||||
|
||||
|
||||
//
|
||||
// Forward decalarations
|
||||
// Forward declarations
|
||||
//
|
||||
|
||||
NTSTATUS IncreaseCapacityByteArray(IN PBYTE_ARRAY Array, IN ULONG NumElements);
|
||||
|
||||
@@ -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
100
sys/ViGEmBus.rc
Normal 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
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
</Inf>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(DDK_LIB_PATH)ntstrsafe.lib;$(DDK_LIB_PATH)wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<WppRecorderEnabled>true</WppRecorderEnabled>
|
||||
@@ -160,6 +161,7 @@
|
||||
</Inf>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(DDK_LIB_PATH)ntstrsafe.lib;$(DDK_LIB_PATH)wdmsec.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
@@ -179,18 +181,22 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="$(SolutionDir)\Include\ViGEmBusDriver.h" />
|
||||
<ClInclude Include="..\client\include\km\ViGEmBusShared.h" />
|
||||
<ClInclude Include="..\client\include\ViGEm\km\BusShared.h" />
|
||||
<ClInclude Include="busenum.h" />
|
||||
<ClInclude Include="ByteArray.h" />
|
||||
<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" />
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
<ClInclude Include="trace.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\client\include\km\ViGEmBusShared.h">
|
||||
<Filter>Header Files\Common</Filter>
|
||||
<ClInclude Include="..\client\include\ViGEm\km\BusShared.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -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))
|
||||
|
||||
25
sys/buspdo.c
25
sys/buspdo.c
@@ -429,7 +429,7 @@ NTSTATUS Bus_CreatePdo(
|
||||
// Create and assign queue for incoming interrupt transfer
|
||||
WDF_IO_QUEUE_CONFIG_INIT(&usbInQueueConfig, WdfIoQueueDispatchManual);
|
||||
|
||||
status = WdfIoQueueCreate(Device, &usbInQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &pdoData->PendingUsbInRequests);
|
||||
status = WdfIoQueueCreate(hChild, &usbInQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &pdoData->PendingUsbInRequests);
|
||||
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
14
sys/resource.h
Normal 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
|
||||
@@ -728,6 +728,13 @@ NTSTATUS UsbPdo_BulkOrInterruptTransfer(PURB urb, WDFDEVICE Device, WDFREQUEST R
|
||||
status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_WARNING,
|
||||
TRACE_USBPDO,
|
||||
"!! [XUSB] WdfIoQueueRetrieveNextRequest failed with status %!STATUS!",
|
||||
status);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user