diff --git a/trunk/ConsoleDataMigration/sources/ConsoleBackup/Exporter.cpp b/trunk/ConsoleDataMigration/sources/ConsoleBackup/Exporter.cpp index 91e026f..861aed3 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleBackup/Exporter.cpp +++ b/trunk/ConsoleDataMigration/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/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp index 964b256..620ddcc 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Importer.cpp +++ b/trunk/ConsoleDataMigration/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/trunk/ConsoleDataMigration/sources/tools/ExportedDataVerifier/main.cpp b/trunk/ConsoleDataMigration/sources/tools/ExportedDataVerifier/main.cpp index e1b2d19..d72d44e 100644 --- a/trunk/ConsoleDataMigration/sources/tools/ExportedDataVerifier/main.cpp +++ b/trunk/ConsoleDataMigration/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) {