mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-06-22 19:32:39 +02:00
Stratosphere: Fix IServer constructors. SM is fully functional on hardware now.
This commit is contained in:
parent
d772b823c6
commit
309a4607dd
@ -4,10 +4,6 @@
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class ExistingPortServer : public IServer<T> {
|
class ExistingPortServer : public IServer<T> {
|
||||||
private:
|
|
||||||
virtual Result register_self(const char *service_name) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
public:
|
public:
|
||||||
ExistingPortServer(Handle port_h, unsigned int max_s) : IServer<T>(NULL, max_s) {
|
ExistingPortServer(Handle port_h, unsigned int max_s) : IServer<T>(NULL, max_s) {
|
||||||
this->port_handle = port_h;
|
this->port_handle = port_h;
|
||||||
|
@ -17,15 +17,9 @@ class IServer : public IWaitable {
|
|||||||
unsigned int max_sessions;
|
unsigned int max_sessions;
|
||||||
unsigned int num_sessions;
|
unsigned int num_sessions;
|
||||||
ServiceSession<T> **sessions;
|
ServiceSession<T> **sessions;
|
||||||
virtual Result register_self(const char *service_name) {
|
|
||||||
return smRegisterService(&this->port_handle, service_name, false, this->max_sessions);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IServer(const char *service_name, unsigned int max_s) : max_sessions(max_s) {
|
IServer(const char *service_name, unsigned int max_s) : max_sessions(max_s) {
|
||||||
if (R_FAILED(register_self(service_name))) {
|
|
||||||
/* TODO: Panic. */
|
|
||||||
}
|
|
||||||
this->sessions = new ServiceSession<T> *[this->max_sessions];
|
this->sessions = new ServiceSession<T> *[this->max_sessions];
|
||||||
for (unsigned int i = 0; i < this->max_sessions; i++) {
|
for (unsigned int i = 0; i < this->max_sessions; i++) {
|
||||||
this->sessions[i] = NULL;
|
this->sessions[i] = NULL;
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class ManagedPortServer : public IServer<T> {
|
class ManagedPortServer : public IServer<T> {
|
||||||
private:
|
|
||||||
virtual Result register_self(const char *service_name) {
|
|
||||||
return svcManageNamedPort(&this->port_handle, service_name, this->max_sessions);
|
|
||||||
}
|
|
||||||
public:
|
public:
|
||||||
ManagedPortServer(const char *service_name, unsigned int max_s) : IServer<T>(service_name, max_s) { }
|
ManagedPortServer(const char *service_name, unsigned int max_s) : IServer<T>(service_name, max_s) {
|
||||||
|
if (R_FAILED(svcManageNamedPort(&this->port_handle, service_name, this->max_sessions))) {
|
||||||
|
/* TODO: panic */
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class ServiceServer : public IServer<T> {
|
class ServiceServer : public IServer<T> {
|
||||||
private:
|
|
||||||
virtual Result register_self(const char *service_name) {
|
|
||||||
return smRegisterService(&this->port_handle, service_name, false, this->max_sessions);
|
|
||||||
}
|
|
||||||
public:
|
public:
|
||||||
ServiceServer(const char *service_name, unsigned int max_s) : IServer<T>(service_name, max_s) { }
|
ServiceServer(const char *service_name, unsigned int max_s) : IServer<T>(service_name, max_s) {
|
||||||
|
if (R_FAILED(smRegisterService(&this->port_handle, service_name, false, this->max_sessions))) {
|
||||||
|
/* TODO: Panic. */
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
@ -1,7 +1,6 @@
|
|||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
#include <stratosphere/waitablemanager.hpp>
|
#include <stratosphere/waitablemanager.hpp>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user