|
|
1.1.1.10 root 1: /*
1.1.1.12 root 2: Legal Notice: Some portions of the source code contained in this file were
3: derived from the source code of Encryption for the Masses 2.02a, which is
4: Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
5: Agreement for Encryption for the Masses'. Modifications and additions to
6: the original source code (contained in this file) and all other portions of
1.1.1.18 root 7: this file are Copyright (c) 2003-2009 TrueCrypt Foundation and are governed
1.1.1.20! root 8: by the TrueCrypt License 2.8 the full text of which is contained in the
1.1.1.12 root 9: file License.txt included in TrueCrypt binary and source code distribution
1.1.1.10 root 10: packages. */
1.1.1.6 root 11:
1.1.1.12 root 12: #ifndef TC_HEADER_DLGCODE
13: #define TC_HEADER_DLGCODE
14:
1.1.1.6 root 15: #include "Common.h"
16: #include "Apidrvr.h"
17: #include "Keyfiles.h"
1.1.1.12 root 18: #include "Wipe.h"
1.1.1.6 root 19:
1.1.1.10 root 20: #ifdef __cplusplus
21: extern "C" {
22: #endif
23:
1.1.1.6 root 24: /* IDs for dynamically generated GUI elements */
1.1.1.12 root 25: enum dynamic_gui_element_ids
26: {
27: IDPM_CHECK_FILESYS = 500001,
28: IDPM_REPAIR_FILESYS,
29: IDPM_OPEN_VOLUME,
1.1.1.16 root 30: IDPM_SELECT_FILE_AND_MOUNT,
31: IDPM_SELECT_DEVICE_AND_MOUNT,
1.1.1.12 root 32: IDM_SHOW_HIDE,
33: IDM_HOMEPAGE_SYSTRAY
34: };
35:
36: enum
37: {
38: TC_TBXID_LEGAL_NOTICES,
39: TC_TBXID_SYS_ENCRYPTION_PRETEST,
1.1.1.16 root 40: TC_TBXID_SYS_ENC_RESCUE_DISK,
1.1.1.20! root 41: TC_TBXID_DECOY_OS_INSTRUCTIONS,
! 42: TC_TBXID_EXTRA_BOOT_PARTITION_REMOVAL_INSTRUCTIONS
1.1.1.12 root 43: };
1.1.1.5 root 44:
1.1.1.20! root 45: #define TC_APPLICATION_ID L"TrueCryptFoundation.TrueCrypt"
! 46:
1.1.1.16 root 47: #define TC_MUTEX_NAME_SYSENC "Global\\TrueCrypt System Encryption Wizard"
48: #define TC_MUTEX_NAME_NONSYS_INPLACE_ENC "Global\\TrueCrypt In-Place Encryption Wizard"
49: #define TC_MUTEX_NAME_APP_SETUP "Global\\TrueCrypt Setup"
50: #define TC_MUTEX_NAME_DRIVER_SETUP "Global\\TrueCrypt Driver Setup"
1.1.1.15 root 51:
1.1.1.4 root 52: #define IDC_ABOUT 0x7fff /* ID for AboutBox on system menu in wm_user range */
53:
1.1.1.15 root 54: #define EXCL_ACCESS_MAX_AUTO_RETRIES 500
55: #define EXCL_ACCESS_AUTO_RETRY_DELAY 10
56:
1.1.1.11 root 57: #define UNMOUNT_MAX_AUTO_RETRIES 10
1.1.1.5 root 58: #define UNMOUNT_AUTO_RETRY_DELAY 50
1.1 root 59:
1.1.1.15 root 60: // After the user receives the "Incorrect password" error this number of times in a row, we should automatically
61: // try using the embedded header backup (if any). This ensures that the "Incorrect password" message is reported faster
62: // initially (most such errors are really caused by supplying an incorrect password, not by header corruption).
63: #define TC_TRY_HEADER_BAK_AFTER_NBR_WRONG_PWD_TRIES 2
64:
1.1.1.10 root 65: #define MAX_MULTI_CHOICES 10 /* Maximum number of options for mutliple-choice dialog */
66:
1.1.1.16 root 67: #define TC_APPD_FILENAME_CONFIGURATION "Configuration.xml"
68: #define TC_APPD_FILENAME_SYSTEM_ENCRYPTION "System Encryption.xml"
69: #define TC_APPD_FILENAME_DEFAULT_KEYFILES "Default Keyfiles.xml"
70: #define TC_APPD_FILENAME_HISTORY "History.xml"
71: #define TC_APPD_FILENAME_FAVORITE_VOLUMES "Favorite Volumes.xml"
1.1.1.20! root 72: #define TC_APPD_FILENAME_SYSTEM_FAVORITE_VOLUMES "System Favorite Volumes.xml"
1.1.1.16 root 73: #define TC_APPD_FILENAME_NONSYS_INPLACE_ENC "In-Place Encryption"
74: #define TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE "In-Place Encryption Wipe Algo"
75: #define TC_APPD_FILENAME_POST_INSTALL_TASK_TUTORIAL "Post-Install Task - Tutorial"
76: #define TC_APPD_FILENAME_POST_INSTALL_TASK_RELEASE_NOTES "Post-Install Task - Release Notes"
1.1.1.6 root 77:
1.1.1.11 root 78: #ifndef USER_DEFAULT_SCREEN_DPI
79: #define USER_DEFAULT_SCREEN_DPI 96
80: #endif
81:
82: #if (USER_DEFAULT_SCREEN_DPI != 96)
1.1.1.18 root 83: # 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).
1.1.1.11 root 84: #endif
85:
1.1.1.15 root 86: enum
87: {
88: TC_POST_INSTALL_CFG_REMOVE_ALL = 0,
89: TC_POST_INSTALL_CFG_TUTORIAL,
90: TC_POST_INSTALL_CFG_RELEASE_NOTES
91: };
92:
1.1.1.9 root 93: extern char *LastDialogId;
1.1.1.12 root 94: extern char *ConfigBuffer;
1.1 root 95: extern char szHelpFile[TC_MAX_PATH];
1.1.1.6 root 96: extern char szHelpFile2[TC_MAX_PATH];
1.1.1.16 root 97: extern char SecurityTokenLibraryPath[TC_MAX_PATH];
1.1.1.6 root 98: extern HFONT hFixedDigitFont;
1.1 root 99: extern HFONT hBoldFont;
100: extern HFONT hTitleFont;
101: extern HFONT hFixedFont;
102: extern HFONT hUserFont;
103: extern HFONT hUserUnderlineFont;
104: extern HFONT hUserBoldFont;
1.1.1.20! root 105: extern HFONT WindowTitleBarFont;
1.1.1.11 root 106: extern int ScreenDPI;
107: extern double DlgAspectRatio;
1.1.1.6 root 108: extern HWND MainDlg;
109: extern BOOL Silent;
1.1.1.9 root 110: extern BOOL bHistory;
1.1.1.6 root 111: extern BOOL bPreserveTimestamp;
1.1.1.12 root 112: extern BOOL bStartOnLogon;
113: extern BOOL bMountDevicesOnLogon;
114: extern BOOL bMountFavoritesOnLogon;
1.1.1.14 root 115: extern int HiddenSectorDetectionStatus;
1.1.1.6 root 116: extern wchar_t *lpszTitle;
1.1.1.18 root 117: extern OSVersionEnum nCurrentOS;
1.1 root 118: extern int CurrentOSMajor;
119: extern int CurrentOSMinor;
1.1.1.18 root 120: extern int CurrentOSServicePack;
1.1.1.9 root 121: extern BOOL RemoteSession;
1.1 root 122: extern HANDLE hDriver;
123: extern HINSTANCE hInst;
1.1.1.12 root 124: extern int SystemEncryptionStatus;
125: extern WipeAlgorithmId nWipeMode;
126: extern BOOL bSysPartitionSelected;
127: extern BOOL bSysDriveSelected;
128:
129: extern BOOL bHyperLinkBeingTracked;
1.1.1.16 root 130: extern BOOL bInPlaceEncNonSysPending;
1.1 root 131:
1.1.1.6 root 132: extern BOOL KeyFilesEnable;
133: extern KeyFile *FirstKeyFile;
134: extern KeyFilesDlgParam defaultKeyFilesParam;
1.1.1.10 root 135: extern BOOL UacElevated;
1.1.1.11 root 136: extern BOOL IgnoreWmDeviceChange;
1.1.1.20! root 137: extern BOOL DeviceChangeBroadcastDisabled;
! 138: extern BOOL LastMountedVolumeDirty;
! 139: extern BOOL MountVolumesAsSystemFavorite;
1.1.1.6 root 140:
1.1 root 141:
1.1.1.12 root 142: enum tc_app_msg_ids
143: {
144: /* WARNING: Changing these values or their meanings may cause incompatibility with other versions
145: (for example, if a new version of the TrueCrypt installer needed to shut down this version of
146: TrueCrypt during upgrade, it could fail or do something unwanted because the signal value would
147: be incorrect). When adding a new constant, verify that the value is unique within this block and
148: that it is less than WM_APP+16383. */
149:
150: // Common (inter-app)
151: TC_APPMSG_CLOSE_BKG_TASK = WM_APP + 4, // Changing this value will prevent smooth upgrades from pre-5.x versions
152: TC_APPMSG_SYSENC_CONFIG_UPDATE = WM_APP + 101,
153: TC_APPMSG_TASKBAR_ICON = WM_APP + 102,
154: TC_APPMSG_LOAD_TEXT_BOX_CONTENT = WM_APP + 103,
155: // Mount
156: TC_APPMSG_MOUNT_ENABLE_DISABLE_CONTROLS = WM_APP + 201,
157: TC_APPMSG_MOUNT_SHOW_WINDOW = WM_APP + 202,
1.1.1.13 root 158: TC_APPMSG_PREBOOT_PASSWORD_MODE = WM_APP + 203,
1.1.1.12 root 159: // Format
1.1.1.16 root 160: TC_APPMSG_VOL_TRANSFORM_THREAD_ENDED = WM_APP + 301,
1.1.1.12 root 161: TC_APPMSG_FORMAT_FINISHED = WM_APP + 302,
162: TC_APPMSG_FORMAT_USER_QUIT = WM_APP + 303,
163: TC_APPMSG_PERFORM_POST_WMINIT_TASKS = WM_APP + 304,
164: TC_APPMSG_PERFORM_POST_SYSENC_WMINIT_TASKS = WM_APP + 305,
1.1.1.16 root 165: TC_APPMSG_NONSYS_INPLACE_ENC_FINISHED = WM_APP + 306,
1.1.1.12 root 166: // Setup
167: TC_APPMSG_INSTALL_SUCCESS = WM_APP + 401,
168: TC_APPMSG_UNINSTALL_SUCCESS = WM_APP + 402,
169: TC_APPMSG_EXTRACTION_SUCCESS = WM_APP + 403,
170: TC_APPMSG_INSTALL_FAILURE = WM_APP + 404,
171: TC_APPMSG_UNINSTALL_FAILURE = WM_APP + 405,
1.1.1.16 root 172: TC_APPMSG_EXTRACTION_FAILURE = WM_APP + 406
1.1.1.12 root 173: };
174:
1.1.1.15 root 175: enum system_encryption_status
1.1.1.12 root 176: {
177: /* WARNING: As these values are written to config files, if they or their meanings
178: are changed, incompatiblity with other versions may arise (upgrade, downgrade, etc.).
179: When adding a new constant, verify that the value is unique within this block. */
180: SYSENC_STATUS_NONE = 0,
1.1.1.15 root 181: 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).
1.1.1.12 root 182: SYSENC_STATUS_ENCRYPTING = 400,
183: SYSENC_STATUS_DECRYPTING = 600
184: };
185:
186: enum vol_creation_wizard_modes
187: {
188: WIZARD_MODE_FILE_CONTAINER = 0,
189: WIZARD_MODE_NONSYS_DEVICE,
190: WIZARD_MODE_SYS_DEVICE
191: };
192:
1.1.1.15 root 193:
194: typedef struct
195: {
196: BOOL VolumeIsOpen;
197:
198: CRYPTO_INFO *CryptoInfo;
199: BOOL IsDevice;
200: HANDLE HostFileHandle;
201: uint64 HostSize;
202:
203: BOOL TimestampsValid;
204: FILETIME CreationTime;
205: FILETIME LastWriteTime;
206: FILETIME LastAccessTime;
207:
208: } OpenVolumeContext;
209:
210:
1.1.1.12 root 211: #define DEFAULT_VOL_CREATION_WIZARD_MODE WIZARD_MODE_FILE_CONTAINER
212:
1.1 root 213: #define ICON_HAND MB_ICONHAND
214: #define YES_NO MB_YESNO
215:
1.1.1.20! root 216: #define ISO_BURNER_TOOL "isoburn.exe"
1.1.1.12 root 217: #define PRINT_TOOL "notepad"
1.1.1.6 root 218:
1.1 root 219: void cleanup ( void );
1.1.1.16 root 220: void LowerCaseCopy ( char *lpszDest , const char *lpszSource );
221: void UpperCaseCopy ( char *lpszDest , const char *lpszSource );
222: void CreateFullVolumePath ( char *lpszDiskFile , const char *lpszFileName , BOOL *bDevice );
223: int FakeDosNameForDevice ( const char *lpszDiskFile , char *lpszDosDevice , char *lpszCFDevice , BOOL bNameOnly );
1.1 root 224: int RemoveFakeDosName ( char *lpszDiskFile , char *lpszDosDevice );
1.1.1.6 root 225: void AbortProcess ( char *stringId );
1.1.1.4 root 226: void AbortProcessSilent ( void );
1.1 root 227: void *err_malloc ( size_t size );
228: char *err_strdup ( char *lpszText );
1.1.1.4 root 229: DWORD handleWin32Error ( HWND hwndDlg );
1.1.1.18 root 230: BOOL IsDiskReadError (DWORD error);
231: BOOL IsDiskWriteError (DWORD error);
232: BOOL IsDiskError (DWORD error);
1.1.1.13 root 233: BOOL translateWin32Error ( wchar_t *lpszMsgBuf , int nWSizeOfBuf );
1.1.1.11 root 234: BOOL CALLBACK AboutDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
1.1 root 235: BOOL IsButtonChecked ( HWND hButton );
236: void CheckButton ( HWND hButton );
1.1.1.12 root 237: void LeftPadString (char *szTmp, int len, int targetLen, char filler);
1.1 root 238: void ToSBCS ( LPWSTR lpszText );
239: void ToUNICODE ( char *lpszText );
240: void InitDialog ( HWND hwndDlg );
241: HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , char *resource );
1.1.1.11 root 242: HBITMAP RenderBitmap ( char *resource , HWND hwndDest , int x , int y , int nWidth , int nHeight , BOOL bDirectRender , BOOL bKeepAspectRatio);
1.1.1.6 root 243: LRESULT CALLBACK RedTick ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
244: BOOL RegisterRedTick ( HINSTANCE hInstance );
245: BOOL UnregisterRedTick ( HINSTANCE hInstance );
1.1 root 246: LRESULT CALLBACK SplashDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
247: void WaitCursor ( void );
248: void NormalCursor ( void );
249: void ArrowWaitCursor ( void );
1.1.1.10 root 250: void HandCursor ();
1.1.1.16 root 251: void AddComboPair (HWND hComboBox, const char *lpszItem, int value);
252: void AddComboPairW (HWND hComboBox, const wchar_t *lpszItem, int value);
1.1.1.6 root 253: void SelectAlgo ( HWND hComboBox , int *nCipher );
1.1.1.16 root 254: void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption);
255: wchar_t *GetWipeModeName (WipeAlgorithmId modeId);
256: wchar_t *GetPathType (const char *path, BOOL bUpperCase, BOOL *bIsPartition);
1.1 root 257: LRESULT CALLBACK CustomDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
1.1.1.15 root 258: BOOL TCCreateMutex (volatile HANDLE *hMutex, char *name);
259: void TCCloseMutex (volatile HANDLE *hMutex);
260: BOOL MutexExistsOnSystem (char *name);
1.1.1.12 root 261: BOOL CreateSysEncMutex (void);
1.1.1.15 root 262: BOOL InstanceHasSysEncMutex (void);
1.1.1.12 root 263: void CloseSysEncMutex (void);
1.1.1.16 root 264: BOOL CreateNonSysInplaceEncMutex (void);
265: BOOL InstanceHasNonSysInplaceEncMutex (void);
266: void CloseNonSysInplaceEncMutex (void);
267: BOOL NonSysInplaceEncInProgressElsewhere (void);
1.1.1.13 root 268: BOOL CreateDriverSetupMutex (void);
269: void CloseDriverSetupMutex (void);
1.1.1.15 root 270: BOOL CreateAppSetupMutex (void);
271: BOOL InstanceHasAppSetupMutex (void);
272: void CloseAppSetupMutex (void);
273: BOOL IsTrueCryptInstallerRunning (void);
1.1.1.12 root 274: BOOL LoadSysEncSettings (HWND hwndDlg);
1.1.1.16 root 275: int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm);
1.1.1.18 root 276: void RemoveNonSysInPlaceEncNotifications (void);
1.1.1.15 root 277: void SavePostInstallTasksSettings (int command);
278: void DoPostInstallTasks (void);
1.1.1.10 root 279: void InitApp ( HINSTANCE hInstance, char *lpszCommandLine );
1.1.1.6 root 280: void InitHelpFileName (void);
1.1.1.18 root 281: BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem);
1.1.1.20! root 282: void NotifyDriverOfPortableMode (void);
1.1 root 283: int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
284: int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
1.1.1.12 root 285: int IsSystemDevicePath (char *path, HWND hwndDlg, BOOL bReliableRequired);
1.1.1.11 root 286: BOOL CALLBACK RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
1.1.1.12 root 287: BOOL TextInfoDialogBox (int nID);
288: BOOL CALLBACK TextInfoDialogBoxDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.6 root 289: char * GetLegalNotices ();
1.1.1.11 root 290: BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.18 root 291: void UserEnrichRandomPool (HWND hwndDlg);
1.1.1.11 root 292: BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.10 root 293: BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
1.1 root 294: int DriverAttach ( void );
1.1.1.6 root 295: BOOL CALLBACK CipherTestDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
296: void ResetCipherTest ( HWND hwndDlg , int idTestCipher );
1.1.1.20! root 297: void ResetCurrentDirectory ();
1.1.1.16 root 298: BOOL BrowseFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter);
1.1.1.6 root 299: BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, char *dirName);
1.1 root 300: void handleError ( HWND hwndDlg , int code );
1.1.1.6 root 301: void LocalizeDialog ( HWND hwnd, char *stringId );
1.1.1.4 root 302: void OpenVolumeExplorerWindow (int driveNo);
303: static BOOL CALLBACK CloseVolumeExplorerWindowsEnum( HWND hwnd, LPARAM driveNo);
304: BOOL CloseVolumeExplorerWindows (HWND hwnd, int driveNo);
305: BOOL CheckCapsLock (HWND hwnd, BOOL quiet);
1.1.1.10 root 306: BOOL CheckFileExtension (char *fileName);
1.1.1.15 root 307: void IncreaseWrongPwdRetryCount (int count);
308: void ResetWrongPwdRetryCount (void);
309: BOOL WrongPwdRetryCountOverLimit (void);
1.1.1.4 root 310: int GetFirstAvailableDrive ();
311: int GetLastAvailableDrive ();
312: BOOL IsDriveAvailable (int driveNo);
1.1.1.10 root 313: BOOL IsDeviceMounted (char *deviceName);
1.1.1.4 root 314: int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced);
1.1.1.5 root 315: void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap);
1.1.1.6 root 316: int MountVolume (HWND hwndDlg, int driveNo, char *volumePath, Password *password, BOOL cachePassword, BOOL sharedAccess, MountOptions *mountOptions, BOOL quiet, BOOL bReportWrongPassword);
1.1.1.4 root 317: BOOL UnmountVolume (HWND hwndDlg , int nDosDriveNo, BOOL forceUnmount);
318: BOOL IsPasswordCacheEmpty (void);
1.1.1.16 root 319: BOOL IsMountedVolume (const char *volname);
1.1.1.11 root 320: int GetMountedVolumeDriveNo (char *volname);
1.1.1.4 root 321: BOOL IsAdmin (void);
1.1.1.20! root 322: BOOL IsBuiltInAdmin ();
1.1.1.10 root 323: BOOL IsUacSupported ();
1.1.1.20! root 324: BOOL ResolveSymbolicLink (const wchar_t *symLinkName, PWSTR targetName);
1.1.1.4 root 325: int GetDiskDeviceDriveLetter (PWSTR deviceName);
1.1.1.16 root 326: int FileSystemAppearsEmpty (const char *devicePath);
327: __int64 GetStatsFreeSpaceOnPartition (const char *devicePath, float *percent, __int64 *occupiedBytes, BOOL silent);
328: __int64 GetDeviceSize (const char *devicePath);
329: HANDLE DismountDrive (char *devName, char *devicePath);
330: int64 FindString (const char *buf, const char *str, int64 bufLen, size_t strLen, int64 startOffset);
1.1.1.12 root 331: BOOL FileExists (const char *filePathPtr);
1.1.1.16 root 332: __int64 FindStringInFile (const char *filePath, const char *str, int strLen);
1.1.1.5 root 333: BOOL TCCopyFile (char *sourceFileName, char *destinationFile);
1.1.1.12 root 334: BOOL SaveBufferToFile (char *inputBuffer, char *destinationFile, DWORD inputLength, BOOL bAppend);
1.1.1.15 root 335: BOOL TCFlushFile (FILE *f);
1.1.1.12 root 336: BOOL PrintHardCopyTextUTF16 (wchar_t *text, char *title, int byteLen);
1.1.1.6 root 337: void GetSpeedString (unsigned __int64 speed, wchar_t *str);
1.1.1.5 root 338: BOOL IsNonInstallMode ();
1.1.1.6 root 339: BOOL DriverUnload ();
340: LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state);
341: BOOL GetCheckBox (HWND hwndDlg, int dlgItem);
1.1.1.12 root 342: void ManageStartupSeq (void);
1.1.1.18 root 343: void ManageStartupSeqWiz (BOOL bRemove, const char *arg);
1.1.1.6 root 344: void CleanLastVisitedMRU (void);
1.1.1.10 root 345: void ClearHistory (HWND hwndDlgItem);
1.1.1.6 root 346: LRESULT ListItemAdd (HWND list, int index, char *string);
347: LRESULT ListItemAddW (HWND list, int index, wchar_t *string);
348: LRESULT ListSubItemSet (HWND list, int index, int subIndex, char *string);
349: LRESULT ListSubItemSetW (HWND list, int index, int subIndex, wchar_t *string);
350: BOOL GetMountList (MOUNT_LIST_STRUCT *list);
351: int GetDriverRefCount ();
352: void GetSizeString (unsigned __int64 size, wchar_t *str);
1.1.1.16 root 353: __int64 GetFileSize64 (const char *path);
1.1.1.12 root 354: BOOL LoadInt16 (char *filePath, int *result, __int64 fileOffset);
355: BOOL LoadInt32 (char *filePath, unsigned __int32 *result, __int64 fileOffset);
1.1.1.16 root 356: char *LoadFile (const char *fileName, DWORD *size);
1.1.1.20! root 357: char *LoadFileBlock (char *fileName, __int64 fileOffset, size_t count);
1.1.1.10 root 358: char *GetModPath (char *path, int maxSize);
1.1.1.6 root 359: char *GetConfigPath (char *fileName);
1.1.1.20! root 360: char *GetProgramConfigPath (char *fileName);
1.1.1.12 root 361: char GetSystemDriveLetter (void);
1.1.1.6 root 362: void OpenPageHelp (HWND hwndDlg, int nPage);
363: int Info (char *stringId);
1.1.1.17 root 364: int InfoTopMost (char *stringId);
1.1.1.15 root 365: int InfoDirect (const wchar_t *msg);
1.1.1.6 root 366: int Warning (char *stringId);
1.1.1.15 root 367: int WarningTopMost (char *stringId);
368: int WarningDirect (const wchar_t *warnMsg);
1.1.1.6 root 369: int Error (char *stringId);
1.1.1.15 root 370: int ErrorDirect (const wchar_t *errMsg);
371: int ErrorTopMost (char *stringId);
1.1.1.6 root 372: int AskYesNo (char *stringId);
1.1.1.20! root 373: int AskYesNoString (const wchar_t *str);
1.1.1.6 root 374: int AskNoYes (char *stringId);
1.1.1.12 root 375: int AskOkCancel (char *stringId);
1.1.1.6 root 376: int AskWarnYesNo (char *stringId);
377: int AskWarnNoYes (char *stringId);
1.1.1.20! root 378: int AskWarnNoYesString (const wchar_t *string);
! 379: int AskWarnYesNoString (const wchar_t *string);
1.1.1.16 root 380: int AskWarnOkCancel (char *stringId);
1.1.1.6 root 381: int AskWarnCancelOk (char *stringId);
1.1.1.12 root 382: int AskErrYesNo (char *stringId);
383: int AskErrNoYes (char *stringId);
1.1.1.16 root 384: int AskMultiChoice (void *strings[], BOOL bBold);
1.1.1.6 root 385: BOOL ConfigWriteBegin ();
386: BOOL ConfigWriteEnd ();
387: BOOL ConfigWriteString (char *configKey, char *configValue);
388: BOOL ConfigWriteInt (char *configKey, int configValue);
389: int ConfigReadInt (char *configKey, int defaultValue);
390: char *ConfigReadString (char *configKey, char *defaultValue, char *str, int maxLen);
391: void RestoreDefaultKeyFilesParam (void);
392: BOOL LoadDefaultKeyFilesParam (void);
393: void Debug (char *format, ...);
394: void DebugMsgBox (char *format, ...);
1.1.1.18 root 395: BOOL IsOSAtLeast (OSVersionEnum reqMinOS);
396: BOOL IsOSVersionAtLeast (OSVersionEnum reqMinOS, int reqMinServicePack);
1.1.1.6 root 397: BOOL Is64BitOs ();
1.1.1.20! root 398: BOOL IsServerOS ();
1.1.1.15 root 399: BOOL IsHiddenOSRunning (void);
400: BOOL RestartComputer (void);
1.1.1.10 root 401: void Applink (char *dest, BOOL bSendOS, char *extraOutput);
1.1.1.6 root 402: char *RelativePath2Absolute (char *szFileName);
1.1.1.19 root 403: void HandleDriveNotReadyError ();
1.1.1.6 root 404: BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
1.1.1.7 root 405: BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam);
1.1.1.6 root 406: BYTE *MapResource (char *resourceType, int resourceId, PDWORD size);
1.1.1.12 root 407: void InconsistencyResolved (char *msg);
1.1.1.16 root 408: void ReportUnexpectedState (char *techInfo);
1.1.1.8 root 409: BOOL SelectMultipleFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory);
410: BOOL SelectMultipleFilesNext (char *lpszFileName);
1.1.1.9 root 411: void OpenOnlineHelp ();
1.1.1.16 root 412: BOOL GetPartitionInfo (const char *deviceName, PPARTITION_INFORMATION rpartInfo);
413: BOOL GetDeviceInfo (const char *deviceName, DISK_PARTITION_INFO_STRUCT *info);
414: BOOL GetDriveGeometry (const char *deviceName, PDISK_GEOMETRY diskGeometry);
1.1.1.10 root 415: BOOL IsVolumeDeviceHosted (char *lpszDiskFile);
1.1.1.11 root 416: int CompensateXDPI (int val);
417: int CompensateYDPI (int val);
418: int CompensateDPIFont (int val);
1.1.1.20! root 419: int GetTextGfxWidth (HWND hwndDlgItem, const wchar_t *text, HFONT hFont);
! 420: int GetTextGfxHeight (HWND hwndDlgItem, const wchar_t *text, HFONT hFont);
1.1.1.10 root 421: BOOL ToHyperlink (HWND hwndDlg, UINT ctrlId);
1.1.1.12 root 422: void ToBootPwdField (HWND hwndDlg, UINT ctrlId);
1.1.1.11 root 423: void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate);
1.1.1.10 root 424: BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize);
1.1.1.13 root 425: BOOL DoDriverInstall (HWND hwndDlg);
1.1.1.16 root 426: int OpenVolume (OpenVolumeContext *context, const char *volumePath, Password *password, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
1.1.1.15 root 427: void CloseVolume (OpenVolumeContext *context);
428: int ReEncryptVolumeHeader (char *buffer, BOOL bBoot, CRYPTO_INFO *cryptoInfo, Password *password, BOOL wipeMode);
1.1.1.16 root 429: BOOL IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly);
1.1.1.18 root 430: BOOL IsPagingFileWildcardActive ();
1.1.1.15 root 431: BOOL DisablePagingFile ();
1.1.1.16 root 432: BOOL CALLBACK SecurityTokenPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
433: BOOL CALLBACK SecurityTokenKeyfileDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
434: BOOL InitSecurityTokenLibrary ();
1.1.1.17 root 435: BOOL FileHasReadOnlyAttribute (const char *path);
1.1.1.16 root 436: BOOL IsFileOnReadOnlyFilesystem (const char *path);
437: void CheckFilesystem (int driveNo, BOOL fixErrors);
1.1.1.18 root 438: BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str);
439: int AskNonSysInPlaceEncryptionResume ();
440: BOOL RemoveDeviceWriteProtection (HWND hwndDlg, char *devicePath);
1.1.1.19 root 441: void EnableElevatedCursorChange (HWND parent);
1.1.1.20! root 442: BOOL DisableFileCompression (HANDLE file);
! 443: BOOL VolumePathExists (char *volumePath);
! 444: BOOL IsWindowsIsoBurnerAvailable ();
! 445: BOOL LaunchWindowsIsoBurner (HWND hwnd, const char *isoPath);
1.1.1.10 root 446:
447: #ifdef __cplusplus
448: }
1.1.1.12 root 449:
1.1.1.16 root 450: #include <vector>
451: #include <string>
452:
453: struct HostDevice
454: {
455: HostDevice ()
456: :
457: ContainsSystem (false),
458: DynamicVolume (false),
459: Floppy (false),
460: IsPartition (false),
461: IsVirtualPartition (false),
1.1.1.18 root 462: HasUnencryptedFilesystem (false),
1.1.1.16 root 463: Removable (false),
464: Size (0)
465: {
466: }
467:
468: ~HostDevice () { }
469:
470: bool ContainsSystem;
471: bool DynamicVolume;
472: bool Floppy;
473: bool IsPartition;
474: bool IsVirtualPartition;
1.1.1.18 root 475: bool HasUnencryptedFilesystem;
1.1.1.16 root 476: std::string MountPoint;
477: std::wstring Name;
478: std::string Path;
479: bool Removable;
480: uint64 Size;
481: uint32 SystemNumber;
1.1.1.12 root 482:
1.1.1.16 root 483: std::vector <HostDevice> Partitions;
484: };
485:
1.1.1.20! root 486: BOOL BrowseFilesInDir (HWND hwndDlg, char *stringId, char *initialDir, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter, const wchar_t *initialFileName = NULL, const wchar_t *defaultExtension = NULL);
1.1.1.16 root 487: std::wstring SingleStringToWide (const std::string &singleString);
488: std::wstring Utf8StringToWide (const std::string &utf8String);
489: std::string WideToSingleString (const std::wstring &wideString);
490: std::string WideToUtf8String (const std::wstring &wideString);
1.1.1.19 root 491: std::vector <HostDevice> GetAvailableHostDevices (bool noDeviceProperties = false, bool singleList = false, bool noFloppy = true, bool detectUnencryptedFilesystems = false);
1.1.1.16 root 492: std::string ToUpperCase (const std::string &str);
1.1.1.18 root 493: std::wstring GetWrongPasswordErrorMessage (HWND hwndDlg);
494: std::string GetWindowsEdition ();
1.1.1.20! root 495: std::string FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::string &path);
1.1.1.16 root 496:
497: #endif // __cplusplus
498:
499: #endif // TC_HEADER_DLGCODE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.