mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 13:22:40 +02:00
Handle the output u8 in _usbDsGetSession, without using it in the callers.
This commit is contained in:
parent
07cd134d24
commit
7ae659c2cb
@ -375,7 +375,7 @@ Result usbDsSetVidPidBcd(const UsbDsDeviceInfo* deviceinfo) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Result _usbDsGetSession(Service* srv, Service* srv_out, u64 cmd_id, const void* buf0, size_t buf0size, const void* buf1, size_t buf1size) {
|
static Result _usbDsGetSession(Service* srv, Service* srv_out, u64 cmd_id, const void* buf0, size_t buf0size, const void* buf1, size_t buf1size, u8 *out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
|
||||||
@ -403,10 +403,13 @@ static Result _usbDsGetSession(Service* srv, Service* srv_out, u64 cmd_id, const
|
|||||||
struct {
|
struct {
|
||||||
u64 magic;
|
u64 magic;
|
||||||
u64 result;
|
u64 result;
|
||||||
|
u8 out;
|
||||||
} *resp = r.Raw;
|
} *resp = r.Raw;
|
||||||
|
|
||||||
rc = resp->result;
|
rc = resp->result;
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc) && out) *out = resp->out;
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
serviceCreate(srv_out, r.Handles[0]);
|
serviceCreate(srv_out, r.Handles[0]);
|
||||||
}
|
}
|
||||||
@ -529,7 +532,7 @@ Result usbDsGetDsInterface(UsbDsInterface** interface, struct usb_interface_desc
|
|||||||
Result rc;
|
Result rc;
|
||||||
for (unsigned int i = 0; i < TOTAL_INTERFACES; i++) {
|
for (unsigned int i = 0; i < TOTAL_INTERFACES; i++) {
|
||||||
send_desc.bInterfaceNumber = i;
|
send_desc.bInterfaceNumber = i;
|
||||||
rc = _usbDsGetSession(&g_usbDsSrv, &srv, 2, &send_desc, USB_DT_INTERFACE_SIZE, interface_name, strlen(interface_name)+1);
|
rc = _usbDsGetSession(&g_usbDsSrv, &srv, 2, &send_desc, USB_DT_INTERFACE_SIZE, interface_name, strlen(interface_name)+1, NULL);
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -929,7 +932,7 @@ Result usbDsInterface_GetDsEndpoint(UsbDsInterface* interface, UsbDsEndpoint** e
|
|||||||
UsbDsEndpoint* ptr = _usbDsAllocateEndpoint(interface);
|
UsbDsEndpoint* ptr = _usbDsAllocateEndpoint(interface);
|
||||||
if(ptr==NULL)return MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
if(ptr==NULL)return MAKERESULT(Module_Libnx, LibnxError_OutOfMemory);
|
||||||
|
|
||||||
Result rc = _usbDsGetSession(&interface->h, &ptr->h, 0, descriptor, USB_DT_ENDPOINT_SIZE, NULL, 0);
|
Result rc = _usbDsGetSession(&interface->h, &ptr->h, 0, descriptor, USB_DT_ENDPOINT_SIZE, NULL, 0, NULL);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) rc = _usbDsGetEvent(&ptr->h, &ptr->CompletionEvent, 2);//GetCompletionEvent
|
if (R_SUCCEEDED(rc)) rc = _usbDsGetEvent(&ptr->h, &ptr->CompletionEvent, 2);//GetCompletionEvent
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user