service: populate pid and handle table from client

This commit is contained in:
Liam
2023-12-09 11:25:21 -05:00
parent 34e4012998
commit 5feda37688
3 changed files with 19 additions and 13 deletions

View File

@ -38,6 +38,7 @@ namespace Kernel {
class KAutoObject;
class KernelCore;
class KHandleTable;
class KProcess;
class KServerSession;
class KThread;
} // namespace Kernel
@ -195,8 +196,7 @@ public:
}
/// Populates this context with data from the requesting process/thread.
Result PopulateFromIncomingCommandBuffer(const Kernel::KHandleTable& handle_table,
u32_le* src_cmdbuf);
Result PopulateFromIncomingCommandBuffer(Kernel::KProcess& process, u32_le* src_cmdbuf);
/// Writes data from this context back to the requesting process/thread.
Result WriteToOutgoingCommandBuffer(Kernel::KThread& requesting_thread);
@ -359,6 +359,10 @@ public:
return *thread;
}
Kernel::KHandleTable& GetClientHandleTable() {
return *client_handle_table;
}
[[nodiscard]] std::shared_ptr<SessionRequestManager> GetManager() const {
return manager.lock();
}
@ -374,12 +378,12 @@ public:
private:
friend class IPC::ResponseBuilder;
void ParseCommandBuffer(const Kernel::KHandleTable& handle_table, u32_le* src_cmdbuf,
bool incoming);
void ParseCommandBuffer(Kernel::KProcess& process, u32_le* src_cmdbuf, bool incoming);
std::array<u32, IPC::COMMAND_BUFFER_LENGTH> cmd_buf;
Kernel::KServerSession* server_session{};
Kernel::KThread* thread;
Kernel::KHandleTable* client_handle_table{};
Kernel::KThread* thread{};
std::vector<Handle> incoming_move_handles;
std::vector<Handle> incoming_copy_handles;