mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-27 12:40:05 +00:00
pctl: rewrite IParentalControlServiceFactory
This commit is contained in:
parent
0e74204aad
commit
5ab49c833d
@ -1,7 +1,7 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/hle/service/ipc_helpers.h"
|
#include "core/hle/service/cmif_serialization.h"
|
||||||
#include "core/hle/service/pctl/parental_control_service.h"
|
#include "core/hle/service/pctl/parental_control_service.h"
|
||||||
#include "core/hle/service/pctl/parental_control_service_factory.h"
|
#include "core/hle/service/pctl/parental_control_service_factory.h"
|
||||||
|
|
||||||
@ -10,26 +10,31 @@ namespace Service::PCTL {
|
|||||||
IParentalControlServiceFactory::IParentalControlServiceFactory(Core::System& system_,
|
IParentalControlServiceFactory::IParentalControlServiceFactory(Core::System& system_,
|
||||||
const char* name_,
|
const char* name_,
|
||||||
Capability capability_)
|
Capability capability_)
|
||||||
: ServiceFramework{system_, name_}, capability{capability_} {}
|
: ServiceFramework{system_, name_}, capability{capability_} {
|
||||||
|
static const FunctionInfo functions[] = {
|
||||||
|
{0, D<&IParentalControlServiceFactory::CreateService>, "CreateService"},
|
||||||
|
{1, D<&IParentalControlServiceFactory::CreateServiceWithoutInitialize>,
|
||||||
|
"CreateServiceWithoutInitialize"},
|
||||||
|
};
|
||||||
|
RegisterHandlers(functions);
|
||||||
|
}
|
||||||
|
|
||||||
IParentalControlServiceFactory::~IParentalControlServiceFactory() = default;
|
IParentalControlServiceFactory::~IParentalControlServiceFactory() = default;
|
||||||
|
|
||||||
void IParentalControlServiceFactory::CreateService(HLERequestContext& ctx) {
|
Result IParentalControlServiceFactory::CreateService(
|
||||||
|
Out<SharedPointer<IParentalControlService>> out_service, ClientProcessId process_id) {
|
||||||
LOG_DEBUG(Service_PCTL, "called");
|
LOG_DEBUG(Service_PCTL, "called");
|
||||||
|
// TODO(ogniK): Get application id from process
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
*out_service = std::make_shared<IParentalControlService>(system, capability);
|
||||||
rb.Push(ResultSuccess);
|
R_SUCCEED();
|
||||||
// TODO(ogniK): Get TID from process
|
|
||||||
|
|
||||||
rb.PushIpcInterface<IParentalControlService>(system, capability);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IParentalControlServiceFactory::CreateServiceWithoutInitialize(HLERequestContext& ctx) {
|
Result IParentalControlServiceFactory::CreateServiceWithoutInitialize(
|
||||||
|
Out<SharedPointer<IParentalControlService>> out_service, ClientProcessId process_id) {
|
||||||
LOG_DEBUG(Service_PCTL, "called");
|
LOG_DEBUG(Service_PCTL, "called");
|
||||||
|
// TODO(ogniK): Get application id from process
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
*out_service = std::make_shared<IParentalControlService>(system, capability);
|
||||||
rb.Push(ResultSuccess);
|
R_SUCCEED();
|
||||||
rb.PushIpcInterface<IParentalControlService>(system, capability);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Service::PCTL
|
} // namespace Service::PCTL
|
||||||
|
@ -3,23 +3,24 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
#include "core/hle/service/pctl/pctl_types.h"
|
#include "core/hle/service/pctl/pctl_types.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Core {
|
|
||||||
class System;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Service::PCTL {
|
namespace Service::PCTL {
|
||||||
|
|
||||||
|
class IParentalControlService;
|
||||||
|
|
||||||
class IParentalControlServiceFactory : public ServiceFramework<IParentalControlServiceFactory> {
|
class IParentalControlServiceFactory : public ServiceFramework<IParentalControlServiceFactory> {
|
||||||
public:
|
public:
|
||||||
explicit IParentalControlServiceFactory(Core::System& system_, const char* name_,
|
explicit IParentalControlServiceFactory(Core::System& system_, const char* name_,
|
||||||
Capability capability_);
|
Capability capability_);
|
||||||
~IParentalControlServiceFactory() override;
|
~IParentalControlServiceFactory() override;
|
||||||
|
|
||||||
void CreateService(HLERequestContext& ctx);
|
Result CreateService(Out<SharedPointer<IParentalControlService>> out_service,
|
||||||
void CreateServiceWithoutInitialize(HLERequestContext& ctx);
|
ClientProcessId process_id);
|
||||||
|
Result CreateServiceWithoutInitialize(Out<SharedPointer<IParentalControlService>> out_service,
|
||||||
|
ClientProcessId process_id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Capability capability{};
|
Capability capability{};
|
||||||
|
Loading…
Reference in New Issue
Block a user