Update DeleteFileAltW.c
Cette révision appartient à :
Parent
81b33ce649
révision
31e1ae3a4c
|
@ -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;
|
||||
}
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket