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

1.1.1.6   root        1: /* Legal Notice: The source code contained in this file has been derived from
                      2:    the source code of Encryption for the Masses 2.02a, which is Copyright (c)
                      3:    1998-99 Paul Le Roux and which is covered by the 'License Agreement for
                      4:    Encryption for the Masses'. Modifications and additions to that source code
1.1.1.8   root        5:    contained in this file are Copyright (c) 2004-2006 TrueCrypt Foundation and
1.1.1.9 ! root        6:    Copyright (c) 2004 TrueCrypt Team, and are covered by TrueCrypt License 2.1
1.1.1.6   root        7:    the full text of which is contained in the file License.txt included in
                      8:    TrueCrypt binary and source code distribution archives.  */
                      9: 
                     10: #include "Common.h"
                     11: #include "Apidrvr.h"
                     12: #include "Keyfiles.h"
                     13: 
                     14: /* IDs for dynamically generated GUI elements */
                     15: #define IDPM_CHECK_FILESYS             500001
                     16: #define IDPM_REPAIR_FILESYS            500002
                     17: #define        IDPM_OPEN_VOLUME                500003
                     18: #define IDM_SHOW_HIDE                  500004
1.1.1.5   root       19: 
1.1.1.4   root       20: #define IDC_ABOUT 0x7fff       /* ID for AboutBox on system menu in wm_user range */
                     21: 
1.1.1.5   root       22: #define UNMOUNT_MAX_AUTO_RETRIES 5
                     23: #define UNMOUNT_AUTO_RETRY_DELAY 50
1.1       root       24: 
1.1.1.6   root       25: #define FILE_DEFAULT_KEYFILES          "Default Keyfiles.xml"
                     26: 
1.1.1.9 ! root       27: extern char *LastDialogId;
1.1       root       28: extern char szHelpFile[TC_MAX_PATH];
1.1.1.6   root       29: extern char szHelpFile2[TC_MAX_PATH];
                     30: extern HFONT hFixedDigitFont;
1.1       root       31: extern HFONT hBoldFont;
                     32: extern HFONT hTitleFont;
                     33: extern HFONT hFixedFont;
                     34: extern HFONT hUserFont;
                     35: extern HFONT hUserUnderlineFont;
                     36: extern HFONT hUserBoldFont;
1.1.1.6   root       37: extern HWND MainDlg;
                     38: extern BOOL Silent;
1.1.1.9 ! root       39: extern BOOL bHistory;
1.1.1.6   root       40: extern BOOL bPreserveTimestamp;
                     41: extern wchar_t *lpszTitle;
1.1       root       42: extern int nCurrentOS;
                     43: extern int CurrentOSMajor;
                     44: extern int CurrentOSMinor;
1.1.1.9 ! root       45: extern BOOL RemoteSession;
1.1       root       46: extern HANDLE hDriver;
                     47: extern HINSTANCE hInst;
                     48: 
1.1.1.6   root       49: extern BOOL    KeyFilesEnable;
                     50: extern KeyFile *FirstKeyFile;
                     51: extern KeyFilesDlgParam                defaultKeyFilesParam;
                     52: 
                     53: enum 
                     54: {
                     55:        WIN_UNKNOWN = 0,
                     56:        WIN_31,
                     57:        WIN_95,
                     58:        WIN_98,
                     59:        WIN_ME,
                     60:        WIN_NT3,
                     61:        WIN_NT4,
                     62:        WIN_2000,
                     63:        WIN_XP,
                     64:        WIN_XP64_OR_2003,
                     65:        WIN_VISTA,
                     66:        WIN_AFTER_VISTA
                     67: };
1.1       root       68: 
                     69: #define ICON_HAND MB_ICONHAND
                     70: #define YES_NO MB_YESNO
                     71: 
                     72: #ifdef _UNICODE
                     73: #define WINMAIN wWinMain
                     74: #else
                     75: #define WINMAIN WinMain
                     76: #endif
                     77: 
1.1.1.6   root       78: #define FILE_CONFIGURATION     "Configuration.xml"
                     79: 
