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

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.24! root       59: #define UNMOUNT_MAX_AUTO_RETRIES 30
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.24! root      143: extern BOOL MultipleMountOperationInProgress;
1.1.1.6   root      144: 
1.1       root      145: 
1.1.1.12  root      146: enum tc_app_msg_ids
                    147: {
                    148:        /* WARNING: Changing these values or their meanings may cause incompatibility with other versions
                    149:        (for example, if a new version of the TrueCrypt installer needed to shut down this version of
                    150:        TrueCrypt during upgrade, it could fail or do something unwanted because the signal value would
                    151:        be incorrect). When adding a new constant, verify that the value is unique within this block and
                    152:        that it is less than WM_APP+16383. */
                    153: 
                    154:        // Common (inter-app)
                    155:        TC_APPMSG_CLOSE_BKG_TASK =                                              WM_APP + 4,     // Changing this value will prevent smooth upgrades from pre-5.x versions
                    156:        TC_APPMSG_SYSENC_CONFIG_UPDATE =                                WM_APP + 101,
                    157:        TC_APPMSG_TASKBAR_ICON =                                                WM_APP + 102,
                    158:        TC_APPMSG_LOAD_TEXT_BOX_CONTENT =                               WM_APP + 103,
                    159:        // Mount                                                                        
                    160:        TC_APPMSG_MOUNT_ENABLE_DISABLE_CONTROLS =               WM_APP + 201,
                    161:        TC_APPMSG_MOUNT_SHOW_WINDOW =                                   WM_APP + 202,
1.1.1.13  root      162:        TC_APPMSG_PREBOOT_PASSWORD_MODE =                               WM_APP + 203,
1.1.1.12  root      163:        // Format                                                                       
1.1.1.16  root      164:        TC_APPMSG_VOL_TRANSFORM_THREAD_ENDED =                  WM_APP + 301,
1.1.1.12  root      165:        TC_APPMSG_FORMAT_FINISHED =                                             WM_APP + 302,
                    166:        TC_APPMSG_FORMAT_USER_QUIT =                                    WM_APP + 303,
                    167:        TC_APPMSG_PERFORM_POST_WMINIT_TASKS =                   WM_APP + 304,
                    168:        TC_APPMSG_PERFORM_POST_SYSENC_WMINIT_TASKS =    WM_APP + 305,
1.1.1.16  root      169:        TC_APPMSG_NONSYS_INPLACE_ENC_FINISHED =                 WM_APP + 306,
1.1.1.12  root      170:        // Setup
                    171:        TC_APPMSG_INSTALL_SUCCESS =                                             WM_APP + 401,
                    172:        TC_APPMSG_UNINSTALL_SUCCESS =                                   WM_APP + 402,
                    173:        TC_APPMSG_EXTRACTION_SUCCESS =                                  WM_APP + 403,
                    174:        TC_APPMSG_INSTALL_FAILURE =                                             WM_APP + 404,
                    175:        TC_APPMSG_UNINSTALL_FAILURE =                                   WM_APP + 405,
1.1.1.16  root      176:        TC_APPMSG_EXTRACTION_FAILURE =                                  WM_APP + 406
1.1.1.12  root      177: };
                    178: 
1.1.1.15  root      179: enum system_encryption_status
1.1.1.12  root      180: {
                    181:        /* WARNING: As these values are written to config files, if they or their meanings
                    182:        are changed, incompatiblity with other versions may arise (upgrade, downgrade, etc.).
                    183:        When adding a new constant, verify that the value is unique within this block. */
                    184:        SYSENC_STATUS_NONE = 0,
1.1.1.15  root      185:        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      186:        SYSENC_STATUS_ENCRYPTING = 400,
                    187:        SYSENC_STATUS_DECRYPTING = 600
                    188: };
                    189: 
                    190: enum vol_creation_wizard_modes
                    191: {
                    192:        WIZARD_MODE_FILE_CONTAINER = 0,
                    193:        WIZARD_MODE_NONSYS_DEVICE,
                    194:        WIZARD_MODE_SYS_DEVICE
                    195: };
                    196: 
1.1.1.15  root      197: 
                    198: typedef struct
                    199: {
                    200:        BOOL VolumeIsOpen;
                    201: 
                    202:        CRYPTO_INFO *CryptoInfo;
                    203:        BOOL IsDevice;
                    204:        HANDLE HostFileHandle;
                    205:        uint64 HostSize;
                    206: 
                    207:        BOOL TimestampsValid;
                    208:        FILETIME CreationTime;
                    209:        FILETIME LastWriteTime;
                    210:        FILETIME LastAccessTime;
                    211: 
                    212: } OpenVolumeContext;
                    213: 
                    214: 
1.1.1.12  root      215: #define DEFAULT_VOL_CREATION_WIZARD_MODE       WIZARD_MODE_FILE_CONTAINER
                    216: 
1.1       root      217: #define ICON_HAND MB_ICONHAND
                    218: #define YES_NO MB_YESNO
                    219: 
1.1.1.20  root      220: #define        ISO_BURNER_TOOL "isoburn.exe"
1.1.1.12  root      221: #define PRINT_TOOL "notepad"
1.1.1.6   root      222: 
1.1       root      223: void cleanup ( void );
1.1.1.16  root      224: void LowerCaseCopy ( char *lpszDest , const char *lpszSource );
                    225: void UpperCaseCopy ( char *lpszDest , const char *lpszSource );
                    226: void CreateFullVolumePath ( char *lpszDiskFile , const char *lpszFileName , BOOL *bDevice );
                    227: int FakeDosNameForDevice ( const char *lpszDiskFile , char *lpszDosDevice , char *lpszCFDevice , BOOL bNameOnly );
1.1       root      228: int RemoveFakeDosName ( char *lpszDiskFile , char *lpszDosDevice );
1.1.1.6   root      229: void AbortProcess ( char *stringId );
1.1.1.4   root      230: void AbortProcessSilent ( void );
1.1       root      231: void *err_malloc ( size_t size );
                    232: char *err_strdup ( char *lpszText );
1.1.1.4   root      233: DWORD handleWin32Error ( HWND hwndDlg );
1.1.1.18  root      234: BOOL IsDiskReadError (DWORD error);
                    235: BOOL IsDiskWriteError (DWORD error);
                    236: BOOL IsDiskError (DWORD error);
1.1.1.13  root      237: BOOL translateWin32Error ( wchar_t *lpszMsgBuf , int nWSizeOfBuf );
1.1.1.11  root      238: BOOL CALLBACK AboutDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
1.1.1.23  root      239: static BOOL CALLBACK StaticModelessWaitDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
                    240: void DisplayStaticModelessWaitDlg (HWND parent);
                    241: void CloseStaticModelessWaitDlg (void);
1.1       root      242: BOOL IsButtonChecked ( HWND hButton );
                    243: void CheckButton ( HWND hButton );
1.1.1.12  root      244: void LeftPadString (char *szTmp, int len, int targetLen, char filler);
1.1       root      245: void ToSBCS ( LPWSTR lpszText );
                    246: void ToUNICODE ( char *lpszText );
                    247: void InitDialog ( HWND hwndDlg );
1.1.1.23  root      248: void ProcessPaintMessages (HWND hwnd, int maxMessagesToProcess);
1.1       root      249: HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , char *resource );
1.1.1.11  root      250: HBITMAP RenderBitmap ( char *resource , HWND hwndDest , int x , int y , int nWidth , int nHeight , BOOL bDirectRender , BOOL bKeepAspectRatio);
1.1.1.6   root      251: LRESULT CALLBACK RedTick ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    252: BOOL RegisterRedTick ( HINSTANCE hInstance );
                    253: BOOL UnregisterRedTick ( HINSTANCE hInstance );
1.1       root      254: LRESULT CALLBACK SplashDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    255: void WaitCursor ( void );
                    256: void NormalCursor ( void );
                    257: void ArrowWaitCursor ( void );
1.1.1.10  root      258: void HandCursor ();
1.1.1.16  root      259: void AddComboPair (HWND hComboBox, const char *lpszItem, int value);
                    260: void AddComboPairW (HWND hComboBox, const wchar_t *lpszItem, int value);
1.1.1.6   root      261: void SelectAlgo ( HWND hComboBox , int *nCipher );
1.1.1.16  root      262: void PopulateWipeModeCombo (HWND hComboBox, BOOL bNA, BOOL bInPlaceEncryption);
                    263: wchar_t *GetWipeModeName (WipeAlgorithmId modeId);
                    264: wchar_t *GetPathType (const char *path, BOOL bUpperCase, BOOL *bIsPartition);
1.1       root      265: LRESULT CALLBACK CustomDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
1.1.1.15  root      266: BOOL TCCreateMutex (volatile HANDLE *hMutex, char *name);
                    267: void TCCloseMutex (volatile HANDLE *hMutex);
                    268: BOOL MutexExistsOnSystem (char *name);
1.1.1.12  root      269: BOOL CreateSysEncMutex (void);
1.1.1.15  root      270: BOOL InstanceHasSysEncMutex (void);
1.1.1.12  root      271: void CloseSysEncMutex (void);
1.1.1.16  root      272: BOOL CreateNonSysInplaceEncMutex (void);
                    273: BOOL InstanceHasNonSysInplaceEncMutex (void);
                    274: void CloseNonSysInplaceEncMutex (void);
                    275: BOOL NonSysInplaceEncInProgressElsewhere (void);
1.1.1.13  root      276: BOOL CreateDriverSetupMutex (void);
                    277: void CloseDriverSetupMutex (void);
1.1.1.15  root      278: BOOL CreateAppSetupMutex (void);
                    279: BOOL InstanceHasAppSetupMutex (void);
                    280: void CloseAppSetupMutex (void);
                    281: BOOL IsTrueCryptInstallerRunning (void);
1.1.1.22  root      282: uint32 ReadDriverConfigurationFlags ();
                    283: uint32 ReadEncryptionThreadPoolFreeCpuCountLimit ();
1.1.1.12  root      284: BOOL LoadSysEncSettings (HWND hwndDlg);
1.1.1.16  root      285: int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm);
1.1.1.18  root      286: void RemoveNonSysInPlaceEncNotifications (void);
1.1.1.15  root      287: void SavePostInstallTasksSettings (int command);
                    288: void DoPostInstallTasks (void);
1.1.1.22  root      289: void InitOSVersionInfo ();
1.1.1.10  root      290: void InitApp ( HINSTANCE hInstance, char *lpszCommandLine );
1.1.1.6   root      291: void InitHelpFileName (void);
1.1.1.18  root      292: BOOL OpenDevice (const char *lpszPath, OPEN_TEST_STRUCT *driver, BOOL detectFilesystem);
1.1.1.20  root      293: void NotifyDriverOfPortableMode (void);
1.1       root      294: int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
                    295: int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
1.1.1.12  root      296: int IsSystemDevicePath (char *path, HWND hwndDlg, BOOL bReliableRequired);
1.1.1.11  root      297: BOOL CALLBACK RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
1.1.1.12  root      298: BOOL TextInfoDialogBox (int nID);
                    299: BOOL CALLBACK TextInfoDialogBoxDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.6   root      300: char * GetLegalNotices ();
