| 201 | } |
| 202 | |
| 203 | inline std::string wstring_to_string(const std::wstring& wstr) { |
| 204 | if (wstr.empty()) return std::string(); |
| 205 | |
| 206 | int size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), NULL, 0, NULL, NULL); |
| 207 | std::string strTo(size_needed, 0); |
| 208 | WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), &strTo[0], size_needed, NULL, NULL); |
| 209 | return strTo; |
| 210 | } |
| 211 | |
| 212 | inline std::string get_property_string(IWbemClassObject* pObj, const std::wstring& prop_name) { |
| 213 | VARIANT vtProp; |
no test coverage detected