| 196 | } |
| 197 | |
| 198 | String ExpandEnvironmentVariables(const String& text) |
| 199 | { |
| 200 | tchar_t buf[512]; |
| 201 | buf[0] = 0; |
| 202 | const unsigned size = sizeof(buf) / sizeof(buf[0]); |
| 203 | const unsigned expandedSize = ::ExpandEnvironmentStrings(text.c_str(), buf, size); |
| 204 | if (expandedSize <= size) |
| 205 | return buf; |
| 206 | std::vector<tchar_t> newbuf(expandedSize); |
| 207 | ::ExpandEnvironmentStrings(text.c_str(), newbuf.data(), expandedSize); |
| 208 | return newbuf.data(); |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * @brief Load registry keys from .reg file if existing .reg file |
no test coverage detected