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

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
                      7:  this file are Copyright (c) 2003-2008 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)
                     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).
                     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.9   root       90: extern char *LastDialogId;
1.1.1.12  root       91: extern char *ConfigBuffer;
1.1       root       92: extern char szHelpFile[TC_MAX_PATH];
1.1.1.6   root       93: extern char szHelpFile2[TC_MAX_PATH];
1.1.1.16  root       94: extern char SecurityTokenLibraryPath[TC_MAX_PATH];
1.1.1.6   root       95: extern HFONT hFixedDigitFont;
1.1       root       96: extern HFONT hBoldFont;
                     97: extern HFONT hTitleFont;
                     98: extern HFONT hFixedFont;
                     99: extern HFONT hUserFont;
                    100: extern HFONT hUserUnderlineFont;
                    101: extern HFONT hUserBoldFont;
1.1.1.11  root      102: extern int ScreenDPI;
                    103: extern double DlgAspectRatio;
1.1.1.6   root      104: extern HWND MainDlg;
                    105: extern BOOL Silent;
1.1.1.9   root      106: extern BOOL bHistory;
1.1.1.6   root      107: extern BOOL bPreserveTimestamp;
1.1.1.12  root      108: extern BOOL bStartOnLogon;
                    109: extern BOOL bMountDevicesOnLogon;
                    110: extern BOOL bMountFavoritesOnLogon;
1.1.1.14  root      111: extern int HiddenSectorDetectionStatus;
1.1.1.6   root      112: extern wchar_t *lpszTitle;
1.1       root      113: extern int nCurrentOS;
                    114: extern int CurrentOSMajor;
                    115: extern int CurrentOSMinor;
1.1.1.9   root      116: extern BOOL RemoteSession;
1.1       root      117: extern HANDLE hDriver;
                    118: extern HINSTANCE hInst;
1.1.1.12  root      119: extern int SystemEncryptionStatus;     
                    120: extern WipeAlgorithmId nWipeMode;
                    121: extern BOOL bSysPartitionSelected;
                    122: extern BOOL bSysDriveSelected;
                    123: 
                    124: extern BOOL bHyperLinkBeingTracked;
1.1.1.16  root      125: extern BOOL bInPlaceEncNonSysPending;
1.1       root      126: 
1.1.1.6   root      127: extern BOOL    KeyFilesEnable;
                    128: extern KeyFile *FirstKeyFile;
                    129: extern KeyFilesDlgParam                defaultKeyFilesParam;
