diff --git a/sys/BusFdoPdoCommon.hpp b/sys/BusFdoPdoCommon.hpp new file mode 100644 index 0000000..02f5b80 --- /dev/null +++ b/sys/BusFdoPdoCommon.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include +#include +#include + +// +// 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; diff --git a/sys/Ds4Pdo.hpp b/sys/Ds4Pdo.hpp index 5322c09..f54ac0f 100644 --- a/sys/Ds4Pdo.hpp +++ b/sys/Ds4Pdo.hpp @@ -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;