+ case REG_MULTI_SZ:
+ {
+ PCWSTR separator = L" "; // To match regedit
+ int sepChars = wcslen(separator);
+ int strings = 0;
+ int stringChars = 0;
+
+ PCWSTR strData = (PCWSTR)td;
+ while (*strData)
+ {
+ int l = wcslen(strData);
+ stringChars += l;
+ strData += l + 1; // Skips null-terminator
+ strings++;
+ }
+
+ int cch = stringChars + (strings - 1) * sepChars + 1;
+
+ PWSTR strValue = (PWSTR)CoTaskMemAlloc(cch * sizeof(WCHAR));
+
+ strValue[0] = 0;
+
+ strData = (PCWSTR)td;
+ while (*strData)
+ {
+ StrCatW(strValue, strData);
+ strData += wcslen(strData) + 1;
+ if (*strData)
+ StrCatW(strValue, separator);
+ }
+
+ *strContents = strValue;
+ return S_OK;
+ }