This commit is contained in:
Benjamin Höglinger-Stelzer
2020-05-10 21:21:48 +02:00
2 changed files with 49 additions and 13 deletions

49
sys/BusFdoPdoCommon.hpp Normal file
View File

@@ -0,0 +1,49 @@
#pragma once
#include <ntddk.h>
#include <wdf.h>
#include <ntintsafe.h>
//
// Used to identify children in the device list of the bus.
//
typedef struct _PDO_IDENTIFICATION_DESCRIPTION
{
WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER Header; // should contain this header
//
// Unique serial number of the device on the bus
//
ULONG SerialNo;
//
// PID of the process creating this PDO
//
DWORD OwnerProcessId;
//
// Device type this PDO is emulating
//
VIGEM_TARGET_TYPE TargetType;
//
// If set, the vendor ID the emulated device is reporting
//
USHORT VendorId;
//
// If set, the product ID the emulated device is reporting
//
USHORT ProductId;
//
// Is the current device owner another driver?
//
BOOLEAN OwnerIsDriver;
//
// SessionId associated with file handle. Used to map file handles to emulated gamepad devices
//
LONG SessionId;
} PDO_IDENTIFICATION_DESCRIPTION, * PPDO_IDENTIFICATION_DESCRIPTION;

View File

@@ -31,19 +31,6 @@ namespace ViGEm::Bus::Targets
private:
static PCWSTR _deviceDescription;
#if defined(_X86_)
static const int XUSB_CONFIGURATION_SIZE = 0x00E4;
#else
static const int XUSB_CONFIGURATION_SIZE = 0x0130;
#endif
static const int XUSB_DESCRIPTOR_SIZE = 0x0099;
static const int XUSB_RUMBLE_SIZE = 0x08;
static const int XUSB_LEDSET_SIZE = 0x03;
static const int XUSB_LEDNUM_SIZE = 0x01;
static const int XUSB_INIT_STAGE_SIZE = 0x03;
static const int XUSB_BLOB_STORAGE_SIZE = 0x2A;
static const int HID_GET_FEATURE_REPORT_SIZE_0 = 0x31;
static const int HID_GET_FEATURE_REPORT_SIZE_1 = 0x25;
static const int HID_GET_FEATURE_REPORT_MAC_ADDRESSES_SIZE = 0x10;