Removed unused code

This commit is contained in:
Benjamin Höglinger-Stelzer
2020-05-13 21:46:14 +02:00
parent 225c536205
commit 5d2dd2a122
7 changed files with 53 additions and 124 deletions

View File

@@ -24,6 +24,7 @@
* SOFTWARE.
*/
#include <ntifs.h>
#include "Ds4Pdo.hpp"
#include "trace.h"
#include "Ds4Pdo.tmh"
@@ -32,7 +33,6 @@
#include <hidclass.h>
PCWSTR ViGEm::Bus::Targets::EmulationTargetDS4::_deviceDescription = L"Virtual DualShock 4 Controller";
ViGEm::Bus::Targets::EmulationTargetDS4::EmulationTargetDS4(ULONG Serial, LONG SessionId, USHORT VendorId,
@@ -1127,6 +1127,41 @@ NTSTATUS ViGEm::Bus::Targets::EmulationTargetDS4::SubmitReportImpl(PVOID NewRepo
return status;
}
VOID ViGEm::Bus::Targets::EmulationTargetDS4::ReverseByteArray(PUCHAR Array, INT Length)
{
const auto s = static_cast<PUCHAR>(ExAllocatePoolWithTag(
NonPagedPool,
sizeof(UCHAR) * Length,
'U4SD'
));
INT c, d;
if (s == nullptr)
return;
for (c = Length - 1, d = 0; c >= 0; c--, d++)
*(s + d) = *(Array + c);
for (c = 0; c < Length; c++)
*(Array + c) = *(s + c);
ExFreePoolWithTag(s, 'U4SD');
}
VOID ViGEm::Bus::Targets::EmulationTargetDS4::GenerateRandomMacAddress(PMAC_ADDRESS Address)
{
// Vendor "C0:13:37"
Address->Vendor0 = 0xC0;
Address->Vendor1 = 0x13;
Address->Vendor2 = 0x37;
ULONG seed = KeQueryPerformanceCounter(NULL).LowPart;
Address->Nic0 = RtlRandomEx(&seed) % 0xFF;
Address->Nic1 = RtlRandomEx(&seed) % 0xFF;
Address->Nic2 = RtlRandomEx(&seed) % 0xFF;
}
VOID ViGEm::Bus::Targets::EmulationTargetDS4::PendingUsbRequestsTimerFunc(
_In_ WDFTIMER Timer
)