From c01fda62558f845409f303fe6090a26d3895cccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 24 Apr 2017 23:48:05 +0200 Subject: [PATCH] IOS: Include the UID and GID in open requests Accuracy change. Required to implement ES contexts properly. --- Source/Core/Core/IOS/Device.cpp | 2 ++ Source/Core/Core/IOS/Device.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Source/Core/Core/IOS/Device.cpp b/Source/Core/Core/IOS/Device.cpp index cf01110caa..e93f867f83 100644 --- a/Source/Core/Core/IOS/Device.cpp +++ b/Source/Core/Core/IOS/Device.cpp @@ -26,6 +26,8 @@ OpenRequest::OpenRequest(const u32 address_) : Request(address_) { path = Memory::GetString(Memory::Read_U32(address + 0xc)); flags = static_cast(Memory::Read_U32(address + 0x10)); + uid = GetUIDForPPC(); + gid = GetGIDForPPC(); } ReadWriteRequest::ReadWriteRequest(const u32 address_) : Request(address_) diff --git a/Source/Core/Core/IOS/Device.h b/Source/Core/Core/IOS/Device.h index 55d2d4a593..75df14a2a8 100644 --- a/Source/Core/Core/IOS/Device.h +++ b/Source/Core/Core/IOS/Device.h @@ -92,6 +92,10 @@ struct OpenRequest final : Request { std::string path; OpenMode flags = IOS_OPEN_READ; + // The UID and GID are not part of the IPC request sent from the PPC to the Starlet, + // but they are set after they reach IOS and are dispatched to the appropriate module. + u32 uid = 0; + u16 gid = 0; explicit OpenRequest(u32 address); };