mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-27 12:46:03 +00:00
Add support for receiving X descriptors (works on console)
This commit is contained in:
parent
7fed8a4428
commit
c5b7f39a67
2 changed files with 15 additions and 2 deletions
|
@ -18,6 +18,11 @@ Result DebugMonitorService::dispatch(IpcParsedCommand *r, IpcCommand *out_c, u32
|
|||
break;
|
||||
}
|
||||
|
||||
if (r->Statics[0] == NULL) {
|
||||
rc = 0xCE01;
|
||||
break;
|
||||
}
|
||||
|
||||
rc = add_title_to_launch_queue(((u64 *)in_rawdata)[0], (const char *)r->Statics[0], r->StaticSizes[0]);
|
||||
|
||||
*out_raw_data_count = 4;
|
||||
|
|
|
@ -18,6 +18,7 @@ class ServiceSession : public IWaitable {
|
|||
ServiceServer<T> *server;
|
||||
Handle server_handle;
|
||||
Handle client_handle;
|
||||
char pointer_buffer[0x400];
|
||||
public:
|
||||
ServiceSession<T>(ServiceServer<T> *s, Handle s_h, Handle c_h) : server(s), server_handle(s_h), client_handle(c_h) {
|
||||
this->service_object = new T();
|
||||
|
@ -57,6 +58,13 @@ class ServiceSession : public IWaitable {
|
|||
virtual Result handle_signaled(u64 timeout) {
|
||||
Result rc;
|
||||
int handle_index;
|
||||
|
||||
/* Prepare pointer buffer... */
|
||||
IpcCommand c_for_reply;
|
||||
ipcInitialize(&c_for_reply);
|
||||
ipcAddRecvStatic(&c_for_reply, this->pointer_buffer, sizeof(this->pointer_buffer), 0);
|
||||
ipcPrepareHeader(&c_for_reply, 0);
|
||||
|
||||
if (R_SUCCEEDED(rc = svcReplyAndReceive(&handle_index, &this->server_handle, 1, 0, timeout))) {
|
||||
if (handle_index != 0) {
|
||||
/* TODO: Panic? */
|
||||
|
@ -67,7 +75,7 @@ class ServiceSession : public IWaitable {
|
|||
u32 wordcount = 0;
|
||||
Result retval = 0;
|
||||
u32 *rawdata_start = cmdbuf;
|
||||
|
||||
|
||||
IpcParsedCommand r;
|
||||
IpcCommand c;
|
||||
|
||||
|
@ -76,7 +84,7 @@ class ServiceSession : public IWaitable {
|
|||
ipcInitialize(&c);
|
||||
|
||||
retval = ipcParse(&r);
|
||||
|
||||
|
||||
if (R_SUCCEEDED(retval)) {
|
||||
rawdata_start = (u32 *)r.Raw;
|
||||
wordcount = r.RawSize;
|
||||
|
|
Loading…
Reference in a new issue