未初期化状態でPreorderTitleRestorerにアクセスしないように

PreorderTitleRestorerでnimの初期化APIを呼び出すように

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@847 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
N2614 2015-03-20 08:02:25 +00:00
parent 8f470ca407
commit c7e2a86b91
2 changed files with 17 additions and 1 deletions

View File

@ -18,8 +18,10 @@
#include "CommonLogger.h"
#include "HeapManager.h"
#include <nn/fs.h>
#include <nn/fs/fs_ApiExternalSeeds.h>
#include <nn/fs/fs_ApiTitleTags.h>
#include <nn/nim.h>
#include <nn/nim/CTR/nim_PrepurchaseTitleTag.h>
#include <nn/nim/CTR/nim_ShopApi.h>
@ -64,6 +66,10 @@ PreorderTitleRestorer::~PreorderTitleRestorer()
nn::Result PreorderTitleRestorer::Execute(nn::ProgramId list[], size_t size, nn::cfg::CTR::CfgCountryCode country, nn::cfg::CTR::CfgRegionCode region)
{
COMMON_LOGGER_RETURN_RESULT_IF_FAILED(
nn::nim::InitializeForShop());
nn::fs::Initialize();
for(s32 i = 0; i < size; ++i)
{
m_Progress = i * 100 / size;
@ -76,6 +82,9 @@ nn::Result PreorderTitleRestorer::Execute(nn::ProgramId list[], size_t size, nn:
SetExternalSeedOrPlayableDate(list[i], deliveredCountry, xml));
}
COMMON_LOGGER_RETURN_RESULT_IF_FAILED(
nn::nim::FinalizeForShop());
return nn::ResultSuccess();
}

View File

@ -81,7 +81,14 @@ void PreorderTitleRestorerManager::End()
u64 PreorderTitleRestorerManager::GetProgress()
{
return m_Restorer->GetProgress();
if(m_Restorer)
{
return m_Restorer->GetProgress();
}
else
{
return 0;
}
}
void PreorderTitleRestorerManager::ThreadFunc()