2 Commits

Author SHA1 Message Date
Benjamin Höglinger-Stelzer
14c16243c6 Attempt to fix #8 2018-10-05 19:26:16 +02:00
Benjamin Höglinger-Stelzer
c34afa953d Fixed issues #6, #7
Moved another few bytes to heap
2018-10-03 19:55:13 +02:00
4 changed files with 24 additions and 10 deletions

2
.gitignore vendored
View File

@@ -33,3 +33,5 @@
/Debug
/sys/Debug
/sys/ARM/Debug
/lib/Debug (dynamic)/*.log
/sys/RCa25584

View File

@@ -49,7 +49,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_XUSB_UNKNOWN_2,
#define XUSB_LEDSET_SIZE 0x03
#define XUSB_LEDNUM_SIZE 0x01
#define XUSB_INIT_STAGE_SIZE 0x03
#define XUSB_BLOB_STORAGE_SIZE 0x26
#define XUSB_BLOB_STORAGE_SIZE 0x2A
#define XUSB_BLOB_00_OFFSET 0x00
#define XUSB_BLOB_01_OFFSET 0x03
@@ -58,6 +58,7 @@ DEFINE_GUID(GUID_DEVINTERFACE_XUSB_UNKNOWN_2,
#define XUSB_BLOB_04_OFFSET 0x0C
#define XUSB_BLOB_05_OFFSET 0x20
#define XUSB_BLOB_06_OFFSET 0x23
#define XUSB_BLOB_07_OFFSET 0x26
#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))

View File

@@ -442,7 +442,7 @@ NTSTATUS Bus_CreatePdo(
// Create and assign queue for user-land notification requests
WDF_IO_QUEUE_CONFIG_INIT(&notificationsQueueConfig, WdfIoQueueDispatchManual);
status = WdfIoQueueCreate(hChild, &notificationsQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &pdoData->PendingNotificationRequests);
status = WdfIoQueueCreate(Device, &notificationsQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &pdoData->PendingNotificationRequests);
if (!NT_SUCCESS(status))
{
TraceEvents(TRACE_LEVEL_ERROR,
@@ -598,6 +598,8 @@ VOID Pdo_EvtIoInternalDeviceControl(
PURB urb;
PPDO_DEVICE_DATA pdoData;
PIO_STACK_LOCATION irpStack;
PXUSB_DEVICE_DATA pXusbData;
PUCHAR blobBuffer;
TraceEvents(TRACE_LEVEL_VERBOSE, TRACE_BUSPDO, "%!FUNC! Entry");
@@ -629,13 +631,20 @@ VOID Pdo_EvtIoInternalDeviceControl(
switch (urb->UrbControlTransfer.SetupPacket[6])
{
case 0x04:
//
// Xenon magic
//
COPY_BYTE_ARRAY(urb->UrbControlTransfer.TransferBuffer, P99_PROTECT({
0x31, 0x3F, 0xCF, 0xDC
}));
status = STATUS_SUCCESS;
if (pdoData->TargetType == Xbox360Wired)
{
pXusbData = XusbGetData(hDevice);
blobBuffer = WdfMemoryGetBuffer(pXusbData->InterruptBlobStorage, NULL);
//
// Xenon magic
//
RtlCopyMemory(
urb->UrbControlTransfer.TransferBuffer,
&blobBuffer[XUSB_BLOB_07_OFFSET],
0x04
);
status = STATUS_SUCCESS;
}
break;
case 0x14:
//

View File

@@ -295,7 +295,9 @@ NTSTATUS Xusb_AssignPdoContext(WDFDEVICE Device)
// 5
0x01, 0x03, 0x03,
// 6
0x05, 0x03, 0x00
0x05, 0x03, 0x00,
// 7
0x31, 0x3F, 0xCF, 0xDC
}));
// I/O Queue for pending IRPs