Swapped the order of the buffers used in usbHsAcquireUsbIf on 3.0.0+.

This commit is contained in:
yellows8 2018-12-29 19:13:53 -05:00
parent e9cc565e92
commit 2c89aed2b9

View File

@ -341,9 +341,9 @@ Result usbHsAcquireUsbIf(UsbHsClientIfSession* s, UsbHsInterface *interface) {
ipcAddRecvBuffer(&c, &s->inf.inf, sizeof(UsbHsInterfaceInfo), BufferType_Normal); ipcAddRecvBuffer(&c, &s->inf.inf, sizeof(UsbHsInterfaceInfo), BufferType_Normal);
} }
else { else {
size_t tmpoff = offsetof(UsbHsInterfaceInfo, output_endpoint_descs[12]); //These buffer addresses are the inverse of what official sw does - needed to get the correct UsbHsInterface output for some reason.
ipcAddRecvBuffer(&c, &s->inf.inf, tmpoff, BufferType_Normal); ipcAddRecvBuffer(&c, &s->inf.pathstr, sizeof(UsbHsInterface) - sizeof(UsbHsInterfaceInfo), BufferType_Normal);
ipcAddRecvBuffer(&c, &s->inf.inf.output_endpoint_descs[12], sizeof(UsbHsInterface) - tmpoff, BufferType_Normal); ipcAddRecvBuffer(&c, &s->inf.inf, sizeof(UsbHsInterfaceInfo), BufferType_Normal);
} }
raw = serviceIpcPrepareHeader(&g_usbHsSrv, &c, sizeof(*raw)); raw = serviceIpcPrepareHeader(&g_usbHsSrv, &c, sizeof(*raw));