MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / GetDeviceRegistryPropertyMultiString

Method GetDeviceRegistryPropertyMultiString

WinSysCore/DeviceManager.cpp:107–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107std::vector<std::wstring> WinSys::DeviceManager::GetDeviceRegistryPropertyMultiString(const DeviceInfo& di, DeviceRegistryPropertyType type) {
108 std::vector<std::wstring> result;
109 WCHAR buffer[1 << 12];
110 DWORD regType;
111 auto ok = ::SetupDiGetDeviceRegistryProperty(_hInfoSet.get(), (PSP_DEVINFO_DATA)&di.Data,
112 static_cast<DWORD>(type), &regType, (BYTE*)buffer, sizeof(buffer), nullptr);
113 if (!ok)
114 return result;
115
116 assert(regType == REG_MULTI_SZ);
117 for (auto p = buffer; *p;) {
118 result.push_back(p);
119 p += ::wcslen(p) + 1;
120 }
121 return result;
122}
123
124std::wstring WinSys::DeviceManager::GetDeviceClassRegistryPropertyString(const GUID* guid, DeviceClassRegistryPropertyType type) {
125 DWORD regType;

Callers 1

GetDevicePropertyMethod · 0.80

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected