From 51bde4fb0cbe91f2b6a3237c24f0e09e0b6f4f9d Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Mon, 2 Dec 2024 15:47:59 -0500 Subject: [PATCH] Switch from CoInitialize to CoInitializeEx --- ee/watchdog/controller_windows.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ee/watchdog/controller_windows.go b/ee/watchdog/controller_windows.go index f318ef393..3c04129c2 100644 --- a/ee/watchdog/controller_windows.go +++ b/ee/watchdog/controller_windows.go @@ -228,9 +228,9 @@ func installWatchdogTask(identifier, configFilePath string) error { } taskName := launcher.TaskName(identifier, watchdogTaskType) - // init COM - we discard the error returned by CoInitialize because it + // init COM - we discard the error returned by CoInitializeEx because it // harmlessly returns S_FALSE if we call it more than once - ole.CoInitialize(0) + ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) defer ole.CoUninitialize() // create our scheduler object @@ -504,9 +504,9 @@ func RemoveWatchdogTask(identifier string) error { } taskName := launcher.TaskName(identifier, watchdogTaskType) - // init COM - we discard the error returned by CoInitialize because it + // init COM - we discard the error returned by CoInitializeEx because it // harmlessly returns S_FALSE if we call it more than once - ole.CoInitialize(0) + ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) defer ole.CoUninitialize() // create our scheduler object @@ -555,9 +555,9 @@ func watchdogTaskExists(identifier string) (bool, error) { } taskName := launcher.TaskName(identifier, watchdogTaskType) - // init COM - we discard the error returned by CoInitialize because it + // init COM - we discard the error returned by CoInitializeEx because it // harmlessly returns S_FALSE if we call it more than once - ole.CoInitialize(0) + ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) defer ole.CoUninitialize() // create our scheduler object