mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-18 01:46:47 +00:00
kern: implement remaining non-KServerSession:: part of Reply/Receive
This commit is contained in:
parent
84b1be1d58
commit
4e667bc7c1
1 changed files with 11 additions and 2 deletions
|
@ -37,8 +37,17 @@ namespace ams::kern::svc {
|
|||
ALWAYS_INLINE Result ReplyAndReceiveImpl(int32_t *out_index, uintptr_t message, size_t buffer_size, KPhysicalAddress message_paddr, KSynchronizationObject **objs, int32_t num_objects, ams::svc::Handle reply_target, int64_t timeout_ns) {
|
||||
/* Reply to the target, if one is specified. */
|
||||
if (reply_target != ams::svc::InvalidHandle) {
|
||||
/* TODO */
|
||||
MESOSPHERE_UNIMPLEMENTED();
|
||||
KScopedAutoObject session = GetCurrentProcess().GetHandleTable().GetObject<KServerSession>(reply_target);
|
||||
R_UNLESS(session.IsNotNull(), svc::ResultInvalidHandle());
|
||||
|
||||
/* If we fail to reply, we want to set the output index to -1. */
|
||||
auto reply_idx_guard = SCOPE_GUARD { *out_index = -1; };
|
||||
|
||||
/* Send the reply. */
|
||||
R_TRY(session->SendReply(message, buffer_size, message_paddr));
|
||||
|
||||
/* Cancel our guard. */
|
||||
reply_idx_guard.Cancel();
|
||||
}
|
||||
|
||||
/* Receive a message. */
|
||||
|
|
Loading…
Reference in a new issue