1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-29 15:22:15 +00:00

Add support for receiving X descriptors (works on console)

This commit is contained in:
Michael Scire 2018-04-18 21:12:09 -06:00
parent 7fed8a4428
commit c5b7f39a67
2 changed files with 15 additions and 2 deletions

View file

@ -18,6 +18,11 @@ Result DebugMonitorService::dispatch(IpcParsedCommand *r, IpcCommand *out_c, u32
break; 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]); rc = add_title_to_launch_queue(((u64 *)in_rawdata)[0], (const char *)r->Statics[0], r->StaticSizes[0]);
*out_raw_data_count = 4; *out_raw_data_count = 4;

View file

@ -18,6 +18,7 @@ class ServiceSession : public IWaitable {
ServiceServer<T> *server; ServiceServer<T> *server;
Handle server_handle; Handle server_handle;
Handle client_handle; Handle client_handle;
char pointer_buffer[0x400];
public: public:
ServiceSession<T>(ServiceServer<T> *s, Handle s_h, Handle c_h) : server(s), server_handle(s_h), client_handle(c_h) { 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(); this->service_object = new T();
@ -57,6 +58,13 @@ class ServiceSession : public IWaitable {
virtual Result handle_signaled(u64 timeout) { virtual Result handle_signaled(u64 timeout) {
Result rc; Result rc;
int handle_index; 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 (R_SUCCEEDED(rc = svcReplyAndReceive(&handle_index, &this->server_handle, 1, 0, timeout))) {
if (handle_index != 0) { if (handle_index != 0) {
/* TODO: Panic? */ /* TODO: Panic? */