mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
書き込み失敗時のファイルサイズ調整を正しく
IVSのインポートを再起動直前に移動 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@348 385bec56-5757-e545-9c3a-d8741f4650f1
This commit is contained in:
parent
602a935f18
commit
7a9008ba6d
@ -1260,10 +1260,19 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector<std::stri
|
|||||||
case POST_RESTORE:
|
case POST_RESTORE:
|
||||||
{
|
{
|
||||||
operationMessage.push_back(::std::string("Post Process..."));
|
operationMessage.push_back(::std::string("Post Process..."));
|
||||||
// 書き込み完了ファイルを作成
|
|
||||||
CreateWriteFinishedFile();
|
|
||||||
|
|
||||||
s_RestoreState = RESTORE_DONE;
|
// SDカードのIVSファイルを書き込む
|
||||||
|
if(ImportIvsData())
|
||||||
|
{
|
||||||
|
// 書き込み完了ファイルを作成
|
||||||
|
CreateWriteFinishedFile();
|
||||||
|
|
||||||
|
s_RestoreState = RESTORE_DONE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s_RestoreState = FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -690,6 +690,11 @@ nn::Result ImportIvs()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ImportIvsData()
|
||||||
|
{
|
||||||
|
return ImportIvs().IsSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
void ImportThreadFunc()
|
void ImportThreadFunc()
|
||||||
{
|
{
|
||||||
nn::Result result;
|
nn::Result result;
|
||||||
@ -1856,10 +1861,6 @@ nn::Result ImportData()
|
|||||||
// NANDのごみを削除する
|
// NANDのごみを削除する
|
||||||
Cleanup();
|
Cleanup();
|
||||||
|
|
||||||
// SDカードのIVSファイルを書き込む
|
|
||||||
result = ImportIvs();
|
|
||||||
NN_UTIL_RETURN_IF_FAILED(result);
|
|
||||||
|
|
||||||
// NORデータを書き込む
|
// NORデータを書き込む
|
||||||
result = ImportNorData();
|
result = ImportNorData();
|
||||||
NN_UTIL_RETURN_IF_FAILED(result);
|
NN_UTIL_RETURN_IF_FAILED(result);
|
||||||
|
|||||||
@ -154,6 +154,9 @@ nn::Result ReadVersionData();
|
|||||||
// SDカードのNintendo 3DS以下ににIVSと一致するディレクトリがあるかどうか
|
// SDカードのNintendo 3DS以下ににIVSと一致するディレクトリがあるかどうか
|
||||||
bool ExistsIvsDirectory(std::string& ivsRoot);
|
bool ExistsIvsDirectory(std::string& ivsRoot);
|
||||||
|
|
||||||
|
// SDカードのIVSデータを書き込む
|
||||||
|
bool ImportIvsData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* IMPORTER_H_ */
|
#endif /* IMPORTER_H_ */
|
||||||
|
|||||||
@ -625,7 +625,6 @@ bool CopyDirectory(ImportDataList* fileList, const wchar_t * from_path, const wc
|
|||||||
target_from.str().c_str(), target_tmp.str().c_str(),
|
target_from.str().c_str(), target_tmp.str().c_str(),
|
||||||
target_to.str().c_str()))
|
target_to.str().c_str()))
|
||||||
{
|
{
|
||||||
s_FinishedFileSize -= readsize;
|
|
||||||
ret_value = false;
|
ret_value = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -646,6 +645,12 @@ bool CopyDirectory(ImportDataList* fileList, const wchar_t * from_path, const wc
|
|||||||
}
|
}
|
||||||
from_file.Finalize();
|
from_file.Finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1ファイルごとの結果確認
|
||||||
|
if(!ret_value)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
from_dir.Finalize();
|
from_dir.Finalize();
|
||||||
@ -799,9 +804,12 @@ bool ConfirmFile(nn::fs::FileInputStream* from_file, nn::fs::FileStream* to_file
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
NN_LOG("Verification Success %s, Rename\n", GetCharStr(sdPath));
|
NN_LOG("Verification Success %s, Rename\n", GetCharStr(sdPath));
|
||||||
// 削除する
|
// 書き込み先を削除する
|
||||||
nn::fs::TryDeleteFile(truePath);
|
result = nn::fs::TryDeleteFile(truePath);
|
||||||
// リネームする
|
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
||||||
|
// 正しいファイル名にリネームする
|
||||||
|
|
||||||
|
|
||||||
result = nn::fs::TryRenameFile(tmpPath, truePath);
|
result = nn::fs::TryRenameFile(tmpPath, truePath);
|
||||||
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result);
|
||||||
if (result.IsFailure())
|
if (result.IsFailure())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user