From f8de4cefaf27259deac5b976a35ddb9f4256edb8 Mon Sep 17 00:00:00 2001 From: N2614 Date: Thu, 7 Jul 2011 05:05:20 +0000 Subject: [PATCH] =?UTF-8?q?Copydirectory=E3=81=AB=E6=B8=A1=E3=81=99?= =?UTF-8?q?=E3=83=90=E3=83=83=E3=83=95=E3=82=A1=E3=81=AFAES=5FBLOCK=5FSIZE?= =?UTF-8?q?=20*=202=E3=81=AB=20=E3=83=92=E3=83=BC=E3=83=97=E3=81=AE?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E5=8F=96=E5=BE=97=E3=81=98=E3=81=AB?= =?UTF-8?q?=E3=82=A2=E3=83=A9=E3=82=A4=E3=83=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=80=83=E6=85=AE=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@363 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../sources/ConsoleBackup/Exporter.cpp | 27 +++++++++++-------- .../sources/ConsoleRestore/Importer.cpp | 12 ++++----- .../tools/ExportedDataVerifier/main.cpp | 4 +-- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/branches/work/RW_Aging/sources/ConsoleBackup/Exporter.cpp b/branches/work/RW_Aging/sources/ConsoleBackup/Exporter.cpp index 91e026f..861aed3 100644 --- a/branches/work/RW_Aging/sources/ConsoleBackup/Exporter.cpp +++ b/branches/work/RW_Aging/sources/ConsoleBackup/Exporter.cpp @@ -154,6 +154,7 @@ nn::Result DeleteTrash(std::wstring currentDirectory) nn::Result WriteTwlTitleList(std::vector& programIdList) { + nn::Result result; COMMON_LOGGER("Export TwlTitle List.\n"); size_t heapSize = common::GetAllocatableSize(); @@ -169,10 +170,14 @@ nn::Result WriteTwlTitleList(std::vector& programIdList) NN_LOG("%ls\n", it->c_str()); writeSize += it->size() + sizeof('\n'); } - } - nn::Result result = s_SdWriter.WriteBufWithCmac(common::TWL_TITLELIST_PATHNAME, titleListBuf, writeSize); - return result; + return s_SdWriter.WriteBufWithCmac(common::TWL_TITLELIST_PATHNAME, titleListBuf, writeSize); + } + else + { + return nn::Result(nn::Result::LEVEL_FATAL, nn::Result::SUMMARY_OUT_OF_RESOURCE, nn::Result::MODULE_COMMON, + nn::Result::DESCRIPTION_OUT_OF_MEMORY); + } } @@ -468,9 +473,6 @@ void WriteTwlData(enum common::TWL_PATH_INDEX path) result = common::SdMountManager::Mount(); COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsExportSucceeded); - size_t bufSize = common::GetAllocatableSize(); - NN_LOG("AllocatableSize = %d\n", bufSize); - u32 fileNum = 0; s64 fileSize = 0; result = common::CalculateFileNum(::std::wstring(common::NAND_TWL_ROOT_PATHNAME_WITH_SLASH_TABLE[path]), fileNum, fileSize); @@ -484,7 +486,10 @@ void WriteTwlData(enum common::TWL_PATH_INDEX path) // 進捗表示用 common::InitializeTransferProgress(fileSize); - common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE); + size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2); + NN_LOG("AllocatableSize = %d\n", bufSize); + + common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE * 2); void* buf = writeHeap.GetAddr(); if (buf != NULL) { @@ -605,10 +610,10 @@ void WriteTwlSaveData() result = common::SdMountManager::Mount(); COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsExportSucceeded); - size_t bufSize = common::GetAllocatableSize(); + size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2); NN_LOG("AllocatableSize = %d\n", bufSize); - common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE); + common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE * 2); void* buf = writeHeap.GetAddr(); if (buf != NULL) { @@ -751,10 +756,10 @@ void ExportThreadFunc() result = common::SdMountManager::Mount(); - size_t bufSize = common::GetAllocatableSize(); + size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2); NN_LOG("AllocatableSize = %d\n", bufSize); - common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE); + common::HeapManager writeHeap(bufSize, AES_BLOCK_SIZE * 2); void* buf = writeHeap.GetAddr(); if (buf != NULL) { diff --git a/branches/work/RW_Aging/sources/ConsoleRestore/Importer.cpp b/branches/work/RW_Aging/sources/ConsoleRestore/Importer.cpp index 964b256..620ddcc 100644 --- a/branches/work/RW_Aging/sources/ConsoleRestore/Importer.cpp +++ b/branches/work/RW_Aging/sources/ConsoleRestore/Importer.cpp @@ -706,10 +706,10 @@ void ImportThreadFunc() result = common::SdMountManager::Mount(); COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded); - size_t bufSize = common::GetAllocatableSize(); + size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2); NN_LOG("AllocatableSize = %d\n", bufSize); - common::HeapManager heap(bufSize); + common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2); void* buf = heap.GetAddr(); if (buf != NULL) { @@ -1481,13 +1481,13 @@ void ImportTwlData(enum common::TWL_PATH_INDEX path, s64 fileSize) result = common::SdMountManager::Mount(); COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded); - size_t bufSize = common::GetAllocatableSize(); + size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2); NN_LOG("AllocatableSize = %d\n", bufSize); // ファイルサイズ設定 common::InitializeTransferProgress(fileSize); - common::HeapManager heap(bufSize, AES_BLOCK_SIZE); + common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2); void* buf = heap.GetAddr(); if (buf != NULL) { @@ -1522,13 +1522,13 @@ void ImportTwlTitleSaveData(s64 fileSize) result = common::SdMountManager::Mount(); COMMON_LOGGER_RETURN_VOID_SET_BOOL_IF_FAILED(result, s_IsImportSucceeded); - size_t bufSize = common::GetAllocatableSize(); + size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2); NN_LOG("AllocatableSize = %d\n", bufSize); // ファイルサイズ設定 common::InitializeTransferProgress(fileSize); - common::HeapManager heap(bufSize, AES_BLOCK_SIZE); + common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2); void* buf = heap.GetAddr(); if (buf != NULL) { diff --git a/branches/work/RW_Aging/sources/tools/ExportedDataVerifier/main.cpp b/branches/work/RW_Aging/sources/tools/ExportedDataVerifier/main.cpp index e1b2d19..d72d44e 100644 --- a/branches/work/RW_Aging/sources/tools/ExportedDataVerifier/main.cpp +++ b/branches/work/RW_Aging/sources/tools/ExportedDataVerifier/main.cpp @@ -362,9 +362,9 @@ void VerifyThreadFunc() result = common::SdMountManager::Mount(); - size_t bufSize = common::GetAllocatableSize(); + size_t bufSize = common::GetAllocatableSize(AES_BLOCK_SIZE * 2); - common::HeapManager heap(bufSize, AES_BLOCK_SIZE); + common::HeapManager heap(bufSize, AES_BLOCK_SIZE * 2); void* buf = heap.GetAddr(); if (buf != NULL) {