Merge pull request #5390 from leoetlino/fix

Boot_WiiWAD: Set the UID and GID on launch
This commit is contained in:
Léo Lam 2017-05-07 17:13:34 +02:00 committed by GitHub
commit da175c4972
1 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,7 @@
#include "Core/Boot/Boot.h"
#include "Core/IOS/ES/ES.h"
#include "Core/IOS/ES/Formats.h"
#include "Core/IOS/FS/FileIO.h"
#include "Core/IOS/IOS.h"
#include "Core/PatchEngine.h"
@ -88,7 +89,15 @@ bool CBoot::Boot_WiiWAD(const std::string& _pFilename)
return false;
IOS::HLE::Device::ES::LoadWAD(_pFilename);
if (!IOS::HLE::GetIOS()->BootstrapPPC(ContentLoader))
// TODO: kill these manual calls and just use ES_Launch here, as soon as the direct WAD
// launch hack is dropped.
auto* ios = IOS::HLE::GetIOS();
IOS::ES::UIDSys uid_map{Common::FROM_SESSION_ROOT};
ios->SetUidForPPC(uid_map.GetOrInsertUIDForTitle(titleID));
ios->SetGidForPPC(ContentLoader.GetTMD().GetGroupId());
if (!ios->BootstrapPPC(ContentLoader))
return false;
return true;