mirror of
https://github.com/nefarius/ViGEmBus.git
synced 2025-08-10 00:52:17 +00:00
Hardened device type checks
Removed obsolete code
This commit is contained in:
@@ -367,71 +367,3 @@ EXTERN_C NTSTATUS Bus_UnPlugDevice(
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Sends a report update to an XUSB PDO.
|
||||
//
|
||||
EXTERN_C NTSTATUS Bus_XusbSubmitReport(WDFDEVICE Device, ULONG SerialNo, PXUSB_SUBMIT_REPORT Report, BOOLEAN FromInterface)
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_VERBOSE, TRACE_BUSENUM, "%!FUNC! Entry");
|
||||
|
||||
return Bus_SubmitReport(Device, SerialNo, Report, FromInterface);
|
||||
}
|
||||
|
||||
//
|
||||
// Queues an inverted call to receive XUSB-specific updates.
|
||||
//
|
||||
EXTERN_C NTSTATUS Bus_QueueNotification(WDFDEVICE Device, ULONG SerialNo, WDFREQUEST Request)
|
||||
{
|
||||
NTSTATUS status;
|
||||
EmulationTargetPDO* pdo;
|
||||
|
||||
TraceDbg(TRACE_BUSENUM, "%!FUNC! Entry");
|
||||
|
||||
// Validate child
|
||||
if (!EmulationTargetPDO::GetPdoBySerial(Device, SerialNo, &pdo))
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_ERROR,
|
||||
TRACE_BUSENUM,
|
||||
"PDO with serial %d not found",
|
||||
SerialNo);
|
||||
return STATUS_NO_SUCH_DEVICE;
|
||||
}
|
||||
|
||||
status = pdo->EnqueueNotification(Request);
|
||||
|
||||
status = (NT_SUCCESS(status)) ? STATUS_PENDING : status;
|
||||
|
||||
TraceDbg(TRACE_BUSENUM, "%!FUNC! Exit with status %!STATUS!", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//
|
||||
// Sends a report update to a DS4 PDO.
|
||||
//
|
||||
NTSTATUS Bus_Ds4SubmitReport(WDFDEVICE Device, ULONG SerialNo, PDS4_SUBMIT_REPORT Report, BOOLEAN FromInterface)
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_VERBOSE, TRACE_BUSENUM, "%!FUNC! Entry");
|
||||
|
||||
return Bus_SubmitReport(Device, SerialNo, Report, FromInterface);
|
||||
}
|
||||
|
||||
EXTERN_C NTSTATUS Bus_SubmitReport(WDFDEVICE Device, ULONG SerialNo, PVOID Report, BOOLEAN FromInterface)
|
||||
{
|
||||
EmulationTargetPDO* pdo;
|
||||
|
||||
UNREFERENCED_PARAMETER(FromInterface);
|
||||
|
||||
// Validate child
|
||||
if (!EmulationTargetPDO::GetPdoBySerial(Device, SerialNo, &pdo))
|
||||
{
|
||||
TraceEvents(TRACE_LEVEL_ERROR,
|
||||
TRACE_BUSENUM,
|
||||
"PDO with serial %d not found",
|
||||
SerialNo);
|
||||
return STATUS_NO_SUCH_DEVICE;
|
||||
}
|
||||
|
||||
return pdo->SubmitReport(Report);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user