diff --git a/sdk/include/ViGEm/Client.h b/sdk/include/ViGEm/Client.h index bcfd55f..f4839e4 100644 --- a/sdk/include/ViGEm/Client.h +++ b/sdk/include/ViGEm/Client.h @@ -374,6 +374,20 @@ extern "C" { */ VIGEM_API VIGEM_ERROR vigem_target_ds4_update(PVIGEM_CLIENT vigem, PVIGEM_TARGET target, DS4_REPORT report); + /** + * Sends a full size state report to the provided target device. + * + * @author Benjamin "Nefarius" Höglinger-Stelzer + * @date 07.09.2020 + * + * @param vigem The driver connection object. + * @param target The target device object. + * @param report The report buffer. + * + * @returns A VIGEM_ERROR. + */ + VIGEM_API VIGEM_ERROR vigem_target_ds4_update_ex(PVIGEM_CLIENT vigem, PVIGEM_TARGET target, PUCHAR report); + /** * Returns the internal index (serial number) the bus driver assigned to the provided * target device object. Note that this value is specific to the inner workings of diff --git a/sdk/include/ViGEm/km/BusShared.h b/sdk/include/ViGEm/km/BusShared.h index 88662f3..d9fd632 100644 --- a/sdk/include/ViGEm/km/BusShared.h +++ b/sdk/include/ViGEm/km/BusShared.h @@ -424,5 +424,39 @@ VOID FORCEINLINE DS4_SUBMIT_REPORT_INIT( DS4_REPORT_INIT(&Report->Report); } -#pragma endregion +typedef struct _DS4_SUBMIT_REPORT_EX +{ + // + // sizeof(struct _DS4_SUBMIT_REPORT_EX) + // + _In_ ULONG Size; + // + // Serial number of target device. + // + _In_ ULONG SerialNo; + + // + // Full size HID report excluding fixed Report ID. + // + _In_ UCHAR Report[63]; + +} DS4_SUBMIT_REPORT_EX, * PDS4_SUBMIT_REPORT_EX; + +#include + +// +// Initializes a DualShock 4 report. +// +VOID FORCEINLINE DS4_SUBMIT_REPORT_EX_INIT( + _Out_ PDS4_SUBMIT_REPORT_EX Report, + _In_ ULONG SerialNo +) +{ + RtlZeroMemory(Report, sizeof(DS4_SUBMIT_REPORT_EX)); + + Report->Size = sizeof(DS4_SUBMIT_REPORT_EX); + Report->SerialNo = SerialNo; +} + +#pragma endregion diff --git a/sdk/src/ViGEmClient.cpp b/sdk/src/ViGEmClient.cpp index 211cf2f..68a3b1a 100644 --- a/sdk/src/ViGEmClient.cpp +++ b/sdk/src/ViGEmClient.cpp @@ -939,6 +939,11 @@ VIGEM_ERROR vigem_target_ds4_update( return VIGEM_ERROR_NONE; } +VIGEM_ERROR vigem_target_ds4_update_ex(PVIGEM_CLIENT vigem, PVIGEM_TARGET target, PUCHAR report) +{ + return VIGEM_API VIGEM_ERROR(); +} + ULONG vigem_target_get_index(PVIGEM_TARGET target) { return target->SerialNo;