VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Keyfiles.h
blob: 78a8fd53e0279aad6730701538a7deb1e3e1c8fa (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
/*
 Copyright (c) 2005 TrueCrypt Developers Association. All rights reserved.

 Governed by the TrueCrypt License 3.0 the full text of which is contained in
 the file License.txt included in TrueCrypt binary and source code distribution
 packages.
*/

#ifndef KEYFILES_H
#define	KEYFILES_H

#ifdef __cplusplus
extern "C" {
#endif

#include "Common.h"

#define KEYFILE_POOL_SIZE	64
#define	KEYFILE_MAX_READ_LEN	(1024*1024)

typedef struct KeyFileStruct
{
	char FileName[MAX_PATH];
	struct KeyFileStruct *Next;
} KeyFile;

typedef struct
{
	BOOL EnableKeyFiles;
	KeyFile *FirstKeyFile;
} KeyFilesDlgParam;

KeyFile *KeyFileAdd (KeyFile *firstKeyFile, KeyFile *keyFile);
void KeyFileRemoveAll (KeyFile **firstKeyFile);
KeyFile *KeyFileClone (KeyFile *keyFile);
KeyFile *KeyFileCloneAll (KeyFile *firstKeyFile);
BOOL KeyFilesApply (Password *password, KeyFile *firstKeyFile);

BOOL CALLBACK KeyFilesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
BOOL KeyfilesPopupMenu (HWND hwndDlg, POINT popupPosition, KeyFilesDlgParam *dialogParam);

extern BOOL HiddenFilesPresentInKeyfilePath;

#ifdef __cplusplus
}
#endif

#endif	/* #ifndef KEYFILES_H */ 
static void SaveSettings ( HWND hwndDlg ); static void EndMainDlg ( HWND hwndDlg ); void ComboSelChangeEA ( HWND hwndDlg ); static void VerifySizeAndUpdate ( HWND hwndDlg , BOOL bUpdate ); static void __cdecl sysEncDriveAnalysisThread (void *hwndDlgArg); static void __cdecl volTransformThreadFunction ( void *hwndDlg ); static void LoadPage ( HWND hwndDlg , int nPageNo ); __int64 PrintFreeSpace ( HWND hwndTextBox , char *lpszDrive , PLARGE_INTEGER lDiskFree ); void DisplaySizingErrorText ( HWND hwndTextBox ); void EnableDisableFileNext ( HWND hComboBox , HWND hMainButton ); BOOL QueryFreeSpace ( HWND hwndDlg , HWND hwndTextBox , BOOL display ); static BOOL FinalPreTransformPrompts (void); void UpdateLastDialogId (void); void HandleOldAssignedDriveLetter (void); void AddCipher ( HWND hComboBox , char *lpszCipher , int nCipher ); BOOL CALLBACK PageDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam ); BOOL CALLBACK MainDialogProc ( HWND hwndDlg , UINT uMsg , WPARAM wParam , LPARAM lParam ); void ExtractCommandLine ( HWND hwndDlg , char *lpszCommandLine ); void DisplayRandPool (HWND hwndDlg, HWND hPoolDisplay, BOOL bShow); void DisplayPortionsOfKeys (HWND headerKeyHandle, HWND masterKeyHandle, char *headerKeyStr, char *masterKeyStr, BOOL hideKeys); int DetermineMaxHiddenVolSize (HWND hwndDlg); BOOL IsSparseFile (HWND hwndDlg); BOOL GetFileVolSize (HWND hwndDlg, unsigned __int64 *size); BOOL SwitchWizardToSysEncMode (void); void SwitchWizardToFileContainerMode (void); static BOOL ResolveUnknownSysEncDirection (void); static BOOL WipeHiddenOSCreationConfig (void); static void AfterWMInitTasks (HWND hwndDlg); static void AfterSysEncProgressWMInitTasks (HWND hwndDlg); static void InitSysEncProgressBar (void); static void InitNonSysInplaceEncProgressBar (void); static void UpdateNonSysInplaceEncProgressBar (void); static BOOL SysEncInEffect (void); static BOOL CreatingHiddenSysVol(void); static void NonSysInplaceEncPause (void); static void NonSysInplaceEncResume (void); void ShowNonSysInPlaceEncUIStatus (void); void UpdateNonSysInPlaceEncControls (void); int MountHiddenVolHost ( HWND hwndDlg, char *volumePath, int *driveNo, Password *password, int pkcs5_prf, int pim, BOOL bReadOnly ); int AnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSize, int *realClusterSize, __int64 *pnbrFreeClusters); int ScanVolClusterBitmap ( HWND hwndDlg, int *driveNo, __int64 nbrClusters, __int64 *nbrFreeClusters); static void WipeStart (void); static void WipeAbort (void); static void UpdateWipeProgressBar (void); static void InitWipeProgressBar (void); static void UpdateWipeControls (void); static DWORD GetFormatSectorSize (); extern BOOL showKeys; extern volatile HWND hMasterKey; extern volatile HWND hHeaderKey; extern volatile BOOL bHiddenVolHost; extern volatile BOOL bHiddenVolDirect; extern BOOL bRemovableHostDevice; extern BOOL bWarnDeviceFormatAdvanced; extern HWND hCurPage; extern HWND hProgressBar; extern volatile BOOL bVolTransformThreadCancel; extern volatile BOOL bInPlaceEncNonSysResumed; extern volatile BOOL bFirstNonSysInPlaceEncResumeDone; extern volatile BOOL bInPlaceEncNonSys; extern volatile BOOL bInPlaceDecNonSys; extern __int64 NonSysInplaceEncBytesDone; extern __int64 NonSysInplaceEncTotalSize; extern int nPbar; extern volatile int WizardMode; extern volatile BOOL bInPlaceEncNonSysResumed; extern char HeaderKeyGUIView [KEY_GUI_VIEW_SIZE]; extern char MasterKeyGUIView [KEY_GUI_VIEW_SIZE]; extern volatile int NonSysInplaceEncStatus; #ifdef __cplusplus } #endif