Merge pull request #1621 from lioncash/ipc

hle_ipc: Make GetDomainMessageHeader return a regular pointer
This commit is contained in:
bunnei 2018-10-29 23:55:59 -04:00 committed by GitHub
commit adf26ae668
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View file

@ -117,8 +117,7 @@ public:
AlignWithPadding(); AlignWithPadding();
const bool request_has_domain_header{context.GetDomainMessageHeader() != nullptr}; if (context.Session()->IsDomain() && context.HasDomainMessageHeader()) {
if (context.Session()->IsDomain() && request_has_domain_header) {
IPC::DomainMessageHeader domain_header{}; IPC::DomainMessageHeader domain_header{};
domain_header.num_objects = num_domain_objects; domain_header.num_objects = num_domain_objects;
PushRaw(domain_header); PushRaw(domain_header);

View file

@ -161,8 +161,12 @@ public:
return buffer_c_desciptors; return buffer_c_desciptors;
} }
const std::shared_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const { const IPC::DomainMessageHeader* GetDomainMessageHeader() const {
return domain_message_header; return domain_message_header.get();
}
bool HasDomainMessageHeader() const {
return domain_message_header != nullptr;
} }
/// Helper function to read a buffer using the appropriate buffer descriptor /// Helper function to read a buffer using the appropriate buffer descriptor

View file

@ -63,7 +63,7 @@ void ServerSession::Acquire(Thread* thread) {
} }
ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) { ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) {
auto& domain_message_header = context.GetDomainMessageHeader(); auto* const domain_message_header = context.GetDomainMessageHeader();
if (domain_message_header) { if (domain_message_header) {
// Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs
context.SetDomainRequestHandlers(domain_request_handlers); context.SetDomainRequestHandlers(domain_request_handlers);
@ -111,7 +111,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) {
ResultCode result = RESULT_SUCCESS; ResultCode result = RESULT_SUCCESS;
// If the session has been converted to a domain, handle the domain request // If the session has been converted to a domain, handle the domain request
if (IsDomain() && context.GetDomainMessageHeader()) { if (IsDomain() && context.HasDomainMessageHeader()) {
result = HandleDomainSyncRequest(context); result = HandleDomainSyncRequest(context);
// If there is no domain header, the regular session handler is used // If there is no domain header, the regular session handler is used
} else if (hle_handler != nullptr) { } else if (hle_handler != nullptr) {