Skip to content

Commit

Permalink
Switch from CoInitialize to CoInitializeEx
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Dec 2, 2024
1 parent d794621 commit 51bde4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ee/watchdog/controller_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 51bde4f

Please sign in to comment.