Function renaming + annotations

This commit is contained in:
vxunderground
2022-09-13 07:20:57 -05:00
parent f0b5d2bd5d
commit a623af12b7
41 changed files with 143 additions and 160 deletions
+39
View File
@@ -0,0 +1,39 @@
#include "Win32Helper.h"
BOOL DeleteFileWithCreateFileFlagA(_In_ PCHAR Path)
{
HANDLE hHandle = INVALID_HANDLE_VALUE;
if (Path == NULL)
return FALSE;
if (!IsPathValidA(Path))
return FALSE;
hHandle = CreateFileA(Path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (hHandle == INVALID_HANDLE_VALUE)
return FALSE;
CloseHandle(hHandle);
return TRUE;
}
BOOL DeleteFileWithCreateFileFlagW(_In_ PWCHAR Path)
{
HANDLE hHandle = INVALID_HANDLE_VALUE;
if (Path == NULL)
return FALSE;
if (!IsPathValidW(Path))
return FALSE;
hHandle = CreateFileW(Path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (hHandle == INVALID_HANDLE_VALUE)
return FALSE;
CloseHandle(hHandle);
return TRUE;
}