Annotation of truecrypt/common/dlgcode.h, revision 1.1.1.18

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.