1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #ifndef BASE_WIN_WMI_H_
- #define BASE_WIN_WMI_H_
- #include <wbemidl.h>
- #include <wrl/client.h>
- #include "base/base_export.h"
- #include "base/strings/string_piece.h"
- namespace base {
- namespace win {
- BASE_EXPORT bool CreateLocalWmiConnection(
- bool set_blanket,
- Microsoft::WRL::ComPtr<IWbemServices>* wmi_services);
- BASE_EXPORT bool CreateWmiClassMethodObject(
- IWbemServices* wmi_services,
- WStringPiece class_name,
- WStringPiece method_name,
- Microsoft::WRL::ComPtr<IWbemClassObject>* class_instance);
- BASE_EXPORT bool WmiLaunchProcess(const std::wstring& command_line,
- int* process_id);
- class BASE_EXPORT WmiComputerSystemInfo {
- public:
- static WmiComputerSystemInfo Get();
- const std::wstring& manufacturer() const { return manufacturer_; }
- const std::wstring& model() const { return model_; }
- const std::wstring& serial_number() const { return serial_number_; }
- private:
- void PopulateModelAndManufacturer(
- const Microsoft::WRL::ComPtr<IWbemServices>& services);
- void PopulateSerialNumber(
- const Microsoft::WRL::ComPtr<IWbemServices>& services);
- std::wstring manufacturer_;
- std::wstring model_;
- std::wstring serial_number_;
- };
- }
- }
- #endif
|