Update DeleteFileAltW.c

Cette révision appartient à :
vxunderground 2021-06-03 18:25:41 -05:00 révisé par GitHub
Parent 81b33ce649
révision 31e1ae3a4c
Signature inconnue de tcpd
ID de la clé GPG: 4AEE18F83AFDEB23

Voir le fichier

@ -1,3 +1,25 @@
/*
DeleteFileAlt function
Summary:
Deletes an existing file using the CreateFile FILE_FLAG_DELETE_ON_CLOSE flag.
Parameters:
- PWCHAR Path
Path to file to delete
Return value:
TRUE for success, FALSE for failure. Use GetLastError or GetLastErrorAlt for more information
Remarks:
The code below uses IsPathValid, an existing function from WINAPI-TRICKS, to determine if the file path is valid
Author:
smelly__vx | June 3rd, 2021
*/
BOOL DeleteFileAltW(PWCHAR Path)
{
HANDLE hHandle = INVALID_HANDLE_VALUE;
@ -12,8 +34,7 @@ BOOL DeleteFileAltW(PWCHAR Path)
if (hHandle == INVALID_HANDLE_VALUE)
return FALSE;
if (hHandle)
CloseHandle(hHandle);
CloseHandle(hHandle);
return TRUE;
}