From f15b0e2745a4a70f7adfab08ec48b42075287ed1 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 25 Apr 2017 00:52:33 +0200 Subject: [PATCH] COM initialization replaced by auto-initializer --- MSICA/MSICA.cpp | 3 +-- MSICA/stdafx.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MSICA/MSICA.cpp b/MSICA/MSICA.cpp index 3bce013..f5402b3 100644 --- a/MSICA/MSICA.cpp +++ b/MSICA/MSICA.cpp @@ -87,7 +87,7 @@ UINT MSICA_API MSICAInitialize(MSIHANDLE hInstall) //::MessageBox(NULL, _T(__FUNCTION__), _T("MSICA"), MB_OK); UINT uiResult; - BOOL bIsCoInitialized = SUCCEEDED(::CoInitialize(NULL)); + winstd::com_initializer com_init(NULL); MSICA::COpList olInstallCertificates, olRemoveCertificates, olInstallWLANProfiles, olRemoveWLANProfiles, @@ -584,7 +584,6 @@ UINT MSICA_API MSICAInitialize(MSIHANDLE hInstall) ::MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecordProg); } - if (bIsCoInitialized) ::CoUninitialize(); return uiResult; } diff --git a/MSICA/stdafx.h b/MSICA/stdafx.h index 7aef926..dc8eb41 100644 --- a/MSICA/stdafx.h +++ b/MSICA/stdafx.h @@ -23,6 +23,8 @@ #define MSICA_DLL // This library is compiled as a DLL #endif +#include + #include #include