VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Boot
AgeCommit message (Collapse)AuthorFilesLines
2024-08-02Increment version to 1.26.13. Update release notes. Update signed Windows ↵Mounir IDRASSI20-0/+0
drivers.
2024-06-12Avoid conflict with C++17 features std::byte by using uint8 type instead of byteMounir IDRASSI16-139/+139
2023-11-09Update MBR bootloader to 1.26.10 versionMounir IDRASSI20-0/+0
2023-10-11Increment version to 1.26.9Mounir IDRASSI20-0/+0
2023-10-10Increment version to 1.26.8Mounir IDRASSI20-0/+0
2023-09-30Windows: Update MBR bootloader for version 1.26.7Mounir IDRASSI20-0/+0
2023-09-21Update Release Notes. Increment version to 1.26.6.Mounir IDRASSI20-0/+0
2023-08-15Windows: Update MBR bootloader files to 1.26.5 buildMounir IDRASSI20-0/+0
2023-05-29fix wrong URL to clone EDK2 repo (#1084)Passw1-1/+1
2022-03-21Windows: Add latest 1.26 EFI bootloader files that are signed by Microsoft ↵Mounir IDRASSI12-0/+0
that come with the following modifications: - Fix bug in PasswordTimeout value handling that caused it to be limited to 255 seconds. - Rescue Disk: enhance "Boot Original Windows Loader" by using embedded backup of original Windows loader if it is missing from disk - Addition of Blake2s and removal of RIPEMD160 & GOST89
2022-03-21Increment version to 1.26 and update windows driver and MBR bootloader filesMounir IDRASSI20-0/+0
2022-03-21Windows: Display message to recreate Rescue Disk when upgrading from version ↵Mounir IDRASSI1-1/+1
1.25 or earlier because of the changes in the supported algorithms
2022-03-08Implement support of Blake2s-256 hash algorithm and remove deprecated ↵Mounir IDRASSI3-6/+6
algorithms RIPEMD-160 and GOST89.
2022-02-19Increment version to 1.25.9 and update Release Notes.Mounir IDRASSI20-0/+0
2022-02-05Windows: Update MBR bootloader files.Mounir IDRASSI20-0/+0
2022-01-07Increment version to 1.25.7 and update Release NotesMounir IDRASSI20-0/+0
2021-12-28Windows: Update precompiled MBR bootloader files for version 1.25.6Mounir IDRASSI20-0/+0
2021-12-20Increment version to 1.25.5 and update release notesMounir IDRASSI20-0/+0
2021-12-02Windows: Add pre-compiled MBR bootloader binaries for version 1.25.4 to make ↵VeraCrypt_1.25.4Mounir IDRASSI20-0/+0
it easier to build VeraCrypt without legacy VC compiler
2021-11-28Windows: Add pre-compiled MBR bootloader binaries for version 1.25 to make ↵Mounir IDRASSI41-0/+0
it easier to build VeraCrypt without legacy VC compiler
2021-09-04Minor cleanup of the repo (#822)a13460544-7/+6
* *: source files should not be executable * *: make sure files have final newline * *: remove BOM from text files * translations: unify headers * *: fix typos * *: trim excess whitespace
2021-08-30Windows: Add latest 1.25 EFI bootloader files that are signed by Microsoft ↵Mounir IDRASSI12-0/+0
that come with the following modifications: - Fix memory leak in some cases caused by wrong check of pointer for calling MEM_FREE - Clear bootParams variable that may contain sensitive information when halting the system in case of fatal error - Add option "KeyboardInputDelay" in DcsProp to control the minimum delay supported between two key strokes
2020-08-03Revert "Windows: Add latest 1.24 EFI bootloader files that are signed by ↵Mounir IDRASSI12-0/+0
Microsoft that come with the following modifications: - Fix memory leak in some cases caused by wrong check of pointer for calling MEM_FREE - Clear bootParams variable that may contain sensitive information when halting the system in case of fatal error - Add option "KeyboardInputDelay" in DcsProp to control the minimum delay supported between two key strokes" This reverts commit 7241b18794034d4755e6e8aed996b808e0a31713.
2020-08-03Windows: Add latest 1.24 EFI bootloader files that are signed by Microsoft ↵Mounir IDRASSI12-0/+0
that come with the following modifications: - Fix memory leak in some cases caused by wrong check of pointer for calling MEM_FREE - Clear bootParams variable that may contain sensitive information when halting the system in case of fatal error - Add option "KeyboardInputDelay" in DcsProp to control the minimum delay supported between two key strokes
2020-08-03Windows Bootloader: pass correct compressed data size to decompressor. ↵xiaolangde1-1/+1
Because the ds segment register is modified when setting up the decompressor segment, loader length should be read from the cs segment. (#666)
2019-12-09Windows: Add latest 1.24 EFI bootloader files that are signed by Microsoft ↵Mounir IDRASSI12-0/+0
that come with the following modifications: - Fix F5 showing previous password after failed authentication attempt. Ensure that even wrong password value are cleared from memory.
2019-11-22Windows: Add latest 1.24 EFI bootloader files that are signed by Microsoft ↵Mounir IDRASSI12-0/+0
that come with the following modifications: - Fix "ActionFailed" not working and add "ActionCancelled" to customize handling of user hitting ESC on password prompt
2019-11-09Windows MBR Bootloader: better way to handle displaying write errors in ↵Mounir IDRASSI1-4/+7
WriteEncryptedSectors function
2019-11-07Windows MBR Bootloader: workaround for SSD disks that don't allow write ↵Mounir IDRASSI4-3/+14
operations in BIOS mode with buffers less than 4096 bytes
2019-11-02Start following IEEE 1541 agreed naming of bytes (#532)Meteor0id1-1/+1
* Start following IEEE 1541 agreed naming of bytes This standard exists to prevent any confusion about the actual number of bytes. It has been agreed on by experts and is being used more widespead these day. Let's start properly naming the number of bytes, which is absolutely important in disk encryption software. * Update LanguageStrings.cpp * Update UserInterface.cpp * kibibyte instead of kilobyte * kibibyte instead of kilobyte * MiB instead of MB * undo accidental deletions Odd indeed that two random lines were deleted in a previous commit. Probably happened when using a keyboard shortcut while editing the file. This fixes the issue. * Mb to Mib
2019-10-24Windows: display prompt to upgrade Rescue Disk when installing 1.24 version ↵Mounir IDRASSI1-1/+1
since it adds functionality and it has better support for fix boot issues.
2019-09-29Windows: Add latest 1.24 EFI bootloader files that are signed by Microsoft ↵Mounir IDRASSI12-0/+0
that come with the following modifications: - Fix issue that was preventing Streebog hash from being selected manually during Pre-Boot authentication - Ensure that the correct Windows bootloader is executed when the user press ESCAPE - make the rescue disk boot machine directly from disk if "VeraCrypt" folder is missing. This make it easy to create a bootable disk for VeraCrypt from the rescue disk by just removing or renaming its "VeraCrypt" folder.
2019-03-01Windows: use specific order for EFI boot arguments memory regions that ↵Mounir IDRASSI1-1/+2
matches the one used by EFI bootloader.
2019-02-01Windows: Add latest 1.24 EFI bootloader files that are signed by Microsoft ↵Mounir IDRASSI12-0/+0
that come with several enhancements and fixes especially for Rescue Disk: - Implement better timeout mechanism for password input. Implement new actions "shutdown" and "reboot". Set default timeout value to 3 minutes and default timeout action to "shutdown" - Enhance Rescue Disk implementation of restoring VeraCrypt loader. - Fix ESC on password prompt during Pre-Test not starting Windows - Add menu entry in Rescue Disk that enables starting original Windows loader
2019-01-28Increase password maximum length to 128 bytes from 64 bytesMounir IDRASSI1-3/+3
2018-12-19Windows MBR Bootloader: workaround for issue affecting creation of hidden OS ↵Mounir IDRASSI1-1/+16
on some SSD drives (Error 128 while writing MBR). This commit replace the 512 bytes write operations by a 4096 bytes write operation.
2018-12-03MBR Bootloader: dynamically determine boot loader memory segment instead of ↵Mounir IDRASSI1-15/+16
hardcoded values (proposed by neos6464 at https://sourceforge.net/p/veracrypt/tickets/240/)
2018-09-03Windows: Add EFI bootloader files that are signed by Microsoft and remove ↵Mounir IDRASSI163-119/+1
files related to loading SecureBoot custom keys.
2018-08-24Update EFI bootloader for 1.23-BETA6Mounir IDRASSI6-0/+0
2018-08-12Windows: update EFI SecureBoot PowerShell script and its associated ↵Mounir IDRASSI141-18/+94
certificates to the latest version from VeraCrypt-DCS repository.
2018-08-12Windows: Update EFI bootloader files for 1.23-BETA3 releaseMounir IDRASSI6-0/+0
2018-07-05Windows: Update EFI bootloader binaries that implement workaround for first ↵Mounir IDRASSI6-0/+0
sector overwritten by Windows Repair.
2018-04-23Windows: Update EFI bootloader binaries that implement the new workaround ↵Mounir IDRASSI8-0/+0
for system encryption issues.
2018-04-23Windows: Fix system encryption issues on machines that always force booting ↵Mounir IDRASSI1-1/+1
on Microsoft bootloader (e.g. HP).
2018-03-30Windows: Update EFI bootloader files for 1.22 releaseMounir IDRASSI6-0/+0
2018-03-28Windows: Update EFI bootloader files for 1.22-BETA8Mounir IDRASSI6-0/+0
2018-03-27Windows: Update EFI bootloader files for 1.22-BETA7Mounir IDRASSI6-0/+0
2018-03-22Update EFI bootloader files to latest VeraCrypt-DCS (commit "llmath updated ↵Mounir IDRASSI14-0/+0
(EFI based)")
2017-08-02Windows MBR bootloader: reduce CPU usage during password prompt (Credit: ↵Mounir IDRASSI1-1/+22
Jason Pyeron of CipherShed project https://github.com/CipherShed/CipherShed/commit/00ea00e8e6a23a4243316f860aa07ed59203ab97)
2017-07-23Windows MBR Bootloader: always compress bootloader with upx to reduce ↵Mounir IDRASSI1-2/+2
runtime memory requirement thanks to its in-place decompression.
n> #define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL L"Post-Install Task - Tutorial" #define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES L"Post-Install Task - Release Notes" #define VC_FILENAME_RENAMED_SUFFIX L"_old" #ifndef USER_DEFAULT_SCREEN_DPI #define USER_DEFAULT_SCREEN_DPI 96 #endif #if (USER_DEFAULT_SCREEN_DPI != 96) # error Revision of GUI and graphics necessary, since everything assumes default screen DPI as 96 (note that 96 is the default on Windows 2000, XP, and Vista). #endif enum { TC_POST_INSTALL_CFG_REMOVE_ALL = 0, TC_POST_INSTALL_CFG_TUTORIAL, TC_POST_INSTALL_CFG_RELEASE_NOTES }; extern char *LastDialogId; extern char *ConfigBuffer; extern wchar_t szHelpFile[TC_MAX_PATH]; extern wchar_t szHelpFile2[TC_MAX_PATH]; extern wchar_t SecurityTokenLibraryPath[TC_MAX_PATH]; extern HFONT hFixedDigitFont; extern HFONT hBoldFont; extern HFONT hTitleFont; extern HFONT hFixedFont; extern HFONT hUserFont; extern HFONT hUserUnderlineFont; extern HFONT hUserBoldFont; extern HFONT WindowTitleBarFont; extern int ScreenDPI; extern double DlgAspectRatio; extern HWND MainDlg; extern BOOL Silent; extern BOOL bHistory; extern BOOL bPreserveTimestamp; extern BOOL bStartOnLogon; extern BOOL bMountDevicesOnLogon; extern BOOL bMountFavoritesOnLogon; extern int HiddenSectorDetectionStatus; extern wchar_t *lpszTitle; extern OSVersionEnum nCurrentOS; extern int CurrentOSMajor; extern int CurrentOSMinor; extern int CurrentOSServicePack; extern BOOL RemoteSession; extern HANDLE hDriver; extern HINSTANCE hInst; extern int SystemEncryptionStatus; extern WipeAlgorithmId nWipeMode; extern BOOL bSysPartitionSelected; extern BOOL bSysDriveSelected; extern wchar_t SysPartitionDevicePath [TC_MAX_PATH]; extern wchar_t SysDriveDevicePath [TC_MAX_PATH]; extern char bCachedSysDevicePathsValid; extern BOOL bHyperLinkBeingTracked; extern BOOL bInPlaceEncNonSysPending; extern BOOL PimEnable; extern BOOL KeyFilesEnable; extern KeyFile *FirstKeyFile; extern KeyFilesDlgParam defaultKeyFilesParam; extern BOOL UacElevated; extern BOOL IgnoreWmDeviceChange; extern BOOL DeviceChangeBroadcastDisabled; extern BOOL LastMountedVolumeDirty; extern BOOL MountVolumesAsSystemFavorite; extern BOOL FavoriteMountOnArrivalInProgress; extern BOOL MultipleMountOperationInProgress; enum tc_app_msg_ids { /* WARNING: Changing these values or their meanings may cause incompatibility with other versions (for example, if a new version of the TrueCrypt installer needed to shut down this version of TrueCrypt during upgrade, it could fail or do something unwanted because the signal value would be incorrect). When adding a new constant, verify that the value is unique within this block and that it is less than WM_APP+16383. */ // Common (inter-app) TC_APPMSG_CLOSE_BKG_TASK = WM_APP + 4, // Changing this value will prevent smooth upgrades from pre-5.x versions TC_APPMSG_SYSENC_CONFIG_UPDATE = WM_APP + 101, TC_APPMSG_TASKBAR_ICON = WM_APP + 102, TC_APPMSG_LOAD_TEXT_BOX_CONTENT = WM_APP + 103, // Mount TC_APPMSG_MOUNT_ENABLE_DISABLE_CONTROLS = WM_APP + 201, TC_APPMSG_MOUNT_SHOW_WINDOW = WM_APP + 202, TC_APPMSG_PREBOOT_PASSWORD_MODE = WM_APP + 203, // Format TC_APPMSG_VOL_TRANSFORM_THREAD_ENDED = WM_APP + 301, TC_APPMSG_FORMAT_FINISHED = WM_APP + 302, TC_APPMSG_FORMAT_USER_QUIT = WM_APP + 303, TC_APPMSG_PERFORM_POST_WMINIT_TASKS = WM_APP + 304, TC_APPMSG_PERFORM_POST_SYSENC_WMINIT_TASKS = WM_APP + 305, TC_APPMSG_NONSYS_INPLACE_ENC_FINISHED = WM_APP + 306, // Setup TC_APPMSG_INSTALL_SUCCESS = WM_APP + 401, TC_APPMSG_UNINSTALL_SUCCESS = WM_APP + 402, TC_APPMSG_EXTRACTION_SUCCESS = WM_APP + 403, TC_APPMSG_INSTALL_FAILURE = WM_APP + 404, TC_APPMSG_UNINSTALL_FAILURE = WM_APP + 405, TC_APPMSG_EXTRACTION_FAILURE = WM_APP + 406 }; enum system_encryption_status { /* WARNING: As these values are written to config files, if they or their meanings are changed, incompatiblity with other versions may arise (upgrade, downgrade, etc.). When adding a new constant, verify that the value is unique within this block. */ SYSENC_STATUS_NONE = 0, SYSENC_STATUS_PRETEST = 200, // This may also mean that the OS is to be (or has been) copied to a hidden volume (to create a hidden OS). SYSENC_STATUS_ENCRYPTING = 400, SYSENC_STATUS_DECRYPTING = 600 }; enum vol_creation_wizard_modes { WIZARD_MODE_FILE_CONTAINER = 0, WIZARD_MODE_NONSYS_DEVICE, WIZARD_MODE_SYS_DEVICE }; typedef struct { BOOL VolumeIsOpen; CRYPTO_INFO *CryptoInfo; BOOL IsDevice; HANDLE HostFileHandle; uint64 HostSize; BOOL TimestampsValid; FILETIME CreationTime; FILETIME LastWriteTime; FILETIME LastAccessTime; } OpenVolumeContext; #define DEFAULT_VOL_CREATION_WIZARD_MODE WIZARD_MODE_FILE_CONTAINER #define ICON_HAND MB_ICONHAND #define YES_NO MB_YESNO #define ISO_BURNER_TOOL L"isoburn.exe" #define PRINT_TOOL L"notepad.exe" void cleanup ( void ); void LowerCaseCopy ( wchar_t *lpszDest , const wchar_t *lpszSource ); void UpperCaseCopy ( wchar_t *lpszDest , size_t cbDest, const wchar_t *lpszSource ); void CreateFullVolumePath ( wchar_t *lpszDiskFile , size_t cbDiskFile, const wchar_t *lpszFileName , BOOL *bDevice ); int FakeDosNameForDevice ( const wchar_t *lpszDiskFile , wchar_t *lpszDosDevice , size_t cbDosDevice, wchar_t *lpszCFDevice , size_t cbCFDevice, BOOL bNameOnly ); int RemoveFakeDosName ( wchar_t *lpszDiskFile , wchar_t *lpszDosDevice ); void AbortProcessDirect ( wchar_t *abortMsg ); void AbortProcess ( char *stringId ); void AbortProcessSilent ( void ); void *err_malloc ( size_t size ); char *err_strdup ( char *lpszText ); DWORD handleWin32Error ( HWND hwndDlg, const char* srcPos ); BOOL IsDiskReadError (DWORD error); BOOL IsDiskWriteError (DWORD error); BOOL IsDiskError (DWORD error); BOOL translateWin32Error ( wchar_t *lpszMsgBuf , int nWSizeOfBuf ); BOOL CALLBACK AboutDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam ); static BOOL CALLBACK StaticModelessWaitDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void DisplayStaticModelessWaitDlg (HWND parent); void CloseStaticModelessWaitDlg (void); BOOL IsButtonChecked ( HWND hButton ); void CheckButton ( HWND hButton ); void LeftPadString (wchar_t *szTmp, int len, int targetLen, wchar_t filler); void InitDialog ( HWND hwndDlg ); void ProcessPaintMessages (HWND hwnd, int maxMessagesToProcess); HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , wchar_t *resource ); HBITMAP RenderBitmap ( wchar_t *resource , HWND hwndDest , int x , int y , int nWidth , int nHeight , BOOL bDirectRender , BOOL bKeepAspectRatio); LRESULT CALLBACK RedTick ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam ); BOOL RegisterRedTick ( HINSTANCE hInstance ); BOOL UnregisterRedTick ( HINSTANCE hInstance ); LRESULT CALLBACK SplashDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam ); void WaitCursor ( void ); void NormalCursor ( void ); void ArrowWaitCursor ( void ); void HandCursor (); void AddComboPair (HWND hComboBox, const wchar_t *lpszItem, int value); void SelectAlgo ( HWND hComboBox , int *nCipher ); void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption, BOOL bHeaderWipe); wchar_t *GetWipeModeName (WipeAlgorithmId modeId); wchar_t *GetPathType (const wchar_t *path, BOOL bUpperCase, BOOL *bIsPartition); LRESULT CALLBACK CustomDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam ); BOOL TCCreateMutex (volatile HANDLE *hMutex, wchar_t *name); void TCCloseMutex (volatile HANDLE *hMutex); BOOL MutexExistsOnSystem (wchar_t *name); BOOL CreateSysEncMutex (void); BOOL InstanceHasSysEncMutex (void); void CloseSysEncMutex (void); BOOL CreateNonSysInplaceEncMutex (void); BOOL InstanceHasNonSysInplaceEncMutex (void); void CloseNonSysInplaceEncMutex (void); BOOL NonSysInplaceEncInProgressElsewhere (void); BOOL CreateDriverSetupMutex (void); void CloseDriverSetupMutex (void); BOOL CreateAppSetupMutex (void); BOOL InstanceHasAppSetupMutex (void); void CloseAppSetupMutex (void); BOOL IsTrueCryptInstallerRunning (void); uint32 ReadDriverConfigurationFlags (); uint32 ReadEncryptionThreadPoolFreeCpuCountLimit (); BOOL LoadSysEncSettings (HWND hwndDlg); int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm); void RemoveNonSysInPlaceEncNotifications (void); void SavePostInstallTasksSettings (int command); void DoPostInstallTasks (HWND hwndDlg); void InitOSVersionInfo (); void InitApp ( HINSTANCE hInstance, wchar_t *lpszCommandLine ); void FinalizeApp (void); void InitHelpFileName (void); BOOL OpenDevice (const wchar_t *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem); void NotifyDriverOfPortableMode (void); int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath ); int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath ); int IsSystemDevicePath (const wchar_t *path, HWND hwndDlg, BOOL bReliableRequired); int IsNonSysPartitionOnSysDrive (const wchar_t *path); BOOL CALLBACK RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam ); INT_PTR TextInfoDialogBox (int nID); BOOL CALLBACK TextInfoDialogBoxDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); char * GetLegalNotices (); BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void UserEnrichRandomPool (HWND hwndDlg); BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); int DriverAttach ( void ); BOOL CALLBACK CipherTestDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam ); void ResetCipherTest ( HWND hwndDlg , int idTestCipher ); void ResetCurrentDirectory (); BOOL BrowseFiles (HWND hwndDlg, char *stringId, wchar_t *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter); BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, wchar_t *dirName); void handleError ( HWND hwndDlg , int code, const char* srcPos ); BOOL CheckFileStreamWriteErrors (HWND hwndDlg, FILE *file, const wchar_t *fileName); void LocalizeDialog ( HWND hwnd, char *stringId ); void OpenVolumeExplorerWindow (int driveNo); static BOOL CALLBACK CloseVolumeExplorerWindowsEnum( HWND hwnd, LPARAM driveNo); BOOL CloseVolumeExplorerWindows (HWND hwnd, int driveNo); BOOL UpdateDriveCustomLabel (int driveNo, wchar_t* effectiveLabel, BOOL bSetValue); BOOL CheckCapsLock (HWND hwnd, BOOL quiet); BOOL CheckFileExtension (wchar_t *fileName); void CorrectFileName (wchar_t* fileName); void IncreaseWrongPwdRetryCount (int count); void ResetWrongPwdRetryCount (void); BOOL WrongPwdRetryCountOverLimit (void); int GetFirstAvailableDrive (); int GetLastAvailableDrive (); BOOL IsDriveAvailable (int driveNo); BOOL IsDeviceMounted (wchar_t *deviceName); int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced); void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap); int MountVolume (HWND hwndDlg, int driveNo, wchar_t *volumePath, Password *password, int pkcs5, int pim, BOOL truecryptMode, BOOL cachePassword, BOOL cachePim, BOOL sharedAccess, const MountOptions* const mountOptions, BOOL quiet, BOOL bReportWrongPassword); BOOL UnmountVolume (HWND hwndDlg , int nDosDriveNo, BOOL forceUnmount); BOOL UnmountVolumeAfterFormatExCall (HWND hwndDlg, int nDosDriveNo); BOOL IsPasswordCacheEmpty (void); BOOL IsMountedVolume (const wchar_t *volname); int GetMountedVolumeDriveNo (wchar_t *volname); BOOL IsAdmin (void); BOOL IsBuiltInAdmin (); BOOL IsUacSupported (); BOOL ResolveSymbolicLink (const wchar_t *symLinkName, PWSTR targetName, size_t cbTargetName); int GetDiskDeviceDriveLetter (PWSTR deviceName); int FileSystemAppearsEmpty (const wchar_t *devicePath); __int64 GetStatsFreeSpaceOnPartition (const wchar_t *devicePath, float *percent, __int64 *occupiedBytes, BOOL silent); __int64 GetDeviceSize (const wchar_t *devicePath); HANDLE DismountDrive (wchar_t *devName, wchar_t *devicePath); int64 FindString (const char *buf, const char *str, int64 bufLen, int64 strLen, int64 startOffset); BOOL FileExists (const wchar_t *filePathPtr); __int64 FindStringInFile (const wchar_t *filePath, const char *str, int strLen); BOOL TCCopyFile (wchar_t *sourceFileName, wchar_t *destinationFile); BOOL SaveBufferToFile (const char *inputBuffer, const wchar_t *destinationFile, DWORD inputLength, BOOL bAppend, BOOL bRenameIfFailed); BOOL TCFlushFile (FILE *f); BOOL PrintHardCopyTextUTF16 (wchar_t *text, wchar_t *title, size_t byteLen); void GetSpeedString (unsigned __int64 speed, wchar_t *str, size_t cbStr); BOOL IsNonInstallMode (); BOOL DriverUnload (); LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state); BOOL GetCheckBox (HWND hwndDlg, int dlgItem); void SetListScrollHPos (HWND hList, int topMostVisibleItem); void ManageStartupSeq (void); void ManageStartupSeqWiz (BOOL bRemove, const wchar_t *arg); void CleanLastVisitedMRU (void); void ClearHistory (HWND hwndDlgItem); LRESULT ListItemAdd (HWND list, int index, const wchar_t *string); LRESULT ListSubItemSet (HWND list, int index, int subIndex, const wchar_t *string); BOOL GetMountList (MOUNT_LIST_STRUCT *list); int GetDriverRefCount (); void GetSizeString (unsigned __int64 size, wchar_t *str, size_t cbStr); __int64 GetFileSize64 (const wchar_t *path); BOOL LoadInt16 (const wchar_t *filePath, int *result, __int64 fileOffset); BOOL LoadInt32 (const wchar_t *filePath, unsigned __int32 *result, __int64 fileOffset); char *LoadFile (const wchar_t *fileName, DWORD *size); char *LoadFileBlock (const wchar_t *fileName, __int64 fileOffset, DWORD count); wchar_t *GetModPath (wchar_t *path, int maxSize); wchar_t *GetConfigPath (wchar_t *fileName); wchar_t *GetProgramConfigPath (wchar_t *fileName); wchar_t GetSystemDriveLetter (void); void OpenPageHelp (HWND hwndDlg, int nPage); void TaskBarIconDisplayBalloonTooltip (HWND hwnd, wchar_t *headline, wchar_t *text, BOOL warning); void InfoBalloon (char *headingStringId, char *textStringId, HWND hwnd); void InfoBalloonDirect (wchar_t *headingString, wchar_t *textString, HWND hwnd); void WarningBalloon (char *headingStringId, char *textStringId, HWND hwnd); void WarningBalloonDirect (wchar_t *headingString, wchar_t *textString, HWND hwnd); int Info (char *stringId, HWND hwnd); int InfoTopMost (char *stringId, HWND hwnd); int InfoDirect (const wchar_t *msg, HWND hwnd); int Warning (char *stringId, HWND hwnd); int WarningTopMost (char *stringId, HWND hwnd); int WarningDirect (const wchar_t *warnMsg, HWND hwnd); int Error (char *stringId, HWND hwnd); int ErrorRetryCancel (char *stringId, HWND hwnd); int ErrorDirect (const wchar_t *errMsg, HWND hwnd); int ErrorTopMost (char *stringId, HWND hwnd); int AskYesNo (char *stringId, HWND hwnd); int AskYesNoString (const wchar_t *str, HWND hwnd); int AskYesNoTopmost (char *stringId, HWND hwnd); int AskNoYes (char *stringId, HWND hwnd); int AskNoYesString (const wchar_t *string, HWND hwnd); int AskOkCancel (char *stringId, HWND hwnd); int AskWarnYesNo (char *stringId, HWND hwnd); int AskWarnYesNoString (const wchar_t *string, HWND hwnd); int AskWarnYesNoTopmost (char *stringId, HWND hwnd); int AskWarnYesNoStringTopmost (const wchar_t *string, HWND hwnd); int AskWarnNoYes (char *stringId, HWND hwnd); int AskWarnNoYesString (const wchar_t *string, HWND hwnd); int AskWarnNoYesTopmost (char *stringId, HWND hwnd); int AskWarnOkCancel (char *stringId, HWND hwnd); int AskWarnCancelOk (char *stringId, HWND hwnd); int AskErrYesNo (char *stringId, HWND hwnd); int AskErrNoYes (char *stringId, HWND hwnd); int AskMultiChoice (void *strings[], BOOL bBold, HWND hwnd); BOOL ConfigWriteBegin (); BOOL ConfigWriteEnd (HWND hwnd); BOOL ConfigWriteString (char *configKey, char *configValue); BOOL ConfigWriteStringW (char *configKey, wchar_t *configValue); BOOL ConfigWriteInt (char *configKey, int configValue); int ConfigReadInt (char *configKey, int defaultValue); char *ConfigReadString (char *configKey, char *defaultValue, char *str, int maxLen); void ConfigReadCompareInt(char *configKey, int defaultValue, int* pOutputValue, BOOL bOnlyCheckModified, BOOL* pbModified); void ConfigReadCompareString (char *configKey, char *defaultValue, char *str, int maxLen, BOOL bOnlyCheckModified, BOOL *pbModified); void RestoreDefaultKeyFilesParam (void); BOOL LoadDefaultKeyFilesParam (void); void Debug (char *format, ...); void DebugMsgBox (char *format, ...); BOOL IsOSAtLeast (OSVersionEnum reqMinOS); BOOL IsOSVersionAtLeast (OSVersionEnum reqMinOS, int reqMinServicePack); BOOL Is64BitOs (); BOOL IsServerOS (); BOOL IsHiddenOSRunning (void); BOOL EnableWow64FsRedirection (BOOL enable); BOOL RestartComputer (void); void Applink (char *dest, BOOL bSendOS, char *extraOutput); wchar_t *RelativePath2Absolute (wchar_t *szFileName); void HandleDriveNotReadyError (HWND hwnd); BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam); BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam); BYTE *MapResource (wchar_t *resourceType, int resourceId, PDWORD size); void InconsistencyResolved (char *msg); void ReportUnexpectedState (char *techInfo); BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileName, size_t cbFileName, BOOL keepHistory); BOOL SelectMultipleFilesNext (wchar_t *lpszFileName, size_t cbFileName); void OpenOnlineHelp (); BOOL GetPartitionInfo (const wchar_t *deviceName, PPARTITION_INFORMATION rpartInfo); BOOL GetDeviceInfo (const wchar_t *deviceName, DISK_PARTITION_INFO_STRUCT *info); BOOL GetDriveGeometry (const wchar_t *deviceName, PDISK_GEOMETRY diskGeometry); BOOL IsVolumeDeviceHosted (const wchar_t *lpszDiskFile); int CompensateXDPI (int val); int CompensateYDPI (int val); int CompensateDPIFont (int val); int GetTextGfxWidth (HWND hwndDlgItem, const wchar_t *text, HFONT hFont); int GetTextGfxHeight (HWND hwndDlgItem, const wchar_t *text, HFONT hFont); BOOL ToHyperlink (HWND hwndDlg, UINT ctrlId); BOOL ToCustHyperlink (HWND hwndDlg, UINT ctrlId, HFONT hFont); void DisableCloseButton (HWND hwndDlg); void EnableCloseButton (HWND hwndDlg); void ToBootPwdField (HWND hwndDlg, UINT ctrlId); void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate, HFONT hFont); BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize); BOOL GetSysDevicePaths (HWND hwndDlg); BOOL DoDriverInstall (HWND hwndDlg); int OpenVolume (OpenVolumeContext *context, const wchar_t *volumePath, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader); void CloseVolume (OpenVolumeContext *context); int ReEncryptVolumeHeader (HWND hwndDlg, char *buffer, BOOL bBoot, CRYPTO_INFO *cryptoInfo, Password *password, int pim, BOOL wipeMode); BOOL IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly); BOOL IsPagingFileWildcardActive (); BOOL DisablePagingFile (); BOOL CALLBACK SecurityTokenPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); BOOL CALLBACK SecurityTokenKeyfileDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); BOOL InitSecurityTokenLibrary (HWND hwndDlg); BOOL FileHasReadOnlyAttribute (const wchar_t *path); BOOL IsFileOnReadOnlyFilesystem (const wchar_t *path); void CheckFilesystem (HWND hwndDlg, int driveNo, BOOL fixErrors); BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str); int AskNonSysInPlaceEncryptionResume (HWND hwndDlg, BOOL* pbDecrypt); BOOL RemoveDeviceWriteProtection (HWND hwndDlg, wchar_t *devicePath); void EnableElevatedCursorChange (HWND parent); BOOL DisableFileCompression (HANDLE file); BOOL VolumePathExists (const wchar_t *volumePath); BOOL IsWindowsIsoBurnerAvailable (); BOOL LaunchWindowsIsoBurner (HWND hwnd, const wchar_t *isoPath); BOOL IsApplicationInstalled (const wchar_t *appName); int GetPim (HWND hwndDlg, UINT ctrlId); void SetPim (HWND hwndDlg, UINT ctrlId, int pim); BOOL GetPassword (HWND hwndDlg, UINT ctrlID, char* passValue, int bufSize, BOOL bShowError); void SetPassword (HWND hwndDlg, UINT ctrlID, char* passValue); void HandleShowPasswordFieldAction (HWND hwndDlg, UINT checkBoxId, UINT edit1Id, UINT edit2Id); HKEY OpenDeviceClassRegKey (const GUID *deviceClassGuid); LSTATUS DeleteRegistryKey (HKEY, LPCTSTR); HIMAGELIST CreateImageList(int cx, int cy, UINT flags, int cInitial, int cGrow); int AddBitmapToImageList(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask); HRESULT VCStrDupW(LPCWSTR psz, LPWSTR *ppwsz); #ifdef __cplusplus } #include <vector> #include <string> struct HostDevice { HostDevice () : Bootable (false), ContainsSystem (false), DynamicVolume (false), Floppy (false), IsPartition (false), IsVirtualPartition (false), HasUnencryptedFilesystem (false), Removable (false), Size (0), SystemNumber((uint32) -1) { } ~HostDevice () { } bool Bootable; bool ContainsSystem; bool DynamicVolume; bool Floppy; bool IsPartition; bool IsVirtualPartition; bool HasUnencryptedFilesystem; std::wstring MountPoint; std::wstring Name; std::wstring Path; bool Removable; uint64 Size; uint32 SystemNumber; std::vector <HostDevice> Partitions; }; struct RawDevicesDlgParam { std::vector <HostDevice> devices; wchar_t *pszFileName; }; BOOL BrowseFilesInDir (HWND hwndDlg, char *stringId, wchar_t *initialDir, wchar_t *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter, const wchar_t *initialFileName = NULL, const wchar_t *defaultExtension = NULL); std::wstring SingleStringToWide (const std::string &singleString); std::wstring Utf8StringToWide (const std::string &utf8String); std::string WideToUtf8String (const std::wstring &wideString); std::vector <HostDevice> GetAvailableHostDevices (bool noDeviceProperties = false, bool singleList = false, bool noFloppy = true, bool detectUnencryptedFilesystems = false); std::wstring ToUpperCase (const std::wstring &str); std::wstring GetWrongPasswordErrorMessage (HWND hwndDlg); std::wstring GetWindowsEdition (); std::wstring FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::wstring &path); std::wstring GetServiceConfigPath (const wchar_t *fileName, bool useLegacy); std::wstring VolumeGuidPathToDevicePath (std::wstring volumeGuidPath); std::wstring HarddiskVolumePathToPartitionPath (const std::wstring &harddiskVolumePath); std::wstring FindLatestFileOrDirectory (const std::wstring &directory, const wchar_t *namePattern, bool findDirectory, bool findFile); std::wstring GetUserFriendlyVersionString (int version); std::wstring IntToWideString (int val); void RegisterDriverInf (bool registerFilter, const std::string& filter, const std::string& filterReg, HWND ParentWindow, HKEY regKey); std::wstring GetTempPathString (); inline std::wstring AppendSrcPos (const wchar_t* msg, const char* srcPos) { return std::wstring (msg? msg : L"") + L"\n\nSource: " + SingleStringToWide (srcPos); } // Display a wait dialog while calling the provided callback with the given parameter typedef void (CALLBACK* WaitThreadProc)(void* pArg, HWND hWaitDlg); void BringToForeground(HWND hWnd); void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, void* pArg); #endif // __cplusplus #endif // TC_HEADER_DLGCODE