UTF-8 Logging Move copyright to single file license? SetCurrentDirectoryW(GetCurrentDirectoryW) System.IsMultiThread for DLL and exported API In order to prevent crashing on application exit we can disable logging to console in VFS in ExitProcess, RtlTerminateProcess or LdrShutdownProcess. But maybe source of crashes lies somewhere else. (* Trying to turn off DEP *) SetProcessDEPPolicyAddr := Windows.GetProcAddress(Kernel32Handle, 'SetProcessDEPPolicy'); if SetProcessDEPPolicyAddr <> nil then begin if PatchApi.Call(PatchApi.STDCALL_, SetProcessDEPPolicyAddr, [0]) <> 0 then begin Log.Write('VFS', 'SetProcessDEPPolicy', 'DEP was turned off'); end else begin Log.Write('VFS', 'SetProcessDEPPolicy', 'Failed to turn DEP off'); end; end;