1.1.1.11  root      301: BOOL CALLBACK BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.18  root      302: void UserEnrichRandomPool (HWND hwndDlg);
1.1.1.11  root      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.20  root      308: void ResetCurrentDirectory ();
1.1.1.16  root      309: BOOL BrowseFiles (HWND hwndDlg, char *stringId, 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.22  root      312: BOOL CheckFileStreamWriteErrors (FILE *file, const char *fileName);
1.1.1.6   root      313: void LocalizeDialog ( HWND hwnd, char *stringId );
1.1.1.4   root      314: void OpenVolumeExplorerWindow (int driveNo);
                    315: static BOOL CALLBACK CloseVolumeExplorerWindowsEnum( HWND hwnd, LPARAM driveNo);
                    316: BOOL CloseVolumeExplorerWindows (HWND hwnd, int driveNo);
                    317: BOOL CheckCapsLock (HWND hwnd, BOOL quiet);
1.1.1.10  root      318: BOOL CheckFileExtension (char *fileName);
1.1.1.15  root      319: void IncreaseWrongPwdRetryCount (int count);
                    320: void ResetWrongPwdRetryCount (void);
                    321: BOOL WrongPwdRetryCountOverLimit (void);
1.1.1.4   root      322: int GetFirstAvailableDrive ();
                    323: int GetLastAvailableDrive ();
                    324: BOOL IsDriveAvailable (int driveNo);
1.1.1.10  root      325: BOOL IsDeviceMounted (char *deviceName);
1.1.1.4   root      326: int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced);
1.1.1.5   root      327: void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap);
1.1.1.24! root      328: int MountVolume (HWND hwndDlg, int driveNo, char *volumePath, Password *password, BOOL cachePassword, BOOL sharedAccess,  const MountOptions* const mountOptions, BOOL quiet, BOOL bReportWrongPassword);
1.1.1.4   root      329: BOOL UnmountVolume (HWND hwndDlg , int nDosDriveNo, BOOL forceUnmount);
                    330: BOOL IsPasswordCacheEmpty (void);
1.1.1.16  root      331: BOOL IsMountedVolume (const char *volname);
1.1.1.11  root      332: int GetMountedVolumeDriveNo (char *volname);
1.1.1.4   root      333: BOOL IsAdmin (void);
1.1.1.20  root      334: BOOL IsBuiltInAdmin ();
1.1.1.10  root      335: BOOL IsUacSupported ();
1.1.1.20  root      336: BOOL ResolveSymbolicLink (const wchar_t *symLinkName, PWSTR targetName);
1.1.1.4   root      337: int GetDiskDeviceDriveLetter (PWSTR deviceName);
1.1.1.16  root      338: int FileSystemAppearsEmpty (const char *devicePath);
                    339: __int64 GetStatsFreeSpaceOnPartition (const char *devicePath, float *percent, __int64 *occupiedBytes, BOOL silent);
                    340: __int64 GetDeviceSize (const char *devicePath);
                    341: HANDLE DismountDrive (char *devName, char *devicePath);
                    342: int64 FindString (const char *buf, const char *str, int64 bufLen, size_t strLen, int64 startOffset);
1.1.1.12  root      343: BOOL FileExists (const char *filePathPtr);
1.1.1.16  root      344: __int64 FindStringInFile (const char *filePath, const char *str, int strLen);
1.1.1.5   root      345: BOOL TCCopyFile (char *sourceFileName, char *destinationFile);
1.1.1.22  root      346: BOOL SaveBufferToFile (const char *inputBuffer, const char *destinationFile, DWORD inputLength, BOOL bAppend);
1.1.1.15  root      347: BOOL TCFlushFile (FILE *f);
1.1.1.12  root      348: BOOL PrintHardCopyTextUTF16 (wchar_t *text, char *title, int byteLen);
1.1.1.6   root      349: void GetSpeedString (unsigned __int64 speed, wchar_t *str);
1.1.1.5   root      350: BOOL IsNonInstallMode ();
1.1.1.6   root      351: BOOL DriverUnload ();
                    352: LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state);
                    353: BOOL GetCheckBox (HWND hwndDlg, int dlgItem);