1.1.1.10  root      130: extern BOOL UacElevated;
1.1.1.11  root      131: extern BOOL IgnoreWmDeviceChange;
1.1.1.6   root      132: 
                    133: enum 
                    134: {
                    135:        WIN_UNKNOWN = 0,
                    136:        WIN_31,
                    137:        WIN_95,
                    138:        WIN_98,
                    139:        WIN_ME,
                    140:        WIN_NT3,
                    141:        WIN_NT4,
                    142:        WIN_2000,
                    143:        WIN_XP,
1.1.1.10  root      144:        WIN_XP64,
                    145:        WIN_SERVER_2003,
1.1.1.6   root      146:        WIN_VISTA,
1.1.1.12  root      147:        WIN_SERVER_2008,
1.1.1.10  root      148:        WIN_VISTA_OR_LATER
1.1.1.6   root      149: };
1.1       root      150: 
1.1.1.12  root      151: enum tc_app_msg_ids
                    152: {
                    153:        /* WARNING: Changing these values or their meanings may cause incompatibility with other versions
                    154:        (for example, if a new version of the TrueCrypt installer needed to shut down this version of
                    155:        TrueCrypt during upgrade, it could fail or do something unwanted because the signal value would
                    156:        be incorrect). When adding a new constant, verify that the value is unique within this block and
                    157:        that it is less than WM_APP+16383. */
                    158: 
                    159:        // Common (inter-app)
                    160:        TC_APPMSG_CLOSE_BKG_TASK =                                              WM_APP + 4,     // Changing this value will prevent smooth upgrades from pre-5.x versions
                    161:        TC_APPMSG_SYSENC_CONFIG_UPDATE =                                WM_APP + 101,
                    162:        TC_APPMSG_TASKBAR_ICON =                                                WM_APP + 102,
                    163:        TC_APPMSG_LOAD_TEXT_BOX_CONTENT =                               WM_APP + 103,
                    164:        // Mount                                                                        
                    165:        TC_APPMSG_MOUNT_ENABLE_DISABLE_CONTROLS =               WM_APP + 201,
                    166:        TC_APPMSG_MOUNT_SHOW_WINDOW =                                   WM_APP + 202,
1.1.1.13  root      167:        TC_APPMSG_PREBOOT_PASSWORD_MODE =                               WM_APP + 203,
1.1.1.16  root      168:        TC_APPMSG_VOLUMES_DISMOUNTED_ON_POWER =                 WM_APP + 204,
1.1.1.12  root      169:        // Format                                                                       
1.1.1.16  root      170:        TC_APPMSG_VOL_TRANSFORM_THREAD_ENDED =                  WM_APP + 301,
1.1.1.12  root      171:        TC_APPMSG_FORMAT_FINISHED =                                             WM_APP + 302,
                    172:        TC_APPMSG_FORMAT_USER_QUIT =                                    WM_APP + 303,
                    173:        TC_APPMSG_PERFORM_POST_WMINIT_TASKS =                   WM_APP + 304,
                    174:        TC_APPMSG_PERFORM_POST_SYSENC_WMINIT_TASKS =    WM_APP + 305,
1.1.1.16  root      175:        TC_APPMSG_NONSYS_INPLACE_ENC_FINISHED =                 WM_APP + 306,
1.1.1.12  root      176:        // Setup
                    177:        TC_APPMSG_INSTALL_SUCCESS =                                             WM_APP + 401,
                    178:        TC_APPMSG_UNINSTALL_SUCCESS =                                   WM_APP + 402,
                    179:        TC_APPMSG_EXTRACTION_SUCCESS =                                  WM_APP + 403,
                    180:        TC_APPMSG_INSTALL_FAILURE =                                             WM_APP + 404,
                    181:        TC_APPMSG_UNINSTALL_FAILURE =                                   WM_APP + 405,
1.1.1.16  root      182:        TC_APPMSG_EXTRACTION_FAILURE =                                  WM_APP + 406
1.1.1.12  root      183: };
                    184: 
1.1.1.15  root      185: enum system_encryption_status
1.1.1.12  root      186: {
                    187:        /* WARNING: As these values are written to config files, if they or their meanings
                    188:        are changed, incompatiblity with other versions may arise (upgrade, downgrade, etc.).
                    189:        When adding a new constant, verify that the value is unique within this block. */
                    190:        SYSENC_STATUS_NONE = 0,
1.1.1.15  root      191:        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      192:        SYSENC_STATUS_ENCRYPTING = 400,
                    193:        SYSENC_STATUS_DECRYPTING = 600
                    194: };
                    195: 
                    196: enum vol_creation_wizard_modes
                    197: {
                    198:        WIZARD_MODE_FILE_CONTAINER = 0,
                    199:        WIZARD_MODE_NONSYS_DEVICE,
                    200:        WIZARD_MODE_SYS_DEVICE
                    201: };
                    202: 
1.1.1.15  root      203: 
                    204: typedef struct
                    205: {
                    206:        BOOL VolumeIsOpen;
                    207: 
                    208:        CRYPTO_INFO *CryptoInfo;
                    209:        BOOL IsDevice;
                    210:        HANDLE HostFileHandle;
                    211:        uint64 HostSize;
                    212: 
                    213:        BOOL TimestampsValid;
                    214:        FILETIME CreationTime;
                    215:        FILETIME LastWriteTime;
                    216:        FILETIME LastAccessTime;
                    217: 
                    218: } OpenVolumeContext;
                    219: 
                    220: 
1.1.1.12  root      221: #define DEFAULT_VOL_CREATION_WIZARD_MODE       WIZARD_MODE_FILE_CONTAINER
                    222: 
1.1       root      223: #define ICON_HAND MB_ICONHAND
                    224: #define YES_NO MB_YESNO
                    225: 
                    226: #ifdef _UNICODE
                    227: #define WINMAIN wWinMain
                    228: #else
                    229: #define WINMAIN WinMain
                    230: #endif
                    231: 
1.1.1.12  root      232: #define PRINT_TOOL "notepad"
1.1.1.6   root      233: 
1.1       root      234: void cleanup ( void );
1.1.1.16  root      235: void LowerCaseCopy ( char *lpszDest , const char *lpszSource );
                    236: void UpperCaseCopy ( char *lpszDest , const char *lpszSource );
                    237: void CreateFullVolumePath ( char *lpszDiskFile , const char *lpszFileName , BOOL *bDevice );
                    238: int FakeDosNameForDevice ( const char *lpszDiskFile , char *lpszDosDevice , char *lpszCFDevice , BOOL bNameOnly );
1.1       root      239: int RemoveFakeDosName ( char *lpszDiskFile , char *lpszDosDevice );
1.1.1.6   root      240: void AbortProcess ( char *stringId );
1.1.1.4   root      241: void AbortProcessSilent ( void );
1.1       root      242: void *err_malloc ( size_t size );
                    243: char *err_strdup ( char *lpszText );
1.1.1.4   root      244: DWORD handleWin32Error ( HWND hwndDlg );
1.1.1.13  root      245: BOOL translateWin32Error ( wchar_t *lpszMsgBuf , int nWSizeOfBuf );
1.1.1.11  root      246: BOOL CALLBACK AboutDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
1.1       root      247: BOOL IsButtonChecked ( HWND hButton );
                    248: void CheckButton ( HWND hButton );
1.1.1.12  root      249: void LeftPadString (char *szTmp, int len, int targetLen, char filler);
1.1       root      250: void ToSBCS ( LPWSTR lpszText );
                    251: void ToUNICODE ( char *lpszText );
                    252: void InitDialog ( HWND hwndDlg );
                    253: HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , char *resource );
1.1.1.11  root      254: HBITMAP RenderBitmap ( char *resource , HWND hwndDest , int x , int y , int nWidth , int nHeight , BOOL bDirectRender , BOOL bKeepAspectRatio);
1.1.1.6   root      255: LRESULT CALLBACK RedTick ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    256: BOOL RegisterRedTick ( HINSTANCE hInstance );
                    257: BOOL UnregisterRedTick ( HINSTANCE hInstance );
1.1       root      258: LRESULT CALLBACK SplashDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    259: void WaitCursor ( void );
                    260: void NormalCursor ( void );
                    261: void ArrowWaitCursor ( void );
1.1.1.10  root      262: void HandCursor ();
1.1.1.16  root      263: void AddComboPair (HWND hComboBox, const char *lpszItem, int value);
                    264: void AddComboPairW (HWND hComboBox, const wchar_t *lpszItem, int value);
1.1.1.6   root      265: void SelectAlgo ( HWND hComboBox , int *nCipher );
1.1.1.16  root      266: void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption);
                    267: wchar_t *GetWipeModeName (WipeAlgorithmId modeId);
                    268: wchar_t *GetPathType (const char *path, BOOL bUpperCase, BOOL *bIsPartition);
1.1       root      269: LRESULT CALLBACK CustomDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
1.1.1.15  root      270: BOOL TCCreateMutex (volatile HANDLE *hMutex, char *name);
                    271: void TCCloseMutex (volatile HANDLE *hMutex);
                    272: BOOL MutexExistsOnSystem (char *name);
1.1.1.12  root      273: BOOL CreateSysEncMutex (void);
1.1.1.15  root      274: BOOL InstanceHasSysEncMutex (void);
1.1.1.12  root      275: void CloseSysEncMutex (void);
1.1.1.16  root      276: BOOL CreateNonSysInplaceEncMutex (void);
                    277: BOOL InstanceHasNonSysInplaceEncMutex (void);
                    278: void CloseNonSysInplaceEncMutex (void);
                    279: BOOL NonSysInplaceEncInProgressElsewhere (void);
1.1.1.13  root      280: BOOL CreateDriverSetupMutex (void);
                    281: void CloseDriverSetupMutex (void);
1.1.1.15  root      282: BOOL CreateAppSetupMutex (void);
                    283: BOOL InstanceHasAppSetupMutex (void);
                    284: void CloseAppSetupMutex (void);
                    285: BOOL IsTrueCryptInstallerRunning (void);
1.1.1.12  root      286: BOOL LoadSysEncSettings (HWND hwndDlg);
1.1.1.16  root      287: int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm);
1.1.1.15  root      288: void SavePostInstallTasksSettings (int command);
                    289: void DoPostInstallTasks (void);
