From d2f2defca9eac0d7f779296bf52f36b161fc6b31 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 11 Sep 2023 00:03:28 +0200 Subject: Windows: replace CoInitialize calls with CoInitializeEx --- src/Format/FormatCom.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Format') 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 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 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 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 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 tc; DWORD r; - CoInitialize (NULL); + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); if (ComGetInstance (hWnd, &tc)) { -- cgit v1.2.3