VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/BenchmarkDialog.h
blob: 7fd3d0110bb9b7a2ebd0cd78e914ad495cc9463e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 Derived from source code of TrueCrypt 7.1a, which is
 Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
 by the TrueCrypt License 3.0.

 Modifications and additions to the original source code (contained in this file)
 and all other portions of this file are Copyright (c) 2013-2017 IDRIX
 and are governed by the Apache License 2.0 the full text of which is
 contained in the file License.txt included in VeraCrypt binary and source
 code distribution packages.
*/

#ifndef TC_HEADER_Main_Forms_BenchmarkDialog
#define TC_HEADER_Main_Forms_BenchmarkDialog

#include "Forms.h"
#include "Main/Main.h"

namespace VeraCrypt
{
	class BenchmarkDialog : public BenchmarkDialogBase
	{
	public:
		BenchmarkDialog (wxWindow *parent);

	protected:
		enum
		{
			ColumnAlgorithm = 0,
			ColumnEncryption,
			ColumnDecryption,
			ColumnMean
		};

		struct BenchmarkResult
		{
			wstring AlgorithmName;
			uint64 EncryptionSpeed;
			uint64 DecryptionSpeed;
			uint64 MeanSpeed;
		};

		void DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer);
		void OnBenchmarkButtonClick (wxCommandEvent& event);

		class BenchmarkThreadRoutine : public WaitThreadRoutine
		{
		public:
			BenchmarkDialog* m_pDlg;
			list<BenchmarkResult>& m_results;
			Buffer& m_buffer;
			BenchmarkThreadRoutine(BenchmarkDialog* pDlg, list<BenchmarkResult>& results, Buffer& buffer)
				: m_pDlg(pDlg), m_results(results), m_buffer(buffer) { }
			virtual ~BenchmarkThreadRoutine() { }
			virtual void ExecutionCode(void) { m_pDlg->DoBenchmark (m_results, m_buffer); }
		};
	};
}

#endif // TC_HEADER_Main_Forms_BenchmarkDialog
ist; extern BOOL bEnableBkgTask; extern BOOL bCloseBkgTaskWhenNoVolumes; extern BOOL bPlaySoundOnSuccessfulHkDismount; extern BOOL bDisplayBalloonOnSuccessfulHkDismount; extern BOOL bExplore; extern BOOL bTryEmptyPasswordWhenKeyfileUsed; static void localcleanup ( void ); void EndMainDlg ( HWND hwndDlg ); void EnableDisableButtons ( HWND hwndDlg ); BOOL VolumeSelected (HWND hwndDlg ); void LoadSettings ( HWND hwndDlg ); void SaveSettings ( HWND hwndDlg ); BOOL SelectItem ( HWND hTree , wchar_t nLetter ); void LoadDriveLetters ( HWND hwndDlg, HWND hTree, int drive ); BOOL CALLBACK PasswordChangeDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam ); BOOL CALLBACK PasswordDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam ); BOOL CALLBACK MountOptionsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void BuildTree ( HWND hwndDlg, HWND hTree ); LPARAM GetSelectedLong ( HWND hTree ); LPARAM GetItemLong ( HWND hTree, int itemNo ); BOOL CALLBACK CommandHelpDlgProc ( HWND hwndDlg , UINT msg , WPARAM wParam , LPARAM lParam ); BOOL CALLBACK MainDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam ); void ExtractCommandLine ( HWND hwndDlg , wchar_t *lpszCommandLine ); static void WipeCache (HWND hwndDlg, BOOL silent); void OpenVolumeExplorerWindow (int driveNo); BOOL TaskBarIconAdd (HWND hwnd); BOOL TaskBarIconRemove (HWND hwnd); BOOL TaskBarIconChange (HWND hwnd, int iconId); void DismountIdleVolumes (); static void SaveDefaultKeyFilesParam (HWND hwnd); static BOOL Dismount (HWND hwndDlg, int nDosDriveNo); static BOOL DismountAll (HWND hwndDlg, BOOL forceUnmount, BOOL interact, int dismountMaxRetries, int dismountAutoRetryDelay); static void KeyfileDefaultsDlg (HWND hwndDlg); static void HandleHotKey (HWND hwndDlg, WPARAM wParam); static BOOL CheckMountList (HWND hwndDlg, BOOL bForceTaskBarUpdate); int GetCipherBlockSizeByDriveNo (int nDosDriveNo); int GetModeOfOperationByDriveNo (int nDosDriveNo); void ChangeMainWindowVisibility (); BOOL WholeSysDriveEncryption (BOOL bSilent); BOOL CheckSysEncMountWithoutPBA (HWND hwndDlg, const wchar_t *devicePath, BOOL quiet); BOOL TCBootLoaderOnInactiveSysEncDrive (wchar_t *szDevicePath); void CreateRescueDisk (HWND hwndDlg); int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, const wchar_t *lpszVolume); int RestoreVolumeHeader (HWND hwndDlg, const wchar_t *lpszVolume); void SecurityTokenPreferencesDialog (HWND hwndDlg); static BOOL CALLBACK PerformanceSettingsDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void MountSelectedVolume (HWND hwndDlg, BOOL mountWithOptions); uint32 ReadDriverConfigurationFlags (); void HookMouseWheel (HWND hwndDlg, UINT ctrlId); static BOOL HandleDriveListMouseWheelEvent (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL bListMustBePointed); static BOOL CALLBACK DefaultMountParametersDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); #ifdef __cplusplus } typedef struct { BOOL systemFavorites; BOOL logOnMount; BOOL hotKeyMount; VeraCrypt::FavoriteVolume* favoriteVolumeToMount; } mountFavoriteVolumeThreadParam; void SetDriverConfigurationFlag (uint32 flag, BOOL state); BOOL MountFavoriteVolumes (HWND hwnd, BOOL systemFavorites = FALSE, BOOL logOnMount = FALSE, BOOL hotKeyMount = FALSE, const VeraCrypt::FavoriteVolume &favoriteVolumeToMount = VeraCrypt::FavoriteVolume()); void __cdecl mountFavoriteVolumeThreadFunction (void *pArg); #endif