1.1.1.12  root      290: BOOL SysEncryptionOrDecryptionRequired (void);
1.1.1.10  root      291: void InitApp ( HINSTANCE hInstance, char *lpszCommandLine );
1.1.1.6   root      292: void InitHelpFileName (void);
1.1.1.16  root      293: BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver);
1.1.1.13  root      294: void NotifyDriverOfTravelerMode (void);
1.1       root      295: int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
                    296: int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
1.1.1.12  root      297: int IsSystemDevicePath (char *path, HWND hwndDlg, BOOL bReliableRequired);
1.1.1.11  root      298: BOOL CALLBACK RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
1.1.1.12  root      299: BOOL TextInfoDialogBox (int nID);
                    300: BOOL CALLBACK TextInfoDialogBoxDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.6   root      301: char * GetLegalNotices ();
1.1.1.11  root      302: BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
                    303: BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.10  root      304: BOOL CALLBACK MultiChoiceDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
1.1       root      305: int DriverAttach ( void );
1.1.1.6   root      306: BOOL CALLBACK CipherTestDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    307: void ResetCipherTest ( HWND hwndDlg , int idTestCipher );
1.1.1.16  root      308: BOOL BrowseFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter);
                    309: BOOL BrowseFilesInDir (HWND hwndDlg, char *stringId, char *initialDir, char *lpszFileName, BOOL keepHistory, BOOL saveMode, wchar_t *browseFilter);
1.1.1.6   root      310: BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, char *dirName);
1.1       root      311: void handleError ( HWND hwndDlg , int code );
1.1.1.6   root      312: void LocalizeDialog ( HWND hwnd, char *stringId );
1.1.1.4   root      313: void OpenVolumeExplorerWindow (int driveNo);
                    314: static BOOL CALLBACK CloseVolumeExplorerWindowsEnum( HWND hwnd, LPARAM driveNo);
                    315: BOOL CloseVolumeExplorerWindows (HWND hwnd, int driveNo);
                    316: BOOL CheckCapsLock (HWND hwnd, BOOL quiet);
1.1.1.10  root      317: BOOL CheckFileExtension (char *fileName);
1.1.1.15  root      318: void IncreaseWrongPwdRetryCount (int count);
                    319: void ResetWrongPwdRetryCount (void);
                    320: BOOL WrongPwdRetryCountOverLimit (void);
1.1.1.4   root      321: int GetFirstAvailableDrive ();
                    322: int GetLastAvailableDrive ();
                    323: BOOL IsDriveAvailable (int driveNo);
1.1.1.10  root      324: BOOL IsDeviceMounted (char *deviceName);
1.1.1.4   root      325: int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced);
1.1.1.5   root      326: void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap);
1.1.1.6   root      327: 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      328: BOOL UnmountVolume (HWND hwndDlg , int nDosDriveNo, BOOL forceUnmount);
                    329: BOOL IsPasswordCacheEmpty (void);
1.1.1.16  root      330: BOOL IsMountedVolume (const char *volname);
1.1.1.11  root      331: int GetMountedVolumeDriveNo (char *volname);
1.1.1.4   root      332: BOOL IsAdmin (void);
1.1.1.10  root      333: BOOL IsUacSupported ();
1.1.1.4   root      334: BOOL ResolveSymbolicLink (PWSTR symLinkName, PWSTR targetName);
                    335: int GetDiskDeviceDriveLetter (PWSTR deviceName);
1.1.1.16  root      336: int FileSystemAppearsEmpty (const char *devicePath);
                    337: __int64 GetStatsFreeSpaceOnPartition (const char *devicePath, float *percent, __int64 *occupiedBytes, BOOL silent);
                    338: __int64 GetDeviceSize (const char *devicePath);
                    339: HANDLE DismountDrive (char *devName, char *devicePath);
                    340: int64 FindString (const char *buf, const char *str, int64 bufLen, size_t strLen, int64 startOffset);
1.1.1.12  root      341: BOOL FileExists (const char *filePathPtr);
1.1.1.16  root      342: __int64 FindStringInFile (const char *filePath, const char *str, int strLen);
1.1.1.5   root      343: BOOL TCCopyFile (char *sourceFileName, char *destinationFile);
1.1.1.12  root      344: BOOL SaveBufferToFile (char *inputBuffer, char *destinationFile, DWORD inputLength, BOOL bAppend);
1.1.1.15  root      345: BOOL TCFlushFile (FILE *f);
1.1.1.12  root      346: BOOL PrintHardCopyTextUTF16 (wchar_t *text, char *title, int byteLen);
1.1.1.6   root      347: void GetSpeedString (unsigned __int64 speed, wchar_t *str);
1.1.1.5   root      348: BOOL IsNonInstallMode ();
1.1.1.6   root      349: BOOL DriverUnload ();
                    350: LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state);
                    351: BOOL GetCheckBox (HWND hwndDlg, int dlgItem);
1.1.1.12  root      352: void ManageStartupSeq (void);
1.1.1.6   root      353: void CleanLastVisitedMRU (void);
1.1.1.10  root      354: void ClearHistory (HWND hwndDlgItem);
1.1.1.6   root      355: LRESULT ListItemAdd (HWND list, int index, char *string);
                    356: LRESULT ListItemAddW (HWND list, int index, wchar_t *string);
                    357: LRESULT ListSubItemSet (HWND list, int index, int subIndex, char *string);
                    358: LRESULT ListSubItemSetW (HWND list, int index, int subIndex, wchar_t *string);
                    359: BOOL GetMountList (MOUNT_LIST_STRUCT *list);
                    360: int GetDriverRefCount ();
                    361: void GetSizeString (unsigned __int64 size, wchar_t *str);
1.1.1.16  root      362: __int64 GetFileSize64 (const char *path);
1.1.1.12  root      363: BOOL LoadInt16 (char *filePath, int *result, __int64 fileOffset);
                    364: BOOL LoadInt32 (char *filePath, unsigned __int32 *result, __int64 fileOffset);
1.1.1.16  root      365: char *LoadFile (const char *fileName, DWORD *size);
1.1.1.12  root      366: char *LoadFileBlock (char *fileName, __int64 fileOffset, int count);
1.1.1.10  root      367: char *GetModPath (char *path, int maxSize);
1.1.1.6   root      368: char *GetConfigPath (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);
                    381: int AskNoYes (char *stringId);
1.1.1.12  root      382: int AskOkCancel (char *stringId);
1.1.1.6   root      383: int AskWarnYesNo (char *stringId);
                    384: int AskWarnNoYes (char *stringId);
1.1.1.11  root      385: int AskWarnNoYesString (wchar_t *string);
1.1.1.16  root      386: int AskWarnYesNoString (wchar_t *string);
                    387: int AskWarnOkCancel (char *stringId);
1.1.1.6   root      388: int AskWarnCancelOk (char *stringId);
1.1.1.12  root      389: int AskErrYesNo (char *stringId);
                    390: int AskErrNoYes (char *stringId);
1.1.1.16  root      391: int AskMultiChoice (void *strings[], BOOL bBold);
1.1.1.6   root      392: BOOL ConfigWriteBegin ();
                    393: BOOL ConfigWriteEnd ();
                    394: BOOL ConfigWriteString (char *configKey, char *configValue);
                    395: BOOL ConfigWriteInt (char *configKey, int configValue);
                    396: int ConfigReadInt (char *configKey, int defaultValue);
                    397: char *ConfigReadString (char *configKey, char *defaultValue, char *str, int maxLen);
                    398: void RestoreDefaultKeyFilesParam (void);
                    399: BOOL LoadDefaultKeyFilesParam (void);
                    400: void Debug (char *format, ...);
                    401: void DebugMsgBox (char *format, ...);
                    402: BOOL Is64BitOs ();
1.1.1.15  root      403: BOOL IsHiddenOSRunning (void);
                    404: BOOL RestartComputer (void);
1.1.1.10  root      405: void Applink (char *dest, BOOL bSendOS, char *extraOutput);
1.1.1.6   root      406: char *RelativePath2Absolute (char *szFileName);
                    407: void CheckSystemAutoMount ();
                    408: BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
1.1.1.7   root      409: BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam);
1.1.1.6   root      410: BYTE *MapResource (char *resourceType, int resourceId, PDWORD size);
1.1.1.12  root      411: void InconsistencyResolved (char *msg);
1.1.1.16  root      412: void ReportUnexpectedState (char *techInfo);
1.1.1.8   root      413: BOOL SelectMultipleFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory);
                    414: BOOL SelectMultipleFilesNext (char *lpszFileName);
