diff --git a/nx/include/switch/services/usbhs.h b/nx/include/switch/services/usbhs.h index ab176af1..ffba036a 100644 --- a/nx/include/switch/services/usbhs.h +++ b/nx/include/switch/services/usbhs.h @@ -89,7 +89,7 @@ typedef struct { Event eventCtrlXfer; ///< [2.0.0+] Signaled when CtrlXferAsync finishes. s32 ID; - UsbHsInterface inf; ///< Initialized with the input interface from \ref usbHsAcquireUsbIf, then the first 0x1B8-bytes are overwritten with the cmd output (data before pathstr). + UsbHsInterface inf; ///< Initialized with the input interface from \ref usbHsAcquireUsbIf, then overwritten with the cmd output. Pre-3.0.0 this only overwrites the first 0x1B8-bytes (data before pathstr). } UsbHsClientIfSession; typedef struct { diff --git a/nx/source/services/usbhs.c b/nx/source/services/usbhs.c index 490045a2..165ccbda 100644 --- a/nx/source/services/usbhs.c +++ b/nx/source/services/usbhs.c @@ -337,7 +337,14 @@ Result usbHsAcquireUsbIf(UsbHsClientIfSession* s, UsbHsInterface *interface) { s32 ID; } *raw; - ipcAddRecvBuffer(&c, &s->inf.inf, sizeof(UsbHsInterfaceInfo), BufferType_Normal); + if (!kernelAbove300()) { + ipcAddRecvBuffer(&c, &s->inf.inf, sizeof(UsbHsInterfaceInfo), BufferType_Normal); + } + else { + size_t tmpoff = offsetof(UsbHsInterfaceInfo, output_endpoint_descs[12]); + ipcAddRecvBuffer(&c, &s->inf.inf, tmpoff, BufferType_Normal); + ipcAddRecvBuffer(&c, &s->inf.inf.output_endpoint_descs[12], sizeof(UsbHsInterface) - tmpoff, BufferType_Normal); + } raw = serviceIpcPrepareHeader(&g_usbHsSrv, &c, sizeof(*raw));