mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
We don't understand Auto -- disable for now
This commit is contained in:
parent
b2810ab38d
commit
20c4bfd54a
@ -10,7 +10,6 @@ typedef struct {
|
||||
s32 id;
|
||||
Handle nativeHandle;
|
||||
size_t ipcBufferSize;
|
||||
bool hasTransactAuto;
|
||||
} Binder;
|
||||
|
||||
// binderExitSession will not close the sessionHandle since it's user-specified via binderCreateSession and may be used elsewhere.
|
||||
|
@ -12,7 +12,6 @@ void binderCreateSession(Binder *session, Handle sessionHandle, s32 id)
|
||||
session->sessionHandle = sessionHandle;
|
||||
session->id = id;
|
||||
session->nativeHandle = INVALID_HANDLE;
|
||||
session->hasTransactAuto = 0;
|
||||
}
|
||||
|
||||
Result binderInitSession(Binder *session, u32 unk0)
|
||||
@ -58,10 +57,6 @@ Result binderInitSession(Binder *session, u32 unk0)
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Use TransactParcelAuto when available.
|
||||
if (kernelAbove300())
|
||||
session->hasTransactAuto = 1;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -132,73 +127,6 @@ static Result _binderTransactParcel(
|
||||
return rc;
|
||||
}
|
||||
|
||||
static Result _binderTransactParcelAuto(
|
||||
Binder *session, u32 code,
|
||||
void* parcel_data, size_t parcel_data_size,
|
||||
void* parcel_reply, size_t parcel_reply_size,
|
||||
u32 flags)
|
||||
{
|
||||
if (!session->created || !session->initialized) return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
s32 session_id;
|
||||
u32 code;
|
||||
u32 flags;
|
||||
} *raw;
|
||||
|
||||
void* buf_static[2] = {parcel_data, parcel_reply};
|
||||
void* buf_transfer[2] = {parcel_data, parcel_reply};
|
||||
size_t buf_static_size[2] = {parcel_data_size, parcel_reply_size};
|
||||
size_t buf_transfer_size[2] = {parcel_data_size, parcel_reply_size};
|
||||
|
||||
if(session->ipcBufferSize!=0 && buf_static_size[0] <= session->ipcBufferSize) {
|
||||
buf_transfer[0] = NULL;
|
||||
buf_transfer[1] = NULL;
|
||||
buf_transfer_size[0] = 0;
|
||||
buf_transfer_size[1] = 0;
|
||||
}
|
||||
else {
|
||||
buf_static[0] = NULL;
|
||||
buf_static[1] = NULL;
|
||||
buf_static_size[0] = 0;
|
||||
buf_static_size[1] = 0;
|
||||
}
|
||||
|
||||
ipcAddSendBuffer(&c, buf_transfer[0], buf_transfer_size[0], 0);
|
||||
ipcAddRecvBuffer(&c, buf_transfer[1], buf_transfer_size[1], 0);
|
||||
|
||||
ipcAddSendStatic(&c, buf_static[0], buf_static_size[0], 0);
|
||||
ipcAddRecvStatic(&c, buf_static[1], buf_static_size[1], 0);
|
||||
|
||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 3;
|
||||
raw->session_id = session->id;
|
||||
raw->code = code;
|
||||
raw->flags = flags;
|
||||
|
||||
Result rc = ipcDispatch(session->sessionHandle);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
ipcParse(&r);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
} *resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result binderTransactParcel(
|
||||
Binder *session, u32 code,
|
||||
void* parcel_data, size_t parcel_data_size,
|
||||
@ -207,10 +135,7 @@ Result binderTransactParcel(
|
||||
{
|
||||
Result rc = 0;
|
||||
|
||||
if (session->hasTransactAuto)
|
||||
rc = _binderTransactParcelAuto(session, code, parcel_data, parcel_data_size, parcel_reply, parcel_reply_size, flags);
|
||||
else
|
||||
rc = _binderTransactParcel(session, code, parcel_data, parcel_data_size, parcel_reply, parcel_reply_size, flags);
|
||||
rc = _binderTransactParcel(session, code, parcel_data, parcel_data_size, parcel_reply, parcel_reply_size, flags);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user