mirror of
https://github.com/nefarius/ViGEmBus.git
synced 2025-08-10 00:52:17 +00:00
Compare commits
8 Commits
v1.17.248.
...
v1.17.256.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64ca258915 | ||
|
|
2fe83018c0 | ||
|
|
05b3b74db5 | ||
|
|
5bea1d5b0f | ||
|
|
f9eaad93f2 | ||
|
|
81b6fb3926 | ||
|
|
9f4e557d94 | ||
|
|
80330f6716 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -357,4 +357,7 @@ MigrationBackup/
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
FodyWeavers.xsd
|
||||
/disk1/ViGEmBus_x64.cab
|
||||
/setup.inf
|
||||
/setup.rpt
|
||||
|
||||
@@ -93,6 +93,8 @@ This list is non-exhaustive, if you'd like to see your project included, contact
|
||||
- [DS4Windows](https://ryochan7.github.io/ds4windows-site/)
|
||||
- [XOutput](https://github.com/csutorasa/XOutput)
|
||||
- [RdpGamepad](https://github.com/microsoft/RdpGamepad)
|
||||
- [Touchmote](https://github.com/Ryochan7/Touchmote/tree/ryochan7)
|
||||
- [Mi-ViGEm](https://github.com/grayver/mi-vigem)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
21
ViGEmBus.ddf
21
ViGEmBus.ddf
@@ -1,21 +0,0 @@
|
||||
.OPTION EXPLICIT
|
||||
.Set CabinetFileCountThreshold=0
|
||||
.Set FolderFileCountThreshold=0
|
||||
.Set FolderSizeThreshold=0
|
||||
.Set MaxCabinetSize=0
|
||||
.Set MaxDiskFileCount=0
|
||||
.Set MaxDiskSize=0
|
||||
.Set CompressionType=MSZIP
|
||||
.Set Cabinet=on
|
||||
.Set Compress=on
|
||||
.Set CabinetNameTemplate=ViGEmBus.cab
|
||||
.Set DestinationDir=ViGEmBus
|
||||
.\artifacts\ViGEmBus.inf
|
||||
.Set DestinationDir=ViGEmBus\x64
|
||||
.\artifacts\x64\ViGEmBus.sys
|
||||
.\artifacts\x64\ViGEmBus.pdb
|
||||
.\artifacts\x64\WdfCoinstaller01009.dll
|
||||
.Set DestinationDir=ViGEmBus\x86
|
||||
.\artifacts\x86\ViGEmBus.sys
|
||||
.\artifacts\x86\ViGEmBus.pdb
|
||||
.\artifacts\x86\WdfCoinstaller01009.dll
|
||||
19
ViGEmBus_x64.ddf
Normal file
19
ViGEmBus_x64.ddf
Normal file
@@ -0,0 +1,19 @@
|
||||
; ViGEmBus cab file for attestation submission
|
||||
.OPTION EXPLICIT
|
||||
.Set CabinetFileCountThreshold=0
|
||||
.Set FolderFileCountThreshold=0
|
||||
.Set FolderSizeThreshold=0
|
||||
.Set MaxCabinetSize=0
|
||||
.Set MaxDiskFileCount=0
|
||||
.Set MaxDiskSize=0
|
||||
.Set CompressionType=MSZIP
|
||||
.Set Cabinet=on
|
||||
.Set Compress=on
|
||||
; x64
|
||||
.Set CabinetNameTemplate=ViGEmBus_x64.cab
|
||||
.Set DestinationDir=ViGEmBus_x64
|
||||
LICENSE
|
||||
bin\x64\ViGEmBus.pdb
|
||||
bin\x64\ViGEmBus\ViGEmBus.inf
|
||||
bin\x64\ViGEmBus\ViGEmBus.sys
|
||||
bin\x64\ViGEmBus\WdfCoinstaller01009.dll
|
||||
19
ViGEmBus_x86.ddf
Normal file
19
ViGEmBus_x86.ddf
Normal file
@@ -0,0 +1,19 @@
|
||||
; ViGEmBus cab file for attestation submission
|
||||
.OPTION EXPLICIT
|
||||
.Set CabinetFileCountThreshold=0
|
||||
.Set FolderFileCountThreshold=0
|
||||
.Set FolderSizeThreshold=0
|
||||
.Set MaxCabinetSize=0
|
||||
.Set MaxDiskFileCount=0
|
||||
.Set MaxDiskSize=0
|
||||
.Set CompressionType=MSZIP
|
||||
.Set Cabinet=on
|
||||
.Set Compress=on
|
||||
; x86
|
||||
.Set CabinetNameTemplate=ViGEmBus_x86.cab
|
||||
.Set DestinationDir=ViGEmBus_x86
|
||||
LICENSE
|
||||
bin\x86\ViGEmBus.pdb
|
||||
bin\x86\ViGEmBus\ViGEmBus.inf
|
||||
bin\x86\ViGEmBus\ViGEmBus.sys
|
||||
bin\x86\ViGEmBus\WdfCoinstaller01009.dll
|
||||
@@ -14,12 +14,13 @@ before_build:
|
||||
build:
|
||||
project: $(APPVEYOR_BUILD_FOLDER)\$(APPVEYOR_PROJECT_NAME).sln
|
||||
after_build:
|
||||
#- cmd: makecab.exe /f ViGEmBus.ddf
|
||||
- cmd: makecab.exe /f ViGEmBus_%PLATFORM%.ddf
|
||||
artifacts:
|
||||
- path: 'bin**\$(APPVEYOR_PROJECT_NAME)\*.inf'
|
||||
- path: 'bin**\$(APPVEYOR_PROJECT_NAME)\*.sys'
|
||||
- path: 'bin**\$(APPVEYOR_PROJECT_NAME)\*.dll'
|
||||
- path: 'bin**\*.pdb'
|
||||
- path: 'disk1\*.cab'
|
||||
deploy:
|
||||
- provider: Environment
|
||||
name: BUILDBOT
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Virtual Gamepad Emulation Framework - Windows kernel-mode bus driver
|
||||
*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2016-2020 Nefarius Software Solutions e.U. and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
// {A77BC4D5-6AF7-4E69-8DC4-6B88A6028CE6}
|
||||
// ReSharper disable once CppMissingIncludeGuard
|
||||
DEFINE_GUID(GUID_VIGEM_INTERFACE_PDO,
|
||||
0xA77BC4D5, 0x6AF7, 0x4E69, 0x8D, 0xC4, 0x6B, 0x88, 0xA6, 0x02, 0x8C, 0xE6);
|
||||
|
||||
// {A8BA2D1F-894F-464A-B0CE-7A0C8FD65DF1}
|
||||
DEFINE_GUID(GUID_DEVCLASS_VIGEM_RAWPDO,
|
||||
0xA8BA2D1F, 0x894F, 0x464A, 0xB0, 0xCE, 0x7A, 0x0C, 0x8F, 0xD6, 0x5D, 0xF1);
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -39,8 +39,19 @@ ViGEm::Bus::Targets::EmulationTargetDS4::EmulationTargetDS4(ULONG Serial, LONG S
|
||||
USHORT ProductId) : EmulationTargetPDO(
|
||||
Serial, SessionId, VendorId, ProductId)
|
||||
{
|
||||
_TargetType = DualShock4Wired;
|
||||
_UsbConfigurationDescriptionSize = DS4_DESCRIPTOR_SIZE;
|
||||
this->_TargetType = DualShock4Wired;
|
||||
this->_UsbConfigurationDescriptionSize = DS4_DESCRIPTOR_SIZE;
|
||||
|
||||
//
|
||||
// Set PNP Capabilities
|
||||
//
|
||||
this->_PnpCapabilities.SurpriseRemovalOK = WdfTrue;
|
||||
|
||||
//
|
||||
// Set Power Capabilities
|
||||
//
|
||||
this->_PowerCapabilities.DeviceState[PowerSystemWorking] = PowerDeviceD0;
|
||||
this->_PowerCapabilities.WakeFromD0 = WdfTrue;
|
||||
}
|
||||
|
||||
NTSTATUS ViGEm::Bus::Targets::EmulationTargetDS4::PdoPrepareDevice(PWDFDEVICE_INIT DeviceInit,
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace ViGEm::Bus::Targets
|
||||
{
|
||||
public:
|
||||
EmulationTargetDS4(ULONG Serial, LONG SessionId, USHORT VendorId = 0x054C, USHORT ProductId = 0x05C4);
|
||||
~EmulationTargetDS4() = default;
|
||||
|
||||
NTSTATUS PdoPrepareDevice(PWDFDEVICE_INIT DeviceInit,
|
||||
PUNICODE_STRING DeviceId,
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <ntstrsafe.h>
|
||||
#include <usbioctl.h>
|
||||
#include <usbiodef.h>
|
||||
#include <ViGEmBusDriver.h>
|
||||
|
||||
|
||||
PCWSTR ViGEm::Bus::Core::EmulationTargetPDO::_deviceLocation = L"Virtual Gamepad Emulation Bus";
|
||||
@@ -40,8 +39,6 @@ PCWSTR ViGEm::Bus::Core::EmulationTargetPDO::_deviceLocation = L"Virtual Gamepad
|
||||
NTSTATUS ViGEm::Bus::Core::EmulationTargetPDO::PdoCreateDevice(WDFDEVICE ParentDevice, PWDFDEVICE_INIT DeviceInit)
|
||||
{
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
WDF_DEVICE_PNP_CAPABILITIES pnpCaps;
|
||||
WDF_DEVICE_POWER_CAPABILITIES powerCaps;
|
||||
WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks;
|
||||
WDF_OBJECT_ATTRIBUTES pdoAttributes;
|
||||
WDF_IO_QUEUE_CONFIG defaultPdoQueueConfig;
|
||||
@@ -70,32 +67,6 @@ NTSTATUS ViGEm::Bus::Core::EmulationTargetPDO::PdoCreateDevice(WDFDEVICE ParentD
|
||||
|
||||
do
|
||||
{
|
||||
#pragma region Enter RAW device mode
|
||||
|
||||
status = WdfPdoInitAssignRawDevice(DeviceInit, &GUID_DEVCLASS_VIGEM_RAWPDO);
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_ERROR,
|
||||
TRACE_BUSPDO,
|
||||
"WdfPdoInitAssignRawDevice failed with status %!STATUS!",
|
||||
status);
|
||||
break;
|
||||
}
|
||||
|
||||
WdfDeviceInitSetCharacteristics(DeviceInit, FILE_AUTOGENERATED_DEVICE_NAME, TRUE);
|
||||
|
||||
status = WdfDeviceInitAssignSDDLString(DeviceInit, &SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX);
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_ERROR,
|
||||
TRACE_BUSPDO,
|
||||
"WdfDeviceInitAssignSDDLString failed with status %!STATUS!",
|
||||
status);
|
||||
break;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Prepare PDO
|
||||
|
||||
status = this->PdoPrepareDevice(DeviceInit, &deviceId, &deviceDescription);
|
||||
@@ -303,35 +274,24 @@ NTSTATUS ViGEm::Bus::Core::EmulationTargetPDO::PdoCreateDevice(WDFDEVICE ParentD
|
||||
|
||||
#pragma region PNP capabilities
|
||||
|
||||
WDF_DEVICE_PNP_CAPABILITIES_INIT(&pnpCaps);
|
||||
//
|
||||
// Other capabilities initialized in derived class
|
||||
//
|
||||
|
||||
pnpCaps.Removable = WdfTrue;
|
||||
pnpCaps.EjectSupported = WdfTrue;
|
||||
pnpCaps.SurpriseRemovalOK = WdfTrue;
|
||||
this->_PnpCapabilities.Address = this->_SerialNo;
|
||||
this->_PnpCapabilities.UINumber = this->_SerialNo;
|
||||
|
||||
pnpCaps.Address = this->_SerialNo;
|
||||
pnpCaps.UINumber = this->_SerialNo;
|
||||
|
||||
WdfDeviceSetPnpCapabilities(this->_PdoDevice, &pnpCaps);
|
||||
WdfDeviceSetPnpCapabilities(this->_PdoDevice, &this->_PnpCapabilities);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Power capabilities
|
||||
|
||||
WDF_DEVICE_POWER_CAPABILITIES_INIT(&powerCaps);
|
||||
//
|
||||
// Capabilities initialized in derived class
|
||||
//
|
||||
|
||||
powerCaps.DeviceD1 = WdfTrue;
|
||||
powerCaps.WakeFromD1 = WdfTrue;
|
||||
powerCaps.DeviceWake = PowerDeviceD1;
|
||||
|
||||
powerCaps.DeviceState[PowerSystemWorking] = PowerDeviceD0;
|
||||
powerCaps.DeviceState[PowerSystemSleeping1] = PowerDeviceD1;
|
||||
powerCaps.DeviceState[PowerSystemSleeping2] = PowerDeviceD3;
|
||||
powerCaps.DeviceState[PowerSystemSleeping3] = PowerDeviceD3;
|
||||
powerCaps.DeviceState[PowerSystemHibernate] = PowerDeviceD3;
|
||||
powerCaps.DeviceState[PowerSystemShutdown] = PowerDeviceD3;
|
||||
|
||||
WdfDeviceSetPowerCapabilities(this->_PdoDevice, &powerCaps);
|
||||
WdfDeviceSetPowerCapabilities(this->_PdoDevice, &this->_PowerCapabilities);
|
||||
|
||||
#pragma endregion
|
||||
} while (FALSE);
|
||||
@@ -657,6 +617,42 @@ VOID ViGEm::Bus::Core::EmulationTargetPDO::PluginRequestCompletionWorkerRoutine(
|
||||
(void)PsTerminateSystemThread(0);
|
||||
}
|
||||
|
||||
VOID ViGEm::Bus::Core::EmulationTargetPDO::DumpAsHex(PCSTR Prefix, PVOID Buffer, ULONG BufferLength)
|
||||
{
|
||||
#ifdef DBG
|
||||
|
||||
size_t dumpBufferLength = ((BufferLength * sizeof(CHAR)) * 2) + 1;
|
||||
PSTR dumpBuffer = static_cast<PSTR>(ExAllocatePoolWithTag(
|
||||
NonPagedPoolNx,
|
||||
dumpBufferLength,
|
||||
'1234'
|
||||
));
|
||||
if (dumpBuffer)
|
||||
{
|
||||
|
||||
RtlZeroMemory(dumpBuffer, dumpBufferLength);
|
||||
|
||||
for (ULONG i = 0; i < BufferLength; i++)
|
||||
{
|
||||
sprintf(&dumpBuffer[i * 2], "%02X", static_cast<PUCHAR>(Buffer)[i]);
|
||||
}
|
||||
|
||||
TraceDbg(TRACE_BUSPDO,
|
||||
"%s - Buffer length: %04d, buffer content: %s\n",
|
||||
Prefix,
|
||||
BufferLength,
|
||||
dumpBuffer
|
||||
);
|
||||
|
||||
ExFreePoolWithTag(dumpBuffer, '1234');
|
||||
}
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(Prefix);
|
||||
UNREFERENCED_PARAMETER(Buffer);
|
||||
UNREFERENCED_PARAMETER(BufferLength);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ViGEm::Bus::Core::EmulationTargetPDO::UsbAbortPipe()
|
||||
{
|
||||
this->AbortPipe();
|
||||
@@ -717,6 +713,9 @@ _ProductId(ProductId)
|
||||
{
|
||||
this->_OwnerProcessId = current_process_id();
|
||||
KeInitializeEvent(&this->_PdoBootNotificationEvent, NotificationEvent, FALSE);
|
||||
|
||||
WDF_DEVICE_PNP_CAPABILITIES_INIT(&this->_PnpCapabilities);
|
||||
WDF_DEVICE_POWER_CAPABILITIES_INIT(&this->_PowerCapabilities);
|
||||
}
|
||||
|
||||
bool ViGEm::Bus::Core::EmulationTargetPDO::GetPdoBySerial(
|
||||
|
||||
@@ -163,6 +163,18 @@ namespace ViGEm::Bus::Core
|
||||
virtual void AbortPipe() = 0;
|
||||
|
||||
virtual NTSTATUS SubmitReportImpl(PVOID NewReport) = 0;
|
||||
|
||||
static VOID DumpAsHex(PCSTR Prefix, PVOID Buffer, ULONG BufferLength);
|
||||
|
||||
//
|
||||
// PNP Capabilities may differ from device to device
|
||||
//
|
||||
WDF_DEVICE_PNP_CAPABILITIES _PnpCapabilities;
|
||||
|
||||
//
|
||||
// Power Capabilities may differ from device to device
|
||||
//
|
||||
WDF_DEVICE_POWER_CAPABILITIES _PowerCapabilities;
|
||||
|
||||
//
|
||||
// Unique serial number of the device on the bus
|
||||
@@ -215,7 +227,7 @@ namespace ViGEm::Bus::Core
|
||||
WDFDEVICE _PdoDevice{};
|
||||
|
||||
//
|
||||
// Configuration descriptor size
|
||||
// Configuration descriptor size (populated by derived class)
|
||||
//
|
||||
ULONG _UsbConfigurationDescriptionSize{};
|
||||
|
||||
|
||||
BIN
sys/RCa08996
BIN
sys/RCa08996
Binary file not shown.
@@ -35,13 +35,8 @@ DriverVer= ;
|
||||
DefaultDestDir = 12
|
||||
ViGEmBus_Device_CoInstaller_CopyFiles = 11
|
||||
|
||||
; ================= Class section =====================
|
||||
|
||||
[SourceDisksNames.amd64]
|
||||
1 = %DiskName%,,,"\x64"
|
||||
|
||||
[SourceDisksNames.x86]
|
||||
1 = %DiskName%,,,"\x86"
|
||||
[SourceDisksNames]
|
||||
1 = %DiskName%,,,
|
||||
|
||||
[SourceDisksFiles]
|
||||
ViGEmBus.sys = 1,,
|
||||
|
||||
@@ -89,27 +89,27 @@
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
<IncludePath>$(SolutionDir)include;$(SolutionDir)client\include;$(IncludePath)</IncludePath>
|
||||
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
|
||||
<EnableInf2cat>false</EnableInf2cat>
|
||||
<EnableInf2cat>true</EnableInf2cat>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
<IncludePath>$(SolutionDir)include;$(SolutionDir)client\include;$(IncludePath)</IncludePath>
|
||||
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
|
||||
<OutDir>$(SolutionDir)bin\$(DDKPlatform)\</OutDir>
|
||||
<EnableInf2cat>false</EnableInf2cat>
|
||||
<EnableInf2cat>true</EnableInf2cat>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
<IncludePath>$(SolutionDir)include;$(SolutionDir)client\include;$(IncludePath)</IncludePath>
|
||||
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
|
||||
<EnableInf2cat>false</EnableInf2cat>
|
||||
<EnableInf2cat>true</EnableInf2cat>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
<IncludePath>$(SolutionDir)include;$(SolutionDir)client\include;$(IncludePath)</IncludePath>
|
||||
<Inf2CatUseLocalTime>true</Inf2CatUseLocalTime>
|
||||
<OutDir>$(SolutionDir)bin\$(DDKPlatform)\</OutDir>
|
||||
<EnableInf2cat>false</EnableInf2cat>
|
||||
<EnableInf2cat>true</EnableInf2cat>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Inf>
|
||||
@@ -179,13 +179,11 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Inf Include="ViGEmBus.inf" />
|
||||
<Inf Include="ViGEmBus_SingleArch.inf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FilesToPackage Include="$(TargetPath)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="$(SolutionDir)\Include\ViGEmBusDriver.h" />
|
||||
<ClInclude Include="..\client\include\ViGEm\km\BusShared.h" />
|
||||
<ClInclude Include="busenum.h" />
|
||||
<ClInclude Include="CRTCPP.hpp" />
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
<UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
|
||||
<Extensions>inf;inv;inx;mof;mc;</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Common">
|
||||
<UniqueIdentifier>{bbf85b1d-5a75-4302-af4e-46627fcf0d78}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Targets">
|
||||
<UniqueIdentifier>{b00da32a-ce46-490d-9e77-95bb90925995}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -31,17 +28,11 @@
|
||||
<Inf Include="ViGEmBus.inf">
|
||||
<Filter>Driver Files</Filter>
|
||||
</Inf>
|
||||
<Inf Include="ViGEmBus_SingleArch.inf">
|
||||
<Filter>Driver Files</Filter>
|
||||
</Inf>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="busenum.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(SolutionDir)\Include\ViGEmBusDriver.h">
|
||||
<Filter>Header Files\Common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="trace.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
; Virtual Gamepad Emulation Framework - Windows kernel-mode bus driver
|
||||
;
|
||||
; MIT License
|
||||
;
|
||||
; Copyright (c) 2016-2020 Nefarius Software Solutions e.U. and Contributors
|
||||
;
|
||||
; Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
; of this software and associated documentation files (the "Software"), to deal
|
||||
; in the Software without restriction, including without limitation the rights
|
||||
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
; copies of the Software, and to permit persons to whom the Software is
|
||||
; furnished to do so, subject to the following conditions:
|
||||
;
|
||||
; The above copyright notice and this permission notice shall be included in all
|
||||
; copies or substantial portions of the Software.
|
||||
;
|
||||
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
; SOFTWARE.
|
||||
|
||||
|
||||
[Version]
|
||||
Signature="$WINDOWS NT$"
|
||||
Class=System
|
||||
ClassGuid={4D36E97D-E325-11CE-BFC1-08002BE10318}
|
||||
Provider=%ManufacturerName%
|
||||
CatalogFile=ViGEmBus.cat
|
||||
DriverVer= ;
|
||||
|
||||
[DestinationDirs]
|
||||
DefaultDestDir = 12
|
||||
ViGEmBus_Device_CoInstaller_CopyFiles = 11
|
||||
|
||||
[SourceDisksNames]
|
||||
1 = %DiskName%,,,
|
||||
|
||||
[SourceDisksFiles]
|
||||
ViGEmBus.sys = 1,,
|
||||
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll = 1
|
||||
|
||||
;*****************************************
|
||||
; Install Section
|
||||
;*****************************************
|
||||
|
||||
[Manufacturer]
|
||||
%ManufacturerName%=Standard,NTamd64,NTx86
|
||||
|
||||
[Standard.NTamd64]
|
||||
%ViGEmBus.DeviceDesc%=ViGEmBus_Device, Nefarius\ViGEmBus\Gen1
|
||||
|
||||
[Standard.NTx86]
|
||||
%ViGEmBus.DeviceDesc%=ViGEmBus_Device, Nefarius\ViGEmBus\Gen1
|
||||
|
||||
[ViGEmBus_Device.NT]
|
||||
CopyFiles=Drivers_Dir
|
||||
|
||||
[Drivers_Dir]
|
||||
ViGEmBus.sys
|
||||
|
||||
;-------------- Service installation
|
||||
[ViGEmBus_Device.NT.Services]
|
||||
AddService = ViGEmBus,%SPSVCINST_ASSOCSERVICE%, ViGEmBus_Service_Inst
|
||||
|
||||
; -------------- ViGEmBus driver install sections
|
||||
[ViGEmBus_Service_Inst]
|
||||
DisplayName = %ViGEmBus.SVCDESC%
|
||||
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
|
||||
StartType = 3 ; SERVICE_DEMAND_START
|
||||
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
|
||||
ServiceBinary = %12%\ViGEmBus.sys
|
||||
|
||||
;
|
||||
;--- ViGEmBus_Device Coinstaller installation ------
|
||||
;
|
||||
|
||||
[ViGEmBus_Device.NT.CoInstallers]
|
||||
AddReg=ViGEmBus_Device_CoInstaller_AddReg
|
||||
CopyFiles=ViGEmBus_Device_CoInstaller_CopyFiles
|
||||
|
||||
[ViGEmBus_Device_CoInstaller_AddReg]
|
||||
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"
|
||||
|
||||
[ViGEmBus_Device_CoInstaller_CopyFiles]
|
||||
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
|
||||
|
||||
[ViGEmBus_Device.NT.Wdf]
|
||||
KmdfService = ViGEmBus, ViGEmBus_wdfsect
|
||||
[ViGEmBus_wdfsect]
|
||||
KmdfLibraryVersion = $KMDFVERSION$
|
||||
|
||||
[Strings]
|
||||
SPSVCINST_ASSOCSERVICE= 0x00000002
|
||||
ManufacturerName="Nefarius Software Solutions e.U."
|
||||
DiskName = "ViGEmBus Installation Disk"
|
||||
ViGEmBus.DeviceDesc = "Virtual Gamepad Emulation Bus"
|
||||
ViGEmBus.SVCDESC = "Virtual Gamepad Emulation Service"
|
||||
@@ -41,8 +41,30 @@ ViGEm::Bus::Targets::EmulationTargetXUSB::EmulationTargetXUSB(ULONG Serial, LONG
|
||||
USHORT ProductId) : EmulationTargetPDO(
|
||||
Serial, SessionId, VendorId, ProductId)
|
||||
{
|
||||
_TargetType = Xbox360Wired;
|
||||
_UsbConfigurationDescriptionSize = XUSB_DESCRIPTOR_SIZE;
|
||||
this->_TargetType = Xbox360Wired;
|
||||
this->_UsbConfigurationDescriptionSize = XUSB_DESCRIPTOR_SIZE;
|
||||
|
||||
//
|
||||
// Set PNP Capabilities
|
||||
//
|
||||
this->_PnpCapabilities.Removable = WdfTrue;
|
||||
this->_PnpCapabilities.SurpriseRemovalOK = WdfTrue;
|
||||
this->_PnpCapabilities.UniqueID = WdfTrue;
|
||||
|
||||
//
|
||||
// Set Power Capabilities
|
||||
//
|
||||
this->_PowerCapabilities.DeviceState[PowerSystemWorking] = PowerDeviceD0;
|
||||
this->_PowerCapabilities.DeviceState[PowerSystemSleeping1] = PowerDeviceD2;
|
||||
this->_PowerCapabilities.DeviceState[PowerSystemSleeping2] = PowerDeviceD2;
|
||||
this->_PowerCapabilities.DeviceState[PowerSystemSleeping3] = PowerDeviceD2;
|
||||
this->_PowerCapabilities.DeviceState[PowerSystemHibernate] = PowerDeviceD2;
|
||||
this->_PowerCapabilities.DeviceState[PowerSystemShutdown] = PowerDeviceD3;
|
||||
this->_PowerCapabilities.DeviceD1 = WdfTrue;
|
||||
this->_PowerCapabilities.DeviceD2 = WdfTrue;
|
||||
this->_PowerCapabilities.WakeFromD0 = WdfTrue;
|
||||
this->_PowerCapabilities.WakeFromD1 = WdfTrue;
|
||||
this->_PowerCapabilities.WakeFromD2 = WdfTrue;
|
||||
}
|
||||
|
||||
NTSTATUS ViGEm::Bus::Targets::EmulationTargetXUSB::PdoPrepareDevice(PWDFDEVICE_INIT DeviceInit, PUNICODE_STRING DeviceId,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
namespace ViGEm::Bus::Targets
|
||||
{
|
||||
constexpr auto XUSB_POOL_TAG = 'EGiV';
|
||||
constexpr auto XUSB_POOL_TAG = 'XUiV';
|
||||
|
||||
typedef struct _XUSB_INTERRUPT_IN_PACKET
|
||||
{
|
||||
@@ -55,7 +55,6 @@ namespace ViGEm::Bus::Targets
|
||||
{
|
||||
public:
|
||||
EmulationTargetXUSB(ULONG Serial, LONG SessionId, USHORT VendorId = 0x045E, USHORT ProductId = 0x028E);
|
||||
~EmulationTargetXUSB() = default;
|
||||
|
||||
NTSTATUS PdoPrepareDevice(PWDFDEVICE_INIT DeviceInit,
|
||||
PUNICODE_STRING DeviceId,
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#define NTSTRSAFE_LIB
|
||||
#include <ntstrsafe.h>
|
||||
#include <initguid.h>
|
||||
#include "ViGEmBusDriver.h"
|
||||
#include <ViGEm/km/BusShared.h>
|
||||
#include "Queue.hpp"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user