]>
git.proxmox.com Git - ceph.git/blob - ceph/src/tools/rbd_wnbd/wnbd_wmi.h
2 * Ceph - scalable distributed file system
4 * Copyright (c) 2019 SUSE LLC
5 * Copyright (C) 2022 Cloudbase Solutions
7 * This is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License version 2.1, as published by the Free Software
10 * Foundation. See file COPYING.
23 #include "common/ceph_mutex.h"
25 // Convenience helper for initializing and cleaning up the
26 // Windows COM library using "COINIT_MULTITHREADED" concurrency mode.
27 // Any WMI objects (including connections, event subscriptions, etc)
28 // must be released before the COM library gets closed.
32 bool initialized
= false;
34 ceph::mutex init_lock
= ceph::make_mutex("COMBootstrapper::InitLocker");
51 IWbemLocator
* wbem_loc
;
52 IWbemServices
* wbem_svc
;
54 WmiConnection(std::wstring ns
)
69 HRESULT
get_property_str(
70 IWbemClassObject
* cls_obj
,
71 const std::wstring
& property
,
73 HRESULT
get_property_int(
74 IWbemClassObject
* cls_obj
,
75 const std::wstring
& property
,
84 IEnumWbemClassObject
*event_enum
;
87 WmiSubscription(std::wstring ns
, std::wstring query
)
89 , conn(WmiConnection(ns
))
101 // IEnumWbemClassObject::Next wrapper
105 IWbemClassObject
**objects
,
109 WmiSubscription
subscribe_wnbd_adapter_events(uint32_t interval
);