From dcb8390bb250780a4b8bb5fd8f91bc8e53e711bc Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 26 Jan 2016 23:22:59 +0100 Subject: Windows/Linux: Implement exFAT support. --- src/Format/FormatCom.cpp | 22 ++++++++++++++++++++++ src/Format/FormatCom.h | 1 + src/Format/FormatCom.idl | 3 ++- src/Format/Tcformat.c | Bin 634106 -> 636272 bytes 4 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src/Format') diff --git a/src/Format/FormatCom.cpp b/src/Format/FormatCom.cpp index d52b21df..2dd5fa79 100644 --- a/src/Format/FormatCom.cpp +++ b/src/Format/FormatCom.cpp @@ -132,6 +132,11 @@ public: return BaseCom::WriteLocalMachineRegistryDwordValue (keyPath, valueName, value); } + virtual BOOL STDMETHODCALLTYPE FormatFs (int driveNo, int clusterSize, int fsType) + { + return ::FormatFs (driveNo, clusterSize, fsType); + } + protected: DWORD MessageThreadId; LONG RefCount; @@ -207,6 +212,23 @@ extern "C" int UacFormatNtfs (HWND hWnd, int driveNo, int clusterSize) return r; } +extern "C" int UacFormatFs (HWND hWnd, int driveNo, int clusterSize, int fsType) +{ + CComPtr 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) { diff --git a/src/Format/FormatCom.h b/src/Format/FormatCom.h index 4ae0c3af..e79cd9cc 100644 --- a/src/Format/FormatCom.h +++ b/src/Format/FormatCom.h @@ -25,6 +25,7 @@ extern "C" { BOOL ComServerFormat (); int UacFormatNtfs (HWND hWnd, int driveNo, int clusterSize); +int UacFormatFs (HWND hWnd, int driveNo, int clusterSize, int fsType); int UacAnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 hiddenVolHostSize, int *realClusterSize, __int64 *nbrFreeClusters); int UacFormatVolume (char *cvolumePath , BOOL bDevice , unsigned __int64 size , unsigned __int64 hiddenVolHostSize , Password *password , int cipher , int pkcs5 , BOOL quickFormat, BOOL sparseFileSwitch, int fileSystem , int clusterSize, HWND hwndDlg , BOOL hiddenVol , int *realClusterSize); BOOL UacUpdateProgressBar (__int64 nSecNo, BOOL *bVolTransformThreadCancel); diff --git a/src/Format/FormatCom.idl b/src/Format/FormatCom.idl index 39805cf9..5579d28d 100644 --- a/src/Format/FormatCom.idl +++ b/src/Format/FormatCom.idl @@ -16,7 +16,7 @@ import "..\Common\Password.h"; [ uuid(56327DDA-F1A7-4e13-B128-520D129BDEF6), helpstring("VeraCrypt Format UAC Support Library"), - version(2.4) // Update ComSetup.cpp when changing version number + version(2.5) // Update ComSetup.cpp when changing version number ] library TrueCryptFormatCom { @@ -39,6 +39,7 @@ library TrueCryptFormatCom DWORD RegisterSystemFavoritesService (BOOL registerService); DWORD SetDriverServiceStartType (DWORD startType); DWORD WriteLocalMachineRegistryDwordValue (BSTR keyPath, BSTR valueName, DWORD value); + BOOL FormatFs (int driveNo, int clusterSize, int fsType); }; [ diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 2df69aeb..a159ca73 100644 Binary files a/src/Format/Tcformat.c and b/src/Format/Tcformat.c differ -- cgit v1.2.3