1.1.1.22  root      354: void SetListScrollHPos (HWND hList, int topMostVisibleItem);
1.1.1.12  root      355: void ManageStartupSeq (void);
1.1.1.18  root      356: void ManageStartupSeqWiz (BOOL bRemove, const char *arg);
1.1.1.6   root      357: void CleanLastVisitedMRU (void);
1.1.1.10  root      358: void ClearHistory (HWND hwndDlgItem);
1.1.1.6   root      359: LRESULT ListItemAdd (HWND list, int index, char *string);
                    360: LRESULT ListItemAddW (HWND list, int index, wchar_t *string);
                    361: LRESULT ListSubItemSet (HWND list, int index, int subIndex, char *string);
                    362: LRESULT ListSubItemSetW (HWND list, int index, int subIndex, wchar_t *string);
                    363: BOOL GetMountList (MOUNT_LIST_STRUCT *list);
                    364: int GetDriverRefCount ();
                    365: void GetSizeString (unsigned __int64 size, wchar_t *str);
1.1.1.16  root      366: __int64 GetFileSize64 (const char *path);
1.1.1.12  root      367: BOOL LoadInt16 (char *filePath, int *result, __int64 fileOffset);
                    368: BOOL LoadInt32 (char *filePath, unsigned __int32 *result, __int64 fileOffset);
1.1.1.16  root      369: char *LoadFile (const char *fileName, DWORD *size);
1.1.1.20  root      370: char *LoadFileBlock (char *fileName, __int64 fileOffset, size_t count);
1.1.1.10  root      371: char *GetModPath (char *path, int maxSize);
1.1.1.6   root      372: char *GetConfigPath (char *fileName);
1.1.1.20  root      373: char *GetProgramConfigPath (char *fileName);
1.1.1.12  root      374: char GetSystemDriveLetter (void);
1.1.1.6   root      375: void OpenPageHelp (HWND hwndDlg, int nPage);
1.1.1.24! root      376: void TaskBarIconDisplayBalloonTooltip (HWND hwnd, wchar_t *headline, wchar_t *text, BOOL warning);
        !           377: void InfoBalloon (char *headingStringId, char *textStringId);
        !           378: void InfoBalloonDirect (wchar_t *headingString, wchar_t *textString);
        !           379: void WarningBalloon (char *headingStringId, char *textStringId);
        !           380: void WarningBalloonDirect (wchar_t *headingString, wchar_t *textString);
1.1.1.6   root      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);
1.1.1.20  root      391: int AskYesNoString (const wchar_t *str);
1.1.1.24! root      392: int AskYesNoTopmost (char *stringId);
1.1.1.6   root      393: int AskNoYes (char *stringId);
1.1.1.12  root      394: int AskOkCancel (char *stringId);
1.1.1.6   root      395: int AskWarnYesNo (char *stringId);
1.1.1.24! root      396: int AskWarnYesNoString (const wchar_t *string);
        !           397: int AskWarnYesNoTopmost (char *stringId);
1.1.1.6   root      398: int AskWarnNoYes (char *stringId);
1.1.1.20  root      399: int AskWarnNoYesString (const wchar_t *string);
1.1.1.24! root      400: int AskWarnNoYesTopmost (char *stringId);
1.1.1.16  root      401: int AskWarnOkCancel (char *stringId);
1.1.1.6   root      402: int AskWarnCancelOk (char *stringId);
1.1.1.12  root      403: int AskErrYesNo (char *stringId);
                    404: int AskErrNoYes (char *stringId);
1.1.1.16  root      405: int AskMultiChoice (void *strings[], BOOL bBold);
1.1.1.6   root      406: BOOL ConfigWriteBegin ();
                    407: BOOL ConfigWriteEnd ();
                    408: BOOL ConfigWriteString (char *configKey, char *configValue);
                    409: BOOL ConfigWriteInt (char *configKey, int configValue);
                    410: int ConfigReadInt (char *configKey, int defaultValue);
                    411: char *ConfigReadString (char *configKey, char *defaultValue, char *str, int maxLen);
                    412: void RestoreDefaultKeyFilesParam (void);
                    413: BOOL LoadDefaultKeyFilesParam (void);
                    414: void Debug (char *format, ...);
                    415: void DebugMsgBox (char *format, ...);
