1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Kill as much of pnUtPath as possible.

This commit is contained in:
Darryl Pogue
2012-04-21 16:48:22 -07:00
parent 0ac6cd4907
commit 205795e037
7 changed files with 25 additions and 666 deletions

View File

@ -834,7 +834,7 @@ int __stdcall WinMain (
// Wait for the other process to exit
Sleep(1000);
if (!PathDeleteFile(newPatcherFile)) {
if (!plFileUtils::RemoveFile(newPatcherFile)) {
wchar_t error[256];
DWORD errorCode = GetLastError();
wchar_t *msg = TranslateErrorCode(errorCode);
@ -844,7 +844,7 @@ int __stdcall WinMain (
LocalFree(msg);
break;
}
if (!PathMoveFile(curPatcherFile, newPatcherFile)) {
if (!plFileUtils::FileMove(curPatcherFile, newPatcherFile)) {
wchar_t error[256];
DWORD errorCode = GetLastError();
wchar_t *msg = TranslateErrorCode(errorCode);
@ -852,7 +852,7 @@ int __stdcall WinMain (
StrPrintf(error, arrsize(error), L"Failed to replace old patcher executable. %s", msg);
MessageBoxW(GetTopWindow(nil), error, L"Error", MB_OK);
// attempt to clean up this tmp file
PathDeleteFile(curPatcherFile);
plFileUtils::RemoveFile(curPatcherFile);
LocalFree(msg);
break;
}
@ -896,7 +896,7 @@ int __stdcall WinMain (
PathAddFilename(fileSpec, fileSpec, L"*.tmp", arrsize(fileSpec));
PathFindFiles(&paths, fileSpec, kPathFlagFile);
for (PathFind * path = paths.Ptr(); path != paths.Term(); ++path)
PathDeleteFile(path->name);
plFileUtils::RemoveFile(path->name);
SetConsoleCtrlHandler(CtrlHandler, TRUE);
InitAsyncCore(); // must do this before self patch, since it needs to connect to the file server

View File

@ -232,7 +232,7 @@ static void FileSrvIpAddressCallback (
PathGetProgramDirectory(s_newPatcherFile, arrsize(s_newPatcherFile));
GetTempFileNameW(s_newPatcherFile, kPatcherExeFilename, 0, s_newPatcherFile);
PathDeleteFile(s_newPatcherFile);
plFileUtils::RemoveFile(s_newPatcherFile);
NetCliFileManifestRequest(ManifestCallback, nil, s_manifest);
}