mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 08:50:57 +01:00
IPC: add domain header to response if only it exists in request
This commit is contained in:
parent
6a2197806e
commit
1572c45aa0
3 changed files with 8 additions and 6 deletions
|
@ -118,7 +118,7 @@ public:
|
||||||
|
|
||||||
AlignWithPadding();
|
AlignWithPadding();
|
||||||
|
|
||||||
if (context.Session()->IsDomain()) {
|
if (context.Session()->IsDomain() && context.GetDomainMessageHeader()) {
|
||||||
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);
|
||||||
|
|
|
@ -85,9 +85,11 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
||||||
|
|
||||||
if (Session()->IsDomain() && (command_header->type == IPC::CommandType::Request || !incoming)) {
|
if (Session()->IsDomain() && (command_header->type == IPC::CommandType::Request || !incoming)) {
|
||||||
// If this is an incoming message, only CommandType "Request" has a domain header
|
// If this is an incoming message, only CommandType "Request" has a domain header
|
||||||
// All outgoing domain messages have the domain header
|
// All outgoing domain messages have the domain header, if only incoming has it
|
||||||
domain_message_header =
|
if (incoming || domain_message_header) {
|
||||||
std::make_unique<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>());
|
domain_message_header =
|
||||||
|
std::make_unique<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data_payload_header =
|
data_payload_header =
|
||||||
|
@ -196,7 +198,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf, P
|
||||||
|
|
||||||
// TODO(Subv): Translate the X/A/B/W buffers.
|
// TODO(Subv): Translate the X/A/B/W buffers.
|
||||||
|
|
||||||
if (Session()->IsDomain()) {
|
if (domain_message_header && Session()->IsDomain()) {
|
||||||
ASSERT(domain_message_header->num_objects == domain_objects.size());
|
ASSERT(domain_message_header->num_objects == domain_objects.size());
|
||||||
// Write the domain objects to the command buffer, these go after the raw untranslated data.
|
// Write the domain objects to the command buffer, these go after the raw untranslated data.
|
||||||
// TODO(Subv): This completely ignores C buffers.
|
// TODO(Subv): This completely ignores C buffers.
|
||||||
|
|
|
@ -96,7 +96,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()) {
|
if (context.GetDomainMessageHeader() && IsDomain()) {
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in a new issue