mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-13 16:36:37 +00:00
This commit is contained in:
@@ -40,7 +40,7 @@ func (s *ScheduleService) Connect() error {
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
if err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED|ole.COINIT_DISABLE_OLE1DDE); err != nil {
|
||||
if err := ole.CoInitializeEx(0, ole.COINIT_APARTMENTTHREADED|ole.COINIT_DISABLE_OLE1DDE); err != nil {
|
||||
var oleCode *ole.OleError
|
||||
if errors.As(err, &oleCode) && oleCode.Code() != ole.S_OK && oleCode.Code() != 0x00000001 {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user