mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-24 12:03:28 +01:00
Windows: install crash handler in case of system favorites service in order to be able to clear Pre-Boot password from cache before the service is terminate if a crash happens.
This commit is contained in:
parent
1ebb0bf00f
commit
f5841b8841
@ -9133,6 +9133,21 @@ static VOID WINAPI SystemFavoritesServiceCtrlHandler (DWORD control)
|
||||
SystemFavoritesServiceSetStatus (SystemFavoritesServiceStatus.dwCurrentState);
|
||||
}
|
||||
|
||||
static LONG WINAPI SystemFavoritesServiceExceptionHandler (EXCEPTION_POINTERS *ep)
|
||||
{
|
||||
SetUnhandledExceptionFilter (NULL);
|
||||
|
||||
if (!(ReadDriverConfigurationFlags() & TC_DRIVER_CONFIG_CACHE_BOOT_PASSWORD))
|
||||
WipeCache (NULL, TRUE);
|
||||
|
||||
UnhandledExceptionFilter (ep);
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
static void SystemFavoritesServiceInvalidParameterHandler (const wchar_t *expression, const wchar_t *function, const wchar_t *file, unsigned int line, uintptr_t reserved)
|
||||
{
|
||||
TC_THROW_FATAL_EXCEPTION;
|
||||
}
|
||||
|
||||
static VOID WINAPI SystemFavoritesServiceMain (DWORD argc, LPTSTR *argv)
|
||||
{
|
||||
@ -9146,6 +9161,9 @@ static VOID WINAPI SystemFavoritesServiceMain (DWORD argc, LPTSTR *argv)
|
||||
|
||||
InitGlobalLocks ();
|
||||
|
||||
SetUnhandledExceptionFilter (SystemFavoritesServiceExceptionHandler);
|
||||
_set_invalid_parameter_handler (SystemFavoritesServiceInvalidParameterHandler);
|
||||
|
||||
SystemFavoritesServiceSetStatus (SERVICE_START_PENDING, 120000);
|
||||
|
||||
SystemFavoritesServiceLogInfo (wstring (L"Initializing list of host devices"));
|
||||
|
Loading…
Reference in New Issue
Block a user