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

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