| 1264 | |
| 1265 | |
| 1266 | inline void RegKey::SetMultiStringValue( |
| 1267 | const std::wstring& valueName, |
| 1268 | const std::vector<std::wstring>& data |
| 1269 | ) |
| 1270 | { |
| 1271 | _ASSERTE(IsValid()); |
| 1272 | |
| 1273 | // First, we have to build a double-NUL-terminated multi-string from the input data |
| 1274 | const std::vector<wchar_t> multiString = detail::BuildMultiString(data); |
| 1275 | |
| 1276 | // Total size, in bytes, of the whole multi-string structure |
| 1277 | const DWORD dataSize = static_cast<DWORD>(multiString.size() * sizeof(wchar_t)); |
| 1278 | |
| 1279 | LSTATUS retCode = ::RegSetValueExW( |
| 1280 | m_hKey, |
| 1281 | valueName.c_str(), |
| 1282 | 0, // reserved |
| 1283 | REG_MULTI_SZ, |
| 1284 | reinterpret_cast<const BYTE*>(multiString.data()), |
| 1285 | dataSize |
| 1286 | ); |
| 1287 | if (retCode != ERROR_SUCCESS) |
| 1288 | { |
| 1289 | throw RegException{ retCode, "Cannot write multi-string value: RegSetValueExW failed." }; |
| 1290 | } |
| 1291 | } |
| 1292 | |
| 1293 | |
| 1294 | inline void RegKey::SetBinaryValue(const std::wstring& valueName, const std::vector<BYTE>& data) |
nothing calls this directly
no test coverage detected