mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-31 07:59:02 -05:00 
			
		
		
		
	ipc: Add support for PopIpcInterface() method.
- This can be used for domain objects as inputs to service functions.
This commit is contained in:
		| @@ -202,6 +202,16 @@ public: | ||||
|         domain_objects.emplace_back(std::move(object)); | ||||
|     } | ||||
|  | ||||
|     template <typename T> | ||||
|     std::shared_ptr<T> GetDomainRequestHandler(size_t index) const { | ||||
|         return std::static_pointer_cast<T>(domain_request_handlers[index]); | ||||
|     } | ||||
|  | ||||
|     void SetDomainRequestHandlers( | ||||
|         const std::vector<std::shared_ptr<SessionRequestHandler>>& handlers) { | ||||
|         domain_request_handlers = handlers; | ||||
|     } | ||||
|  | ||||
|     /// Clears the list of objects so that no lingering objects are written accidentally to the | ||||
|     /// response buffer. | ||||
|     void ClearIncomingObjects() { | ||||
| @@ -245,6 +255,8 @@ private: | ||||
|     unsigned data_payload_offset{}; | ||||
|     unsigned buffer_c_offset{}; | ||||
|     u32_le command{}; | ||||
|  | ||||
|     std::vector<std::shared_ptr<SessionRequestHandler>> domain_request_handlers; | ||||
| }; | ||||
|  | ||||
| } // namespace Kernel | ||||
|   | ||||
| @@ -61,6 +61,9 @@ void ServerSession::Acquire(Thread* thread) { | ||||
| ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) { | ||||
|     auto& domain_message_header = context.GetDomainMessageHeader(); | ||||
|     if (domain_message_header) { | ||||
|         // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs | ||||
|         context.SetDomainRequestHandlers(domain_request_handlers); | ||||
|  | ||||
|         // If there is a DomainMessageHeader, then this is CommandType "Request" | ||||
|         const u32 object_id{context.GetDomainMessageHeader()->object_id}; | ||||
|         switch (domain_message_header->command) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bunnei
					bunnei