stratosphere: all in on enum class CommandId
This commit is contained in:
@@ -20,9 +20,13 @@
|
||||
|
||||
#include "../utils.hpp"
|
||||
|
||||
#include "nsmitm_service_common.hpp"
|
||||
|
||||
class NsAmMitmService : public IMitmServiceObject {
|
||||
private:
|
||||
enum class CommandId {
|
||||
GetApplicationContentPath = 21,
|
||||
ResolveApplicationContentPath = 23,
|
||||
GetRunningApplicationProgramId = 92,
|
||||
};
|
||||
public:
|
||||
NsAmMitmService(std::shared_ptr<Service> s, u64 pid) : IMitmServiceObject(s, pid) {
|
||||
/* ... */
|
||||
@@ -44,8 +48,8 @@ class NsAmMitmService : public IMitmServiceObject {
|
||||
Result GetRunningApplicationProgramId(Out<u64> out_tid, u64 app_id);
|
||||
public:
|
||||
DEFINE_SERVICE_DISPATCH_TABLE {
|
||||
MakeServiceCommandMeta<NsSrvCmd_GetApplicationContentPath, &NsAmMitmService::GetApplicationContentPath>(),
|
||||
MakeServiceCommandMeta<NsSrvCmd_ResolveApplicationContentPath, &NsAmMitmService::ResolveApplicationContentPath>(),
|
||||
MakeServiceCommandMeta<NsSrvCmd_GetRunningApplicationProgramId, &NsAmMitmService::GetRunningApplicationProgramId, FirmwareVersion_600>(),
|
||||
MAKE_SERVICE_COMMAND_META(NsAmMitmService, GetApplicationContentPath),
|
||||
MAKE_SERVICE_COMMAND_META(NsAmMitmService, ResolveApplicationContentPath),
|
||||
MAKE_SERVICE_COMMAND_META(NsAmMitmService, GetRunningApplicationProgramId, FirmwareVersion_600),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2019 Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "../utils.hpp"
|
||||
|
||||
enum NsGetterCmd : u32 {
|
||||
NsGetterCmd_GetDocumentInterface = 7999,
|
||||
};
|
||||
|
||||
enum NsSrvCmd : u32 {
|
||||
NsSrvCmd_GetApplicationContentPath = 21,
|
||||
NsSrvCmd_ResolveApplicationContentPath = 23,
|
||||
NsSrvCmd_GetRunningApplicationProgramId = 92,
|
||||
};
|
||||
@@ -20,10 +20,15 @@
|
||||
|
||||
#include "../utils.hpp"
|
||||
|
||||
#include "nsmitm_service_common.hpp"
|
||||
#include "ns_shim.h"
|
||||
|
||||
class NsDocumentService : public IServiceObject {
|
||||
private:
|
||||
enum class CommandId {
|
||||
GetApplicationContentPath = 21,
|
||||
ResolveApplicationContentPath = 23,
|
||||
GetRunningApplicationProgramId = 92,
|
||||
};
|
||||
private:
|
||||
u64 title_id;
|
||||
std::unique_ptr<NsDocumentInterface> srv;
|
||||
@@ -50,13 +55,17 @@ class NsDocumentService : public IServiceObject {
|
||||
Result GetRunningApplicationProgramId(Out<u64> out_tid, u64 app_id);
|
||||
public:
|
||||
DEFINE_SERVICE_DISPATCH_TABLE {
|
||||
MakeServiceCommandMeta<NsSrvCmd_GetApplicationContentPath, &NsDocumentService::GetApplicationContentPath>(),
|
||||
MakeServiceCommandMeta<NsSrvCmd_ResolveApplicationContentPath, &NsDocumentService::ResolveApplicationContentPath>(),
|
||||
MakeServiceCommandMeta<NsSrvCmd_GetRunningApplicationProgramId, &NsDocumentService::GetRunningApplicationProgramId, FirmwareVersion_600>(),
|
||||
MAKE_SERVICE_COMMAND_META(NsDocumentService, GetApplicationContentPath),
|
||||
MAKE_SERVICE_COMMAND_META(NsDocumentService, ResolveApplicationContentPath),
|
||||
MAKE_SERVICE_COMMAND_META(NsDocumentService, GetRunningApplicationProgramId, FirmwareVersion_600),
|
||||
};
|
||||
};
|
||||
|
||||
class NsWebMitmService : public IMitmServiceObject {
|
||||
private:
|
||||
enum class CommandId {
|
||||
GetDocumentInterface = 7999,
|
||||
};
|
||||
public:
|
||||
NsWebMitmService(std::shared_ptr<Service> s, u64 pid) : IMitmServiceObject(s, pid) {
|
||||
/* ... */
|
||||
@@ -76,6 +85,6 @@ class NsWebMitmService : public IMitmServiceObject {
|
||||
Result GetDocumentInterface(Out<std::shared_ptr<NsDocumentService>> out_intf);
|
||||
public:
|
||||
DEFINE_SERVICE_DISPATCH_TABLE {
|
||||
MakeServiceCommandMeta<NsGetterCmd_GetDocumentInterface, &NsWebMitmService::GetDocumentInterface, FirmwareVersion_300>(),
|
||||
MAKE_SERVICE_COMMAND_META(NsWebMitmService, GetDocumentInterface, FirmwareVersion_300),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user