diff options
| author | 2021-04-03 22:22:36 -0700 | |
|---|---|---|
| committer | 2021-05-05 16:40:50 -0700 | |
| commit | 7ccbdd4d8d3dea7294d2cac38779cceea9745d52 (patch) | |
| tree | 3106289a5c5a6e4bf50bc09a548c8408aa29fbad /src/core/hle/service/pm | |
| parent | hle: kernel: Refactor IPC interfaces to not use std::shared_ptr. (diff) | |
| download | yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.gz yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.xz yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.zip | |
hle: kernel: Migrate KProcess to KAutoObject.
Diffstat (limited to 'src/core/hle/service/pm')
| -rw-r--r-- | src/core/hle/service/pm/pm.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index 68736c40c..3a00849e1 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp | |||
| @@ -17,9 +17,8 @@ constexpr ResultCode ERROR_PROCESS_NOT_FOUND{ErrorModule::PM, 1}; | |||
| 17 | 17 | ||
| 18 | constexpr u64 NO_PROCESS_FOUND_PID{0}; | 18 | constexpr u64 NO_PROCESS_FOUND_PID{0}; |
| 19 | 19 | ||
| 20 | std::optional<std::shared_ptr<Kernel::Process>> SearchProcessList( | 20 | std::optional<Kernel::Process*> SearchProcessList(const std::vector<Kernel::Process*>& process_list, |
| 21 | const std::vector<std::shared_ptr<Kernel::Process>>& process_list, | 21 | std::function<bool(Kernel::Process*)> predicate) { |
| 22 | std::function<bool(const std::shared_ptr<Kernel::Process>&)> predicate) { | ||
| 23 | const auto iter = std::find_if(process_list.begin(), process_list.end(), predicate); | 22 | const auto iter = std::find_if(process_list.begin(), process_list.end(), predicate); |
| 24 | 23 | ||
| 25 | if (iter == process_list.end()) { | 24 | if (iter == process_list.end()) { |
| @@ -30,7 +29,7 @@ std::optional<std::shared_ptr<Kernel::Process>> SearchProcessList( | |||
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | void GetApplicationPidGeneric(Kernel::HLERequestContext& ctx, | 31 | void GetApplicationPidGeneric(Kernel::HLERequestContext& ctx, |
| 33 | const std::vector<std::shared_ptr<Kernel::Process>>& process_list) { | 32 | const std::vector<Kernel::Process*>& process_list) { |
| 34 | const auto process = SearchProcessList(process_list, [](const auto& process) { | 33 | const auto process = SearchProcessList(process_list, [](const auto& process) { |
| 35 | return process->GetProcessID() == Kernel::Process::ProcessIDMin; | 34 | return process->GetProcessID() == Kernel::Process::ProcessIDMin; |
| 36 | }); | 35 | }); |
| @@ -125,8 +124,7 @@ private: | |||
| 125 | 124 | ||
| 126 | class Info final : public ServiceFramework<Info> { | 125 | class Info final : public ServiceFramework<Info> { |
| 127 | public: | 126 | public: |
| 128 | explicit Info(Core::System& system_, | 127 | explicit Info(Core::System& system_, const std::vector<Kernel::Process*>& process_list_) |
| 129 | const std::vector<std::shared_ptr<Kernel::Process>>& process_list_) | ||
| 130 | : ServiceFramework{system_, "pm:info"}, process_list{process_list_} { | 128 | : ServiceFramework{system_, "pm:info"}, process_list{process_list_} { |
| 131 | static const FunctionInfo functions[] = { | 129 | static const FunctionInfo functions[] = { |
| 132 | {0, &Info::GetTitleId, "GetTitleId"}, | 130 | {0, &Info::GetTitleId, "GetTitleId"}, |
| @@ -156,7 +154,7 @@ private: | |||
| 156 | rb.Push((*process)->GetTitleID()); | 154 | rb.Push((*process)->GetTitleID()); |
| 157 | } | 155 | } |
| 158 | 156 | ||
| 159 | const std::vector<std::shared_ptr<Kernel::Process>>& process_list; | 157 | const std::vector<Kernel::Process*>& process_list; |
| 160 | }; | 158 | }; |
| 161 | 159 | ||
| 162 | class Shell final : public ServiceFramework<Shell> { | 160 | class Shell final : public ServiceFramework<Shell> { |