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 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/Format/FormatCom.cpp') 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) { -- cgit v1.2.3