VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Dlgcode.h')
-rw-r--r--src/Common/Dlgcode.h100
1 files changed, 99 insertions, 1 deletions
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 54475cb..e4b2198 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -124,6 +124,7 @@ extern BOOL bHideWaitingDialog;
extern BOOL bCmdHideWaitingDialog;
extern BOOL bCmdHideWaitingDialogValid;
extern BOOL bUseSecureDesktop;
+extern BOOL bSecureDesktopOngoing;
extern BOOL bUseLegacyMaxPasswordLength;
extern BOOL bCmdUseSecureDesktop;
extern BOOL bCmdUseSecureDesktopValid;
@@ -164,6 +165,10 @@ extern BOOL MountVolumesAsSystemFavorite;
extern BOOL FavoriteMountOnArrivalInProgress;
extern BOOL MultipleMountOperationInProgress;
+extern volatile BOOL NeedPeriodicDeviceListUpdate;
+extern BOOL DisablePeriodicDeviceListUpdate;
+extern BOOL EnableMemoryProtection;
+
#ifndef SETUP
extern BOOL bLanguageSetInSetup;
#endif
@@ -237,6 +242,13 @@ typedef struct
} OpenVolumeContext;
+typedef enum BitLockerEncryptionStatus
+{
+ BL_Status_Unknown = 0,
+ BL_Status_Unprotected,
+ BL_Status_Protected
+} BitLockerEncryptionStatus;
+
#define DEFAULT_VOL_CREATION_WIZARD_MODE WIZARD_MODE_FILE_CONTAINER
@@ -307,6 +319,7 @@ BOOL InstanceHasAppSetupMutex (void);
void CloseAppSetupMutex (void);
BOOL IsTrueCryptInstallerRunning (void);
uint32 ReadDriverConfigurationFlags ();
+uint32 ReadServiceConfigurationFlags ();
uint32 ReadEncryptionThreadPoolFreeCpuCountLimit ();
BOOL LoadSysEncSettings ();
int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm);
@@ -347,6 +360,7 @@ BOOL CloseVolumeExplorerWindows (HWND hwnd, int driveNo);
BOOL UpdateDriveCustomLabel (int driveNo, wchar_t* effectiveLabel, BOOL bSetValue);
BOOL CheckCapsLock (HWND hwnd, BOOL quiet);
BOOL CheckFileExtension (wchar_t *fileName);
+BOOL IsTrueCryptFileExtension (wchar_t *fileName);
void CorrectFileName (wchar_t* fileName);
void CorrectURL (wchar_t* fileName);
void IncreaseWrongPwdRetryCount (int count);
@@ -469,7 +483,7 @@ BOOL CALLBACK CloseTCWindowsEnum( HWND hwnd, LPARAM lParam);
BOOL CALLBACK FindTCWindowEnum (HWND hwnd, LPARAM lParam);
BYTE *MapResource (wchar_t *resourceType, int resourceId, PDWORD size);
void InconsistencyResolved (char *msg);
-void ReportUnexpectedState (char *techInfo);
+void ReportUnexpectedState (const char *techInfo);
BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileName, size_t cbFileName, BOOL keepHistory);
BOOL SelectMultipleFilesNext (wchar_t *lpszFileName, size_t cbFileName);
void OpenOnlineHelp ();
@@ -505,7 +519,9 @@ BOOL InitSecurityTokenLibrary (HWND hwndDlg);
BOOL FileHasReadOnlyAttribute (const wchar_t *path);
BOOL IsFileOnReadOnlyFilesystem (const wchar_t *path);
void CheckFilesystem (HWND hwndDlg, int driveNo, BOOL fixErrors);
+BOOL BufferContainsPattern (const byte *buffer, size_t bufferSize, const byte *pattern, size_t patternSize);
BOOL BufferContainsString (const byte *buffer, size_t bufferSize, const char *str);
+BOOL BufferContainsWideString (const byte *buffer, size_t bufferSize, const wchar_t *str);
int AskNonSysInPlaceEncryptionResume (HWND hwndDlg, BOOL* pbDecrypt);
BOOL RemoveDeviceWriteProtection (HWND hwndDlg, wchar_t *devicePath);
void EnableElevatedCursorChange (HWND parent);
@@ -539,6 +555,8 @@ void GetInstallationPath (HWND hwndDlg, wchar_t* szInstallPath, DWORD cchSize, B
BOOL GetSetupconfigLocation (wchar_t* path, DWORD cchSize);
BOOL BufferHasPattern (const unsigned char* buffer, size_t bufferLen, const void* pattern, size_t patternLen);
BOOL EnableProcessProtection();
+void SafeOpenURL (LPCWSTR szUrl);
+BitLockerEncryptionStatus GetBitLockerEncryptionStatus(WCHAR driveLetter);
#ifdef _WIN64
void GetAppRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed);
#endif
@@ -592,6 +610,30 @@ struct HostDevice
~HostDevice () {}
+ HostDevice& operator= (const HostDevice& device)
+ {
+ if (this != &device)
+ {
+ Bootable = device.Bootable;
+ ContainsSystem = device.ContainsSystem;
+ DynamicVolume = device.DynamicVolume;
+ Floppy = device.Floppy;
+ IsPartition = device.IsPartition;
+ IsVirtualPartition = device.IsVirtualPartition;
+ HasUnencryptedFilesystem = device.HasUnencryptedFilesystem;
+ MountPoint = device.MountPoint;
+ Name = device.Name;
+ Path = device.Path;
+ Removable = device.Removable;
+ Size = device.Size;
+ SystemNumber = device.SystemNumber;
+ HasVolumeIDs = device.HasVolumeIDs;
+ Partitions = device.Partitions;
+ memcpy (VolumeIDs, device.VolumeIDs, sizeof (VolumeIDs));
+ }
+ return *this;
+ }
+
bool Bootable;
bool ContainsSystem;
bool DynamicVolume;
@@ -650,6 +692,62 @@ typedef void (CALLBACK* WaitThreadProc)(void* pArg, HWND hWaitDlg);
void BringToForeground(HWND hWnd);
void ShowWaitDialog(HWND hwnd, BOOL bUseHwndAsParent, WaitThreadProc callback, void* pArg);
+// classes used to implement support for password drag-n-drop from KeePass Password Safe
+// Implementation based the following source code with many modifications to fix isses and add features
+// URL: https://www.codeguru.com/cpp/misc/misc/draganddrop/article.php/c349/Drag-And-Drop-between-Window-Controls.htm
+
+interface GenericDropTarget : public IDropTarget
+{
+public:
+ GenericDropTarget(CLIPFORMAT* pFormats, size_t count);
+ ~GenericDropTarget();
+
+ // basic IUnknown stuff
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);
+ ULONG STDMETHODCALLTYPE AddRef(void);
+ ULONG STDMETHODCALLTYPE Release(void);
+
+ HRESULT STDMETHODCALLTYPE DragEnter(struct IDataObject *,unsigned long,struct _POINTL,unsigned long *);
+ HRESULT STDMETHODCALLTYPE DragOver(unsigned long,struct _POINTL,unsigned long *);
+ HRESULT STDMETHODCALLTYPE DragLeave(void);
+ HRESULT STDMETHODCALLTYPE Drop(struct IDataObject *,unsigned long,struct _POINTL,unsigned long *);
+
+ // called by parents
+ BOOL Register(HWND hWnd);
+ void Revoke();
+
+ // call parent we have goodies
+ virtual void GotDrop(CLIPFORMAT format);
+ virtual DWORD GotDrag(void);
+ virtual void GotLeave(void);
+ virtual DWORD GotEnter(void);
+public:
+ BYTE *m_Data;
+
+ POINT m_DropPoint;
+
+ DWORD m_KeyState;
+
+protected:
+ HWND m_DropTargetWnd;
+ std::vector<CLIPFORMAT> m_SupportedFormat;
+ volatile LONG m_dwRefCount;
+};
+
+class PasswordEditDropTarget : public GenericDropTarget
+{
+public:
+ PasswordEditDropTarget();
+
+ // called by child we have drop
+ void GotDrop(CLIPFORMAT format);
+ DWORD GotDrag(void);
+ void GotLeave(void);
+ DWORD GotEnter(void);
+};
+
+BOOL GetHibernateStatus (BOOL& bHibernateEnabled, BOOL& bHiberbootEnabled);
+
#endif // __cplusplus
#endif // TC_HEADER_DLGCODE