VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/GraphicUserInterface.cpp
AgeCommit message (Expand)AuthorFilesLines
2023-06-29EMV keyfile support: Overall code improvements and bug fixesMounir IDRASSI1-9/+9
2023-06-28Add EMV functionality (#1080)mmauv1-7/+20
2023-05-19wxWidget assert failure bug (#999)Es1-1/+8
2021-09-04Minor cleanup of the repo (#822)a13460541-0/+0
2021-08-21Fix typo in GraphicUserInterface.cppMounir IDRASSI1-1/+1
2021-08-16Add compile-time toggleable support for application indicators, off by defaul...Unit 1931-0/+4
2020-12-11new xml Tag for en and de (#708)T-Bonhagen1-10/+11
2020-06-11Switch from auto_ptr to unique_ptr (#638)Christopher Bergqvist1-5/+5
2019-10-06Linux/FreeBSD: change location of documentation from /usr/share/veracrypt/doc...Mounir IDRASSI1-1/+1
2018-08-10Linux/MacOSX/FreeBSD: When performing backup of volume header, automatically ...Mounir IDRASSI1-1/+36
2018-04-29MacOSX: support pasting values to password fields using keyboard (CMD+V and C...Mounir IDRASSI1-0/+42
2018-04-05FreeBSD/Linux/OSX: replace some remaining TrueCrypt.tc file extension in the ...Mounir IDRASSI1-1/+1
2018-01-21Fix wxWidgets assertion failed when backing up/restoring volume header (close...gv54701-2/+2
2017-12-08MacOSX: fix issue that prevented some local help files from opening in the br...Mounir IDRASSI1-2/+6
2017-12-06Linux/MacOSX: Avoid OS leaking previously used directory if user choose not t...Mounir IDRASSI1-2/+12
2017-06-23Update IDRIX copyright yearMounir IDRASSI1-1/+1
2017-06-05Linux/MacOSX: cleaner code for handling of missing local HTML documentation.Mounir IDRASSI1-7/+8
2017-06-05Linux/MacOSX: Replace User Guide PDF with local HTML documentation. Replace U...Mounir IDRASSI1-48/+49
2017-05-15Replace Codeplex links by ones on veracrypt.frMounir IDRASSI1-31/+43
2016-12-30Update donation link to point to page indicating all accepted donations options.Mounir IDRASSI1-1/+1
2016-10-17Linux/MacOSX: correctly display Kuznyechik help page when link clicked. Remov...Mounir IDRASSI1-5/+1
2016-08-15Linux/MacOSX: Add help text for GOST89 and KuznyechikMounir IDRASSI1-6/+14
2016-06-02Crypto: Add support for Japanese encryption standard Camellia, including for ...Mounir IDRASSI1-0/+4
2016-05-29Linux/MacOSX: Implement passing smart card PIN as command line argument (--to...Mounir IDRASSI1-0/+15
2016-05-13Linux: Fix gcc-6 compilation errors.Mounir IDRASSI1-1/+1
2016-05-10Remove trailing whitespaceDavid Foerster1-65/+65
2016-01-25Linux/MacOSX: remove unecessary XML resource string replacement of %hs, not n...Mounir IDRASSI1-2/+0
2016-01-20Copyright: update dates to include 2016.Mounir IDRASSI1-1/+1
2015-08-06Update license information to reflect the use of a dual license Apache 2.0 an...Mounir IDRASSI1-5/+9
2015-07-11Linux: Solve compilation warning (unused variables, pointer cast)Mounir IDRASSI1-3/+0
2015-06-24Linux: if a keyfile is specified in the command line without a password, don'...Mounir IDRASSI1-1/+1
2015-06-24Linux/MacOSX: restore normal file mode to some source filesMounir IDRASSI1-0/+0
2015-06-24Linux/MacOSX: first dynamic mode implementationMounir IDRASSI1-6/+10
2015-04-06MacOSX: Correctly handle OSX dock "reopen-application" event and Cocoa openFi...Mounir IDRASSI1-3/+13
2015-02-08Linux: solve rare issue where VeraCrypt wrongly reports that another instance...Mounir IDRASSI1-3/+21
2014-12-30Linux/MacOSX: code refactoring and cleanup.Mounir IDRASSI1-27/+24
2014-12-30Linux/MacOSX: Implement TrueCrypt conversion and loading support. Correct man...Mounir IDRASSI1-21/+57
2014-12-26Linux/MacOSX: Implement waiting dialog for lengthy operations in order to hav...Mounir IDRASSI1-8/+49
2014-12-20Linux/MacOSX: remove calls to non existent class VolumeLayoutV1HiddenMounir IDRASSI1-1/+1
2014-12-20Reduce time for reporting wrong password by removing support for legacy hidde...Mounir IDRASSI1-2/+2
2014-12-19Linux/MacOSX: Enhance performance by implementing the possibility to choose t...Mounir IDRASSI1-1/+5
2014-12-11Linux/macOSX: always display random gathering dialog/interface before perform...Mounir IDRASSI1-0/+7
2014-12-04Linux/macOSX: handle project URLs using the new valuesMounir IDRASSI1-38/+107
2014-11-08Linux: remove workaround for wxFileType::GetOpenCommand bug in handling path ...Mounir IDRASSI1-5/+0
2014-11-08Remove remaining legacy cryptographic algorithms that are never used by VeraC...Mounir IDRASSI1-1/+0
2014-11-08Change namespace from TrueCrypt to VeraCrypt. Rename method from Resources Re...Mounir IDRASSI1-1/+1
2014-11-08Point to the SourceForge website instead of idrix.fr for the application link...Mounir IDRASSI1-2/+2
2014-11-08wxWidgets 3.0 compatibility modificationsMounir IDRASSI1-3/+3
2014-11-08Replace TrueCrypt references in added sources and resources by VeraCrypt ones.Mounir IDRASSI1-5/+5
2014-11-08Add TrueCrypt 7.1a MacOSX/Linux specific source files.Mounir IDRASSI1-0/+1690
NULL) { InterlockedIncrement (&ObjectCount); } virtual ~TrueCryptFormatCom () { if (InterlockedDecrement (&ObjectCount) == 0) PostThreadMessage (MessageThreadId, WM_APP, 0, 0); } virtual ULONG STDMETHODCALLTYPE AddRef () { return InterlockedIncrement (&RefCount); } virtual ULONG STDMETHODCALLTYPE Release () { if (!InterlockedDecrement (&RefCount)) { delete this; return 0; } return RefCount; } virtual HRESULT STDMETHODCALLTYPE QueryInterface (REFIID riid, void **ppvObject) { if (riid == IID_IUnknown || riid == IID_ITrueCryptFormatCom) *ppvObject = this; else { *ppvObject = NULL; return E_NOINTERFACE; } AddRef (); return S_OK; } virtual DWORD STDMETHODCALLTYPE CallDriver (DWORD ioctl, BSTR input, BSTR *output) { return BaseCom::CallDriver (ioctl, input, output); } virtual DWORD STDMETHODCALLTYPE CopyFile (BSTR sourceFile, BSTR destinationFile) { return BaseCom::CopyFile (sourceFile, destinationFile); } virtual DWORD STDMETHODCALLTYPE DeleteFile (BSTR file) { return BaseCom::DeleteFile (file); } virtual BOOL STDMETHODCALLTYPE FormatNtfs (int driveNo, int clusterSize) { return ::FormatNtfs (driveNo, clusterSize, TRUE); } virtual int STDMETHODCALLTYPE AnalyzeHiddenVolumeHost ( __int64 hwndDlg, int *driveNo, __int64 hiddenVolHostSize, int *realClusterSize, __int64 *nbrFreeClusters) { return ::AnalyzeHiddenVolumeHost ( (HWND) hwndDlg, driveNo, hiddenVolHostSize, realClusterSize, nbrFreeClusters); } virtual DWORD STDMETHODCALLTYPE ReadWriteFile (BOOL write, BOOL device, BSTR filePath, BSTR *bufferBstr, unsigned __int64 offset, unsigned __int32 size, DWORD *sizeDone) { return BaseCom::ReadWriteFile (write, device, filePath, bufferBstr, offset, size, sizeDone); } virtual DWORD STDMETHODCALLTYPE RegisterFilterDriver (BOOL registerDriver, int filterType) { return BaseCom::RegisterFilterDriver (registerDriver, filterType); } virtual DWORD STDMETHODCALLTYPE RegisterSystemFavoritesService (BOOL registerService) { return BaseCom::RegisterSystemFavoritesService (registerService); } virtual DWORD STDMETHODCALLTYPE SetDriverServiceStartType (DWORD startType) { return BaseCom::SetDriverServiceStartType (startType); } virtual BOOL STDMETHODCALLTYPE IsPagingFileActive (BOOL checkNonWindowsPartitionsOnly) { return BaseCom::IsPagingFileActive (checkNonWindowsPartitionsOnly); } virtual DWORD STDMETHODCALLTYPE WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName, DWORD value) { return BaseCom::WriteLocalMachineRegistryDwordValue (keyPath, valueName, value); } virtual BOOL STDMETHODCALLTYPE FormatFs (int driveNo, int clusterSize, int fsType) { return ::FormatFs (driveNo, clusterSize, fsType, TRUE); } virtual DWORD STDMETHODCALLTYPE GetFileSize (BSTR filePath, unsigned __int64 *pSize) { return BaseCom::GetFileSize (filePath, pSize); } virtual DWORD STDMETHODCALLTYPE DeviceIoControl (BOOL readOnly, BOOL device, BSTR filePath, DWORD dwIoControlCode, BSTR input, BSTR *output) { return BaseCom::DeviceIoControl (readOnly, device, filePath, dwIoControlCode, input, output); } virtual DWORD STDMETHODCALLTYPE InstallEfiBootLoader (BOOL preserveUserConfig, BOOL hiddenOSCreation, int pim, int hashAlg) { return BaseCom::InstallEfiBootLoader (preserveUserConfig, hiddenOSCreation, pim, hashAlg); } virtual DWORD STDMETHODCALLTYPE BackupEfiSystemLoader () { return BaseCom::BackupEfiSystemLoader (); } virtual DWORD STDMETHODCALLTYPE RestoreEfiSystemLoader () { return BaseCom::RestoreEfiSystemLoader (); } virtual DWORD STDMETHODCALLTYPE GetEfiBootDeviceNumber (BSTR* pSdn) { return BaseCom::GetEfiBootDeviceNumber (pSdn); } virtual DWORD STDMETHODCALLTYPE GetSecureBootConfig (BOOL* pSecureBootEnabled, BOOL *pVeraCryptKeysLoaded) { return BaseCom::GetSecureBootConfig (pSecureBootEnabled, pVeraCryptKeysLoaded); } virtual DWORD STDMETHODCALLTYPE WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg) { return BaseCom::WriteEfiBootSectorUserConfig (userConfig, customUserMessage,pim, hashAlg); } virtual DWORD STDMETHODCALLTYPE UpdateSetupConfigFile (BOOL bForInstall) { return BaseCom::UpdateSetupConfigFile (bForInstall); } virtual DWORD STDMETHODCALLTYPE NotifyService (DWORD dwNotifyCode) { return BaseCom::NotifyService (dwNotifyCode); } virtual DWORD STDMETHODCALLTYPE FastFileResize (BSTR filePath, __int64 fileSize) { return BaseCom::FastFileResize (filePath, fileSize); } protected: DWORD MessageThreadId; LONG RefCount; ITrueCryptFormatCom *CallBack; }; extern "C" BOOL ComServerFormat () { SetProcessShutdownParameters (0x100, 0); TrueCryptFactory<TrueCryptFormatCom> factory (GetCurrentThreadId ()); DWORD cookie; if (IsUacSupported ()) UacElevated = TRUE; if (CoRegisterClassObject (CLSID_TrueCryptFormatCom, (LPUNKNOWN) &factory, CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE, &cookie) != S_OK) return FALSE; MSG msg; while (int r = GetMessageW (&msg, NULL, 0, 0)) { if (r == -1) return FALSE; TranslateMessage (&msg); DispatchMessageW (&msg); if (msg.message == WM_APP && ObjectCount < 1 && !factory.IsServerLocked ()) break; } CoRevokeClassObject (cookie); return TRUE; } static BOOL ComGetInstance (HWND hWnd, ITrueCryptFormatCom **tcServer) { return ComGetInstanceBase (hWnd, CLSID_TrueCryptFormatCom, IID_ITrueCryptFormatCom, (void **) tcServer); } ITrueCryptFormatCom *GetElevatedInstance (HWND parent) { ITrueCryptFormatCom *instance; if (!ComGetInstance (parent, &instance)) throw UserAbort (SRC_POS); return instance; } extern "C" int UacFormatNtfs (HWND hWnd, int driveNo, int clusterSize) { CComPtr<ITrueCryptFormatCom> tc; int r; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); if (ComGetInstance (hWnd, &tc)) r = tc->FormatNtfs (driveNo, clusterSize); else r = (int) GetLastError(); CoUninitialize (); return r; } extern "C" int UacFormatFs (HWND hWnd, int driveNo, int clusterSize, int fsType) { CComPtr<ITrueCryptFormatCom> tc; int r; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); if (ComGetInstance (hWnd, &tc)) r = tc->FormatFs (driveNo, clusterSize, fsType); else r = (int) GetLastError(); CoUninitialize (); return r; } extern "C" int UacAnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSize, int *realClusterSize, __int64 *nbrFreeClusters) { CComPtr<ITrueCryptFormatCom> tc; int r; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); if (ComGetInstance (hwndDlg, &tc)) r = tc->AnalyzeHiddenVolumeHost ((__int64) hwndDlg, driveNo, hiddenVolHostSize, realClusterSize, nbrFreeClusters); else r = 0; CoUninitialize (); return r; } extern "C" BOOL UacWriteLocalMachineRegistryDword (HWND hwndDlg, wchar_t *keyPath, wchar_t *valueName, DWORD value) { CComPtr<ITrueCryptFormatCom> tc; int r = 0; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); if (ComGetInstance (hwndDlg, &tc)) { CComBSTR keyPathBstr, valueNameBstr; BSTR bstr = W2BSTR(keyPath); if (bstr) { keyPathBstr.Attach (bstr); bstr = W2BSTR(valueName); if (bstr) { valueNameBstr.Attach (bstr); r = tc->WriteLocalMachineRegistryDwordValue (keyPathBstr, valueNameBstr, value); } else r = ERROR_OUTOFMEMORY; } else r = ERROR_OUTOFMEMORY; } CoUninitialize (); if (r == ERROR_SUCCESS) return TRUE; else { SetLastError (r); return FALSE; } } extern "C" DWORD UacFastFileCreation (HWND hWnd, wchar_t* filePath, __int64 fileSize) { CComPtr<ITrueCryptFormatCom> tc; DWORD r; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); if (ComGetInstance (hWnd, &tc)) { CComBSTR filePathBstr; BSTR bstr = W2BSTR(filePath); if (bstr) { filePathBstr.Attach (bstr); r = tc->FastFileResize (filePathBstr, fileSize); } else r = ERROR_OUTOFMEMORY; } else r = GetLastError(); CoUninitialize (); return r; }