1.1       root       80: void cleanup ( void );
                     81: void LowerCaseCopy ( char *lpszDest , char *lpszSource );
                     82: void UpperCaseCopy ( char *lpszDest , char *lpszSource );
                     83: void CreateFullVolumePath ( char *lpszDiskFile , char *lpszFileName , BOOL *bDevice );
                     84: int FakeDosNameForDevice ( char *lpszDiskFile , char *lpszDosDevice , char *lpszCFDevice , BOOL bNameOnly );
                     85: int RemoveFakeDosName ( char *lpszDiskFile , char *lpszDosDevice );
1.1.1.6   root       86: void AbortProcess ( char *stringId );
1.1.1.4   root       87: void AbortProcessSilent ( void );
1.1       root       88: void *err_malloc ( size_t size );
                     89: char *err_strdup ( char *lpszText );
1.1.1.4   root       90: DWORD handleWin32Error ( HWND hwndDlg );
1.1.1.6   root       91: BOOL translateWin32Error ( wchar_t *lpszMsgBuf , int nSizeOfBuf );
1.1       root       92: BOOL WINAPI AboutDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
                     93: BOOL IsButtonChecked ( HWND hButton );
                     94: void CheckButton ( HWND hButton );
                     95: void ToSBCS ( LPWSTR lpszText );
                     96: void ToUNICODE ( char *lpszText );
                     97: void InitDialog ( HWND hwndDlg );
                     98: HDC CreateMemBitmap ( HINSTANCE hInstance , HWND hwnd , char *resource );
                     99: void PaintBitmap ( HDC pdcMem , int x , int y , int nWidth , int nHeight , HDC hDC );
1.1.1.6   root      100: LRESULT CALLBACK RedTick ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    101: BOOL RegisterRedTick ( HINSTANCE hInstance );
                    102: BOOL UnregisterRedTick ( HINSTANCE hInstance );
1.1       root      103: LRESULT CALLBACK SplashDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    104: void WaitCursor ( void );
                    105: void NormalCursor ( void );
                    106: void ArrowWaitCursor ( void );
1.1.1.6   root      107: void AddComboPair (HWND hComboBox, char *lpszItem, int value);
                    108: void AddComboPairW (HWND hComboBox, wchar_t *lpszItem, int value);
                    109: void SelectAlgo ( HWND hComboBox , int *nCipher );
1.1       root      110: LRESULT CALLBACK CustomDlgProc ( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    111: void InitApp ( HINSTANCE hInstance );
1.1.1.6   root      112: void InitHelpFileName (void);
1.1       root      113: BOOL OpenDevice ( char *lpszPath , OPEN_TEST_STRUCT *driver );
                    114: int GetAvailableFixedDisks ( HWND hComboBox , char *lpszRootPath );
                    115: int GetAvailableRemovables ( HWND hComboBox , char *lpszRootPath );
                    116: BOOL WINAPI RawDevicesDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam );
1.1.1.6   root      117: BOOL WINAPI LegalNoticesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
                    118: char * GetLegalNotices ();
1.1.1.4   root      119: BOOL WINAPI BenchmarkDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1.1.6   root      120: BOOL WINAPI KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
1.1       root      121: int DriverAttach ( void );
1.1.1.4   root      122: BOOL SeekHiddenVolHeader (HFILE dev, unsigned __int64 volSize, BOOL deviceFlag);
1.1.1.6   root      123: BOOL CALLBACK CipherTestDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam );
                    124: void ResetCipherTest ( HWND hwndDlg , int idTestCipher );
1.1.1.7   root      125: BOOL BrowseFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory, BOOL saveMode);
1.1.1.6   root      126: BOOL BrowseDirectories (HWND hWnd, char *lpszTitle, char *dirName);
1.1       root      127: void handleError ( HWND hwndDlg , int code );
1.1.1.6   root      128: void LocalizeDialog ( HWND hwnd, char *stringId );
1.1.1.4   root      129: void OpenVolumeExplorerWindow (int driveNo);
                    130: static BOOL CALLBACK CloseVolumeExplorerWindowsEnum( HWND hwnd, LPARAM driveNo);
                    131: BOOL CloseVolumeExplorerWindows (HWND hwnd, int driveNo);
                    132: BOOL CheckCapsLock (HWND hwnd, BOOL quiet);
                    133: int GetFirstAvailableDrive ();
                    134: int GetLastAvailableDrive ();
                    135: BOOL IsDriveAvailable (int driveNo);
                    136: int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced);
