VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/FormatCom.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2023-09-11 00:03:28 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2023-09-11 00:03:28 +0200
commitd2f2defca9eac0d7f779296bf52f36b161fc6b31 (patch)
tree37146ca9339171563af3916e5d571c55e8812f42 /src/Format/FormatCom.cpp
parentaa311a6fad13357772c6e3c85a4bfe393df9382e (diff)
downloadVeraCrypt-d2f2defca9eac0d7f779296bf52f36b161fc6b31.tar.gz
VeraCrypt-d2f2defca9eac0d7f779296bf52f36b161fc6b31.zip
Windows: replace CoInitialize calls with CoInitializeEx
Diffstat (limited to 'src/Format/FormatCom.cpp')
-rw-r--r--src/Format/FormatCom.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Format/FormatCom.cpp b/src/Format/FormatCom.cpp
index d696f00f..90333f23 100644
--- a/src/Format/FormatCom.cpp
+++ b/src/Format/FormatCom.cpp
@@ -255,7 +255,7 @@ extern "C" int UacFormatNtfs (HWND hWnd, int driveNo, int clusterSize)
CComPtr<ITrueCryptFormatCom> tc;
int r;
- CoInitialize (NULL);
+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if (ComGetInstance (hWnd, &tc))
r = tc->FormatNtfs (driveNo, clusterSize);
@@ -272,7 +272,7 @@ extern "C" int UacFormatFs (HWND hWnd, int driveNo, int clusterSize, int fsType)
CComPtr<ITrueCryptFormatCom> tc;
int r;
- CoInitialize (NULL);
+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if (ComGetInstance (hWnd, &tc))
r = tc->FormatFs (driveNo, clusterSize, fsType);
@@ -290,7 +290,7 @@ extern "C" int UacAnalyzeHiddenVolumeHost (HWND hwndDlg, int *driveNo, __int64 h
CComPtr<ITrueCryptFormatCom> tc;
int r;
- CoInitialize (NULL);
+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if (ComGetInstance (hwndDlg, &tc))
r = tc->AnalyzeHiddenVolumeHost ((__int64) hwndDlg, driveNo, hiddenVolHostSize, realClusterSize, nbrFreeClusters);
@@ -307,7 +307,7 @@ extern "C" BOOL UacWriteLocalMachineRegistryDword (HWND hwndDlg, wchar_t *keyPat
CComPtr<ITrueCryptFormatCom> tc;
int r = 0;
- CoInitialize (NULL);
+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if (ComGetInstance (hwndDlg, &tc))
{
@@ -345,7 +345,7 @@ extern "C" DWORD UacFastFileCreation (HWND hWnd, wchar_t* filePath, __int64 file
CComPtr<ITrueCryptFormatCom> tc;
DWORD r;
- CoInitialize (NULL);
+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if (ComGetInstance (hWnd, &tc))
{