1.1.1.18  root      416: BOOL IsOSAtLeast (OSVersionEnum reqMinOS);
                    417: BOOL IsOSVersionAtLeast (OSVersionEnum reqMinOS, int reqMinServicePack);
1.1.1.6   root      418: BOOL Is64BitOs ();
1.1.1.20  root      419: BOOL IsServerOS ();
1.1.1.15  root      420: BOOL IsHiddenOSRunning (void);
1.1.1.22  root      421: BOOL EnableWow64FsRedirection (BOOL enable);
1.1.1.15  root      422: BOOL RestartComputer (void);
1.1.1.10  root      423: void Applink (char *dest, BOOL bSendOS, char *extraOutput);
1.1.1.6   root      424: char *RelativePath2Absolute (char *szFileName);
1.1.1.19  root      425: void HandleDriveNotReadyError ();
1.1.1.6   root      426: BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
1.1.1.7   root      427: BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam);
1.1.1.6   root      428: BYTE *MapResource (char *resourceType, int resourceId, PDWORD size);
1.1.1.12  root      429: void InconsistencyResolved (char *msg);
1.1.1.16  root      430: void ReportUnexpectedState (char *techInfo);
1.1.1.8   root      431: BOOL SelectMultipleFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory);
                    432: BOOL SelectMultipleFilesNext (char *lpszFileName);
1.1.1.9   root      433: void OpenOnlineHelp ();
1.1.1.16  root      434: BOOL GetPartitionInfo (const char *deviceName, PPARTITION_INFORMATION rpartInfo);
                    435: BOOL GetDeviceInfo (const char *deviceName, DISK_PARTITION_INFO_STRUCT *info);
                    436: BOOL GetDriveGeometry (const char *deviceName, PDISK_GEOMETRY diskGeometry);
1.1.1.22  root      437: BOOL IsVolumeDeviceHosted (const char *lpszDiskFile);
1.1.1.11  root      438: int CompensateXDPI (int val);
                    439: int CompensateYDPI (int val);
                    440: int CompensateDPIFont (int val);
1.1.1.20  root      441: int GetTextGfxWidth (HWND hwndDlgItem, const wchar_t *text, HFONT hFont);
                    442: int GetTextGfxHeight (HWND hwndDlgItem, const wchar_t *text, HFONT hFont);
1.1.1.10  root      443: BOOL ToHyperlink (HWND hwndDlg, UINT ctrlId);
1.1.1.24! root      444: BOOL ToCustHyperlink (HWND hwndDlg, UINT ctrlId, HFONT hFont);
1.1.1.12  root      445: void ToBootPwdField (HWND hwndDlg, UINT ctrlId);
1.1.1.24! root      446: void AccommodateTextField (HWND hwndDlg, UINT ctrlId, BOOL bFirstUpdate, HFONT hFont);
1.1.1.10  root      447: BOOL GetDriveLabel (int driveNo, wchar_t *label, int labelSize);
1.1.1.13  root      448: BOOL DoDriverInstall (HWND hwndDlg);
1.1.1.16  root      449: int OpenVolume (OpenVolumeContext *context, const char *volumePath, Password *password, BOOL write, BOOL preserveTimestamps, BOOL useBackupHeader);
1.1.1.15  root      450: void CloseVolume (OpenVolumeContext *context);
                    451: int ReEncryptVolumeHeader (char *buffer, BOOL bBoot, CRYPTO_INFO *cryptoInfo, Password *password, BOOL wipeMode);
1.1.1.16  root      452: BOOL IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly);
1.1.1.18  root      453: BOOL IsPagingFileWildcardActive ();
1.1.1.15  root      454: BOOL DisablePagingFile ();
1.1.1.16  root      455: BOOL CALLBACK SecurityTokenPasswordDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
                    456: BOOL CALLBACK SecurityTokenKeyfileDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
                    457: BOOL InitSecurityTokenLibrary ();
1.1.1.17  root      458: BOOL FileHasReadOnlyAttribute (const char *path);
1.1.1.16  root      459: BOOL IsFileOnReadOnlyFilesystem (const char *path);
                    460: void CheckFilesystem (int driveNo, BOOL fixErrors);
1.1.1.18  root      461: BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str);
                    462: int AskNonSysInPlaceEncryptionResume ();
                    463: BOOL RemoveDeviceWriteProtection (HWND hwndDlg, char *devicePath);
1.1.1.19  root      464: void EnableElevatedCursorChange (HWND parent);
1.1.1.20  root      465: BOOL DisableFileCompression (HANDLE file);
                    466: BOOL VolumePathExists (char *volumePath);
                    467: BOOL IsWindowsIsoBurnerAvailable ();
                    468: BOOL LaunchWindowsIsoBurner (HWND hwnd, const char *isoPath);
1.1.1.22  root      469: BOOL IsApplicationInstalled (const char *appName);
1.1.1.10  root      470: 
                    471: #ifdef __cplusplus
                    472: }
1.1.1.12  root      473: 
1.1.1.16  root      474: #include <vector>
                    475: #include <string>
                    476: 
                    477: struct HostDevice
                    478: {
                    479:        HostDevice ()
                    480:                :
1.1.1.21  root      481:                Bootable (false),
1.1.1.16  root      482:                ContainsSystem (false),
                    483:                DynamicVolume (false),
                    484:                Floppy (false),
                    485:                IsPartition (false),
                    486:                IsVirtualPartition (false),
1.1.1.18  root      487:                HasUnencryptedFilesystem (false),
1.1.1.16  root      488:                Removable (false),
                    489:                Size (0)
                    490:        {
                    491:        }
                    492: 
                    493:        ~HostDevice () { }
                    494: 
1.1.1.21  root      495:        bool Bootable;
1.1.1.16  root      496:        bool ContainsSystem;
                    497:        bool DynamicVolume;
                    498:        bool Floppy;
                    499:        bool IsPartition;
                    500:        bool IsVirtualPartition;
1.1.1.18  root      501:        bool HasUnencryptedFilesystem;
1.1.1.16  root      502:        std::string MountPoint;
                    503:        std::wstring Name;
                    504:        std::string Path;
                    505:        bool Removable;
                    506:        uint64 Size;
                    507:        uint32 SystemNumber;
1.1.1.12  root      508: 
1.1.1.16  root      509:        std::vector <HostDevice> Partitions;
                    510: };
                    511: 
1.1.1.20  root      512: 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      513: std::wstring SingleStringToWide (const std::string &singleString);
                    514: std::wstring Utf8StringToWide (const std::string &utf8String);
                    515: std::string WideToSingleString (const std::wstring &wideString);
                    516: std::string WideToUtf8String (const std::wstring &wideString);
1.1.1.22  root      517: std::string StringToUpperCase (const std::string &str);
1.1.1.19  root      518: std::vector <HostDevice> GetAvailableHostDevices (bool noDeviceProperties = false, bool singleList = false, bool noFloppy = true, bool detectUnencryptedFilesystems = false);
1.1.1.16  root      519: std::string ToUpperCase (const std::string &str);
1.1.1.18  root      520: std::wstring GetWrongPasswordErrorMessage (HWND hwndDlg);
                    521: std::string GetWindowsEdition ();
1.1.1.20  root      522: std::string FitPathInGfxWidth (HWND hwnd, HFONT hFont, LONG width, const std::string &path);
1.1.1.21  root      523: std::string GetServiceConfigPath (const char *fileName);
1.1.1.22  root      524: std::string VolumeGuidPathToDevicePath (std::string volumeGuidPath);
1.1.1.24! root      525: std::string HarddiskVolumePathToPartitionPath (const std::string &harddiskVolumePath);
1.1.1.22  root      526: std::string FindLatestFileOrDirectory (const std::string &directory, const char *namePattern, bool findDirectory, bool findFile);
                    527: std::string GetUserFriendlyVersionString (int version);
1.1.1.16  root      528: 
                    529: #endif // __cplusplus
                    530: 
                    531: #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.