_tcscat(TempSrc,_T(".decrypt"));
if (!CopyFileEx(source, TempSrc, NULL, NULL, FALSE, COPY_FILE_ALLOW_DECRYPTED_DESTINATION))
{
+ CloseHandle (hFileSrc);
nErrorLevel = 1;
return 0;
}
/* Check Breaker */
if (CheckCtrlBreak(BREAK_INPUT))
{
+ FindClose(hFile);
freep(arg);
return 1;
}
if (_tcscmp(tmpDestPath, _T("\\\\.\\")) &&
!IsExistingDirectory(tmpDestPath))
{
+ FindClose(hFile);
ConOutFormatMessage(GetLastError(), szSrcPath);
freep(arg);
nErrorLevel = 1;
{
SetFileAttributes(TempFileName,FILE_ATTRIBUTE_NORMAL);
if (!DeleteFile(TempFileName))
+ {
+ FindClose (hFile);
return 0;
+ }
}
}while (FindNextFile (hFile, &f));
HANDLE hFile;
/* used only when source and destination directories are on different volume */
- HANDLE hDestFile;
+ HANDLE hDestFile = NULL;
WIN32_FIND_DATA findDestBuffer;
TCHAR szMoveDest[MAX_PATH];
TCHAR szMoveSrc[MAX_PATH];
FindNextFile (hFile, &findBuffer));
FindClose (hFile);
+ if(hDestFile && hDestFile != INVALID_HANDLE_VALUE)
+ FindClose(hDestFile);
+
freep (arg);
return 0;
}
else
ConOutResPrintf(STRING_REPLACE_HELP10, dest);
if ( !FilePromptYNA (0))
+ {
+ CloseHandle (hFileSrc);
return 0;
+ }
}
/* Output depending on add flag */
HANDLE hFile;
WIN32_FIND_DATA findBuffer;
- /* Get file handel to the sourcefile(s) */
+ /* Get file handle to the sourcefile(s) */
hFile = FindFirstFile (szSrcPath, &findBuffer);
/*
/* Take next sourcefile if any */
} while(FindNextFile (hFile, &findBuffer));
+ FindClose(hFile);
+
return filesReplaced;
}
/* Get the next handle */
} while(FindNextFile (hFile, &findBuffer));
+ FindClose(hFile);
+
return filesReplaced;
}