VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
AgeCommit message (Expand)AuthorFilesLines
2015-05-26Windows: first implementation of dynamic modeMounir IDRASSI6-108/+153
2015-05-26Windows: solve 64-bit compilation warnings after checking that they are harml...Mounir IDRASSI2-28/+28
2015-05-22Windows: Modifications to build 64-bit versions of VeraCrypt.exe & "VeraCrypt...Mounir IDRASSI1-6/+280
2015-05-17Windows: First implementation of non-system volumes decryption.Mounir IDRASSI6-70/+1029
2015-05-06Windows: Solve detection issue when resuming encryption. Add separate logic f...Mounir IDRASSI2-18/+64
2015-05-04Windows: When resuming in-place encryption, add manual selection of partition...Mounir IDRASSI1-18/+42
2015-05-03Windows: Make the Format wizard work again when launched from VeraCrypt menu.Mounir IDRASSI1-1/+10
2015-05-03Windows: enable showing/hiding password for system encryption in Windows UI a...Mounir IDRASSI1-1/+0
2015-05-03Windows: Modify custom window class names to less generic value in order to a...Mounir IDRASSI1-1/+1
2015-04-27Windows: Better command line handling to make it more strict and robust. This...Mounir IDRASSI1-25/+18
2015-04-06Increment VeraCrypt version to 1.0f-2Mounir IDRASSI1-4/+4
2015-04-06Windows vulnerability fix: CryptAcquireContext vulnerability fix. Add checks ...Mounir IDRASSI1-1/+9
2015-02-22Windows: check password length for outer volume during hidden volume creation...Mounir IDRASSI1-3/+2
2015-02-09Static Code Analysis: Avoid over-flaw in arithmetic operations by adding more...Mounir IDRASSI2-7/+19
2015-02-08Windows: retry UAC prompt operation in case of failure. This avoids cancel th...Mounir IDRASSI1-7/+11
2015-01-04Increment version to 1.0f-1 and update language files and PDF with informatio...Mounir IDRASSI1-4/+4
2015-01-03Windows: change cascade encryption naming format to reflex mathematical compo...Mounir IDRASSI1-3/+3
2014-12-31Increment version to 1.0f and update language XML files with new fields.Mounir IDRASSI1-4/+4
2014-12-28Windows: support loading TrueCrypt volumes. Implement converting TrueCrypt vo...Mounir IDRASSI2-3/+3
2014-12-28Windows: use the selected hash algorithm when resuming interrupted process. T...Mounir IDRASSI1-2/+1
2014-12-27Windows: use the correct window handle for creating message boxes. This becam...Mounir IDRASSI4-221/+223
2014-12-20Increment version to 1.0f-BETA3 and update language XML files with new fields.Mounir IDRASSI1-4/+4
2014-12-20Windows: Add missing PRF selection combobox in password page of Format progra...Mounir IDRASSI1-5/+7
2014-12-16Windows: Enhance performance by implementing the possibility to choose the co...Mounir IDRASSI4-22/+46
2014-12-16Windows: Enable Visual Styles for a modern look-and-feelMounir IDRASSI1-0/+12
2014-11-08Display only allowed hashes when encrypting the system partition (now, SHA-25...Mounir IDRASSI1-14/+25
2014-11-08Increment version to 1.0e for the next releaseMounir IDRASSI1-4/+4
2014-11-08Windows vulnerability fix: correct possible BSOD attack targeted towards GetW...Mounir IDRASSI1-1/+9
2014-11-08Correctly handle dialogs from previous versions that used 'TRUE' instead of '...Mounir IDRASSI1-1/+2
2014-11-08Add option in select the number of passes for volume header over-writing. By ...Mounir IDRASSI1-5/+6
2014-11-08Lower number of times we overwrite volume header during the encryption of a p...Mounir IDRASSI1-4/+4
2014-11-08Static Code Analysis : Generalize the use of Safe String functions. Add some ...Mounir IDRASSI2-109/+113
2014-11-08Static Code Analysis : fix usage of strncpy and sscanf.Mounir IDRASSI1-1/+1
2014-11-08Static Code Analysis : fix various memory leaks.Mounir IDRASSI1-3/+6
2014-11-08Static Code Analysis : Add virtual attribute to destructor of classes that ha...Mounir IDRASSI1-1/+1
2014-11-08Change namespace from TrueCrypt to VeraCrypt. Rename method from Resources Re...Mounir IDRASSI3-3/+3
2014-11-08Replace 'TRUE' by 'VERA' in some GUI constants and commentsMounir IDRASSI1-1/+1
2014-11-08Increment VeraCrypt version to 1.0dVeraCrypt_1.0dMounir IDRASSI1-4/+4
2014-11-08Increment VeraCrypt version to 1.0cVeraCrypt_1.0cMounir IDRASSI1-4/+4
2014-11-08Increment VeraCrypt version to 1.0bVeraCrypt_1.0bMounir IDRASSI1-4/+4
2014-11-08Concert bitmaps to supported formatMounir IDRASSI1-0/+0
2014-11-08Modifications to remove all TrueCrypt references in names. generate new GUIDs...Mounir IDRASSI6-28/+28
2014-11-08Modify all graphicsMounir IDRASSI1-0/+0
2014-11-08Rename wizard bitmap fileMounir IDRASSI1-0/+0
2014-11-08Add original TrueCrypt 7.1a sourcesMounir IDRASSI12-0/+12699
pan> #include "FormatCom_i.c" using namespace VeraCrypt; static volatile LONG ObjectCount = 0; class TrueCryptFormatCom : public ITrueCryptFormatCom { public: TrueCryptFormatCom (DWORD messageThreadId) : RefCount (0), MessageThreadId (messageThreadId), CallBack (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); } virtual int STDMETHODCALLTYPE AnalyzeHiddenVolumeHost ( LONG_PTR 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); } 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 ReadEfiConfig (BSTR* pContent, DWORD *pcbRead) { return BaseCom::ReadEfiConfig (pContent, pcbRead); } virtual DWORD STDMETHODCALLTYPE WriteEfiBootSectorUserConfig (DWORD userConfig, BSTR customUserMessage, int pim, int hashAlg) { return BaseCom::WriteEfiBootSectorUserConfig (userConfig, customUserMessage,pim, hashAlg); } 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; CoInitialize (NULL); if (ComGetInstance (hWnd, &tc)) r = tc->FormatNtfs (driveNo, clusterSize); else r = 0; CoUninitialize (); return r; } extern "C" int UacFormatFs (HWND hWnd, int driveNo, int clusterSize, int fsType) { CComPtr<ITrueCryptFormatCom> tc; int r; CoInitialize (NULL); if (ComGetInstance (hWnd, &tc)) r = tc->FormatFs (driveNo, clusterSize, fsType); else r = 0; CoUninitialize (); return r; } extern "C" int UacAnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSize, int *realClusterSize, __int64 *nbrFreeClusters) { CComPtr<ITrueCryptFormatCom> tc; int r; CoInitialize (NULL); if (ComGetInstance (hwndDlg, &tc)) r = tc->AnalyzeHiddenVolumeHost ((LONG_PTR) hwndDlg, driveNo, hiddenVolHostSize, realClusterSize, nbrFreeClusters); else r = 0; CoUninitialize (); return r; }