1.1.1.9   root      415: void OpenOnlineHelp ();
1.1.1.16  root      416: BOOL GetPartitionInfo (const char *deviceName, PPARTITION_INFORMATION rpartInfo);
                    417: BOOL GetDeviceInfo (const char *deviceName, DISK_PARTITION_INFO_STRUCT *info);
                    418: BOOL GetDriveGeometry (const char *deviceName, PDISK_GEOMETRY diskGeometry);
1.1.1.10  root      419: BOOL IsVolumeDeviceHosted (char *lpszDiskFile);
1.1.1.11  root      420: int CompensateXDPI (int val);
                    421: int CompensateYDPI (int val);
                    422: int CompensateDPIFont (int val);
1.1.1.10  root      423: int GetTextGfxWidth (HWND hwndDlgItem, wchar_t *text, HFONT hFont);
                    424: int GetTextGfxHeight (HWND hwndDlgItem, wchar_t *text, HFONT hFont);
                    425: BOOL ToHyperlink (HWND hwndDlg, UINT ctrlId);
1.1.1.12  root      426: void ToBootPwdField (HWND hwndDlg, UINT ctrlId);
1.1.1.11  root      427: void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate);
1.1.1.10  root      428: BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize);
1.1.1.13  root      429: BOOL DoDriverInstall (HWND hwndDlg);
1.1.1.16  root      430: int OpenVolume (OpenVolumeContext *context, const char *volumePath, Password *password, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
1.1.1.15  root      431: void CloseVolume (OpenVolumeContext *context);
                    432: int ReEncryptVolumeHeader (char *buffer, BOOL bBoot, CRYPTO_INFO *cryptoInfo, Password *password, BOOL wipeMode);
1.1.1.16  root      433: BOOL IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly);
1.1.1.15  root      434: BOOL DisablePagingFile ();
1.1.1.16  root      435: BOOL CALLBACK SecurityTokenPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
                    436: BOOL CALLBACK SecurityTokenKeyfileDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
                    437: BOOL InitSecurityTokenLibrary ();
1.1.1.17! root      438: BOOL FileHasReadOnlyAttribute (const char *path);
1.1.1.16  root      439: BOOL IsFileOnReadOnlyFilesystem (const char *path);
                    440: void CheckFilesystem (int driveNo, BOOL fixErrors);
1.1.1.10  root      441: 
                    442: #ifdef __cplusplus
                    443: }
1.1.1.12  root      444: 
1.1.1.16  root      445: #include <vector>
                    446: #include <string>
                    447: 
                    448: struct HostDevice
                    449: {
                    450:        HostDevice ()
                    451:                :
                    452:                ContainsSystem (false),
                    453:                DynamicVolume (false),
                    454:                Floppy (false),
                    455:                IsPartition (false),
                    456:                IsVirtualPartition (false),
                    457:                Removable (false),
                    458:                Size (0)
                    459:        {
                    460:        }
                    461: 
                    462:        ~HostDevice () { }
                    463: 
                    464:        bool ContainsSystem;
                    465:        bool DynamicVolume;
                    466:        bool Floppy;
                    467:        bool IsPartition;
                    468:        bool IsVirtualPartition;
                    469:        std::string MountPoint;
                    470:        std::wstring Name;
                    471:        std::string Path;
                    472:        bool Removable;
                    473:        uint64 Size;
                    474:        uint32 SystemNumber;
1.1.1.12  root      475: 
1.1.1.16  root      476:        std::vector <HostDevice> Partitions;
                    477: };
                    478: 
                    479: std::wstring SingleStringToWide (const std::string &singleString);
                    480: std::wstring Utf8StringToWide (const std::string &utf8String);
                    481: std::string WideToSingleString (const std::wstring &wideString);
                    482: std::string WideToUtf8String (const std::wstring &wideString);
                    483: std::vector <HostDevice> GetAvailableHostDevices (bool noDeviceProperties = false, bool singleList = false, bool noFloppy = true);
                    484: std::string ToUpperCase (const std::string &str);
                    485: 
                    486: #endif // __cplusplus
                    487: 
                    488: #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.