1.1.1.5   root      137: void BroadcastDeviceChange (WPARAM message, int nDosDriveNo, DWORD driveMap);
1.1.1.6   root      138: 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      139: BOOL UnmountVolume (HWND hwndDlg , int nDosDriveNo, BOOL forceUnmount);
                    140: BOOL IsPasswordCacheEmpty (void);
                    141: BOOL IsMountedVolume (char *volname);
                    142: BOOL IsAdmin (void);
                    143: BOOL ResolveSymbolicLink (PWSTR symLinkName, PWSTR targetName);
                    144: int GetDiskDeviceDriveLetter (PWSTR deviceName);
                    145: HANDLE DismountDrive (int driveNo);
1.1.1.5   root      146: BOOL TCCopyFile (char *sourceFileName, char *destinationFile);
1.1.1.6   root      147: int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, char *lpszVolume);
                    148: int RestoreVolumeHeader (HWND hwndDlg, char *lpszVolume);
                    149: void GetSpeedString (unsigned __int64 speed, wchar_t *str);
1.1.1.5   root      150: BOOL IsNonInstallMode ();
1.1.1.6   root      151: BOOL DriverUnload ();
                    152: LRESULT SetCheckBox (HWND hwndDlg, int dlgItem, BOOL state);
                    153: BOOL GetCheckBox (HWND hwndDlg, int dlgItem);
                    154: void CleanLastVisitedMRU (void);
                    155: LRESULT ListItemAdd (HWND list, int index, char *string);
                    156: LRESULT ListItemAddW (HWND list, int index, wchar_t *string);
                    157: LRESULT ListSubItemSet (HWND list, int index, int subIndex, char *string);
                    158: LRESULT ListSubItemSetW (HWND list, int index, int subIndex, wchar_t *string);
                    159: BOOL GetMountList (MOUNT_LIST_STRUCT *list);
                    160: int GetDriverRefCount ();
                    161: void GetSizeString (unsigned __int64 size, wchar_t *str);
                    162: char *LoadFile (char *fileName, DWORD *size);
1.1.1.9 ! root      163: char *GetAppPath (char *path, int maxSize);
1.1.1.6   root      164: char *GetConfigPath (char *fileName);
                    165: void OpenPageHelp (HWND hwndDlg, int nPage);
                    166: int Info (char *stringId);
                    167: int Warning (char *stringId);
                    168: int Error (char *stringId);
                    169: int AskYesNo (char *stringId);
                    170: int AskNoYes (char *stringId);
                    171: int AskWarnYesNo (char *stringId);
                    172: int AskWarnNoYes (char *stringId);
                    173: int AskWarnCancelOk (char *stringId);
                    174: BOOL ConfigWriteBegin ();
                    175: BOOL ConfigWriteEnd ();
                    176: BOOL ConfigWriteString (char *configKey, char *configValue);
                    177: BOOL ConfigWriteInt (char *configKey, int configValue);
                    178: int ConfigReadInt (char *configKey, int defaultValue);
                    179: char *ConfigReadString (char *configKey, char *defaultValue, char *str, int maxLen);
                    180: void RestoreDefaultKeyFilesParam (void);
                    181: BOOL LoadDefaultKeyFilesParam (void);
                    182: void Debug (char *format, ...);
                    183: void DebugMsgBox (char *format, ...);
                    184: BOOL Is64BitOs ();
                    185: char *RelativePath2Absolute (char *szFileName);
                    186: void CheckSystemAutoMount ();
                    187: BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
1.1.1.7   root      188: BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam);
1.1.1.6   root      189: BYTE *MapResource (char *resourceType, int resourceId, PDWORD size);
1.1.1.8   root      190: BOOL SelectMultipleFiles (HWND hwndDlg, char *stringId, char *lpszFileName, BOOL keepHistory);
                    191: BOOL SelectMultipleFilesNext (char *lpszFileName);
1.1.1.9 ! root      192: void OpenOnlineHelp ();

unix.superglobalmegacorp.com

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