diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-10-17 16:26:34 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-10-17 18:40:39 +0200 |
commit | 2ddc37416416894bf085edc6ca4a0b3862fae2c2 (patch) | |
tree | f8e27a4d460299ef4a4b7012525a5418c0043887 /src/Common/Dlgcode.c | |
parent | 78d9e5fc3b75f438fa59d7df5bd69f225854b0c3 (diff) | |
download | VeraCrypt-2ddc37416416894bf085edc6ca4a0b3862fae2c2.tar.gz VeraCrypt-2ddc37416416894bf085edc6ca4a0b3862fae2c2.zip |
Windows: Remove VeraCrypt from EFI boot partition after decrypting the system
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r-- | src/Common/Dlgcode.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index ae6fcd2d..04fec471 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -12203,4 +12203,25 @@ BOOL RaisePrivileges(void) SetLastError (dwLastError); return bRet; -}
\ No newline at end of file +} + +BOOL DeleteDirectory (const wchar_t* szDirName) +{ + BOOL bStatus = RemoveDirectory (szDirName); + if (!bStatus) + { + /* force removal of the non empty directory */ + wchar_t szOpPath[TC_MAX_PATH + 1] = {0}; + SHFILEOPSTRUCTW op; + + StringCchCopyW(szOpPath, ARRAYSIZE(szOpPath)-1, szDirName); + ZeroMemory(&op, sizeof(op)); + op.wFunc = FO_DELETE; + op.pFrom = szOpPath; + op.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR; + + if ((0 == SHFileOperation(&op)) && (!op.fAnyOperationsAborted)) + bStatus = TRUE; + } + return bStatus; +} |