mirror of
https://github.com/nefarius/ViGEmBus.git
synced 2025-08-10 00:52:17 +00:00
Replaced tabs with spaces
This commit is contained in:
@@ -22,13 +22,13 @@
|
||||
#include <ntifs.h>
|
||||
|
||||
#define INITIAL_ARRAY_CAPACITY PAGE_SIZE
|
||||
#define ARRAY_POOL_TAG 'arrA'
|
||||
#define ARRAY_POOL_TAG 'arrA'
|
||||
|
||||
typedef struct _BYTE_ARRAY
|
||||
{
|
||||
UCHAR* Data; //> array of data we're storing
|
||||
ULONG_PTR Size; //> slots used so far
|
||||
ULONG_PTR Capacity; //> total available memory
|
||||
UCHAR* Data; //> array of data we're storing
|
||||
ULONG_PTR Size; //> slots used so far
|
||||
ULONG_PTR Capacity; //> total available memory
|
||||
} BYTE_ARRAY, *PBYTE_ARRAY;
|
||||
|
||||
NTSTATUS InitByteArray(IN OUT PBYTE_ARRAY Array);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#define HID_REPORT_ID_3 0x13
|
||||
#define HID_REPORT_ID_4 0x14
|
||||
|
||||
#define DS4_DESCRIPTOR_SIZE 0x0029
|
||||
#define DS4_DESCRIPTOR_SIZE 0x0029
|
||||
#if defined(_X86_)
|
||||
#define DS4_CONFIGURATION_SIZE 0x0050
|
||||
#else
|
||||
|
||||
@@ -46,7 +46,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_XGIP_UNKNOWN_4,
|
||||
|
||||
#pragma once
|
||||
|
||||
#define XGIP_DESCRIPTOR_SIZE 0x0040
|
||||
#define XGIP_DESCRIPTOR_SIZE 0x0040
|
||||
#define XGIP_CONFIGURATION_SIZE 0x88
|
||||
#define XGIP_REPORT_SIZE 0x12
|
||||
#define XGIP_SYS_INIT_PACKETS 0x0F
|
||||
|
||||
12
sys/Xusb.h
12
sys/Xusb.h
@@ -44,12 +44,12 @@ DEFINE_GUID(GUID_DEVINTERFACE_XUSB_UNKNOWN_2,
|
||||
#else
|
||||
#define XUSB_CONFIGURATION_SIZE 0x0130
|
||||
#endif
|
||||
#define XUSB_DESCRIPTOR_SIZE 0x0099
|
||||
#define XUSB_DESCRIPTOR_SIZE 0x0099
|
||||
#define XUSB_RUMBLE_SIZE 0x08
|
||||
#define XUSB_LEDSET_SIZE 0x03
|
||||
#define XUSB_LEDNUM_SIZE 0x01
|
||||
#define XUSB_INIT_STAGE_SIZE 0x03
|
||||
#define XUSB_INIT_BLOB_COUNT 0x07
|
||||
#define XUSB_INIT_BLOB_COUNT 0x07
|
||||
|
||||
#define XUSB_IS_DATA_PIPE(_x_) ((BOOLEAN)(_x_->PipeHandle == (USBD_PIPE_HANDLE)0xFFFF0081))
|
||||
#define XUSB_IS_CONTROL_PIPE(_x_) ((BOOLEAN)(_x_->PipeHandle == (USBD_PIPE_HANDLE)0xFFFF0083))
|
||||
@@ -99,10 +99,10 @@ typedef struct _XUSB_DEVICE_DATA
|
||||
//
|
||||
ULONG InterruptInitStage;
|
||||
|
||||
//
|
||||
// Storage of binary blobs (packets) for PDO initialization
|
||||
//
|
||||
PVOID InterruptInitStageBlobs[XUSB_INIT_BLOB_COUNT];
|
||||
//
|
||||
// Storage of binary blobs (packets) for PDO initialization
|
||||
//
|
||||
PVOID InterruptInitStageBlobs[XUSB_INIT_BLOB_COUNT];
|
||||
|
||||
} XUSB_DEVICE_DATA, *PXUSB_DEVICE_DATA;
|
||||
|
||||
|
||||
40
sys/buspdo.c
40
sys/buspdo.c
@@ -262,7 +262,7 @@ NTSTATUS Bus_CreatePdo(
|
||||
WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
|
||||
|
||||
pnpPowerCallbacks.EvtDevicePrepareHardware = Pdo_EvtDevicePrepareHardware;
|
||||
pnpPowerCallbacks.EvtDeviceReleaseHardware = Pdo_EvtDeviceReleaseHardware;
|
||||
pnpPowerCallbacks.EvtDeviceReleaseHardware = Pdo_EvtDeviceReleaseHardware;
|
||||
|
||||
WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &pnpPowerCallbacks);
|
||||
|
||||
@@ -585,37 +585,37 @@ NTSTATUS Pdo_EvtDevicePrepareHardware(
|
||||
_Use_decl_annotations_
|
||||
NTSTATUS
|
||||
Pdo_EvtDeviceReleaseHardware(
|
||||
WDFDEVICE Device,
|
||||
WDFCMRESLIST ResourcesTranslated
|
||||
WDFDEVICE Device,
|
||||
WDFCMRESLIST ResourcesTranslated
|
||||
)
|
||||
{
|
||||
PPDO_DEVICE_DATA pdoData;
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
PPDO_DEVICE_DATA pdoData;
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
|
||||
PAGED_CODE();
|
||||
PAGED_CODE();
|
||||
|
||||
UNREFERENCED_PARAMETER(ResourcesTranslated);
|
||||
UNREFERENCED_PARAMETER(ResourcesTranslated);
|
||||
|
||||
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_BUSENUM, "%!FUNC! Entry");
|
||||
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_BUSENUM, "%!FUNC! Entry");
|
||||
|
||||
pdoData = PdoGetData(Device);
|
||||
pdoData = PdoGetData(Device);
|
||||
|
||||
switch (pdoData->TargetType)
|
||||
{
|
||||
// Free XUSB resources
|
||||
case Xbox360Wired:
|
||||
switch (pdoData->TargetType)
|
||||
{
|
||||
// Free XUSB resources
|
||||
case Xbox360Wired:
|
||||
|
||||
status = Xusb_ReleaseHardware(Device);
|
||||
status = Xusb_ReleaseHardware(Device);
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_BUSPDO, "%!FUNC! Exit with status %!STATUS!", status);
|
||||
TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_BUSPDO, "%!FUNC! Exit with status %!STATUS!", status);
|
||||
|
||||
return status;
|
||||
return status;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
90
sys/usbpdo.c
90
sys/usbpdo.c
@@ -553,57 +553,57 @@ NTSTATUS UsbPdo_BulkOrInterruptTransfer(PURB urb, WDFDEVICE Device, WDFREQUEST R
|
||||
{
|
||||
case 0:
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
return STATUS_SUCCESS;
|
||||
case 1:
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
return STATUS_SUCCESS;
|
||||
case 2:
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
return STATUS_SUCCESS;
|
||||
case 3:
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
return STATUS_SUCCESS;
|
||||
case 4:
|
||||
pTransfer->TransferBufferLength = sizeof(XUSB_INTERRUPT_IN_PACKET);
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
sizeof(XUSB_INTERRUPT_IN_PACKET)
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
pTransfer->TransferBufferLength = sizeof(XUSB_INTERRUPT_IN_PACKET);
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
sizeof(XUSB_INTERRUPT_IN_PACKET)
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
return STATUS_SUCCESS;
|
||||
case 5:
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
pTransfer->TransferBufferLength = XUSB_INIT_STAGE_SIZE;
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[xusb->InterruptInitStage],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
xusb->InterruptInitStage++;
|
||||
return STATUS_SUCCESS;
|
||||
default:
|
||||
/* This request is sent periodically and relies on data the "feeder"
|
||||
@@ -619,11 +619,11 @@ NTSTATUS UsbPdo_BulkOrInterruptTransfer(PURB urb, WDFDEVICE Device, WDFREQUEST R
|
||||
{
|
||||
if (!xusb->ReportedCapabilities && pTransfer->TransferBufferLength >= XUSB_INIT_STAGE_SIZE)
|
||||
{
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[0x06],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
RtlCopyMemory(
|
||||
pTransfer->TransferBuffer,
|
||||
xusb->InterruptInitStageBlobs[0x06],
|
||||
XUSB_INIT_STAGE_SIZE
|
||||
);
|
||||
|
||||
xusb->ReportedCapabilities = TRUE;
|
||||
|
||||
|
||||
1084
sys/xusb.c
1084
sys/xusb.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user