On Thu, 2007-05-10 at 12:13 +0200, Alexandre Julliard wrote:
Misha Koshelev <mk144210(a)bcm.edu> writes:
+ case VT_BSTR: /* Return value of specified key if it exists */ + if (ret == ERROR_SUCCESS) + { + ret = RegQueryValueExW(hkey, V_BSTR(&varg2), NULL, NULL, NULL, &dwSize); + if (ret == ERROR_SUCCESS) + { + szString = msi_alloc(dwSize); + if (szString) + { + LPWSTR szNewString = NULL; + DWORD dwType, dwNewSize = 0; + int idx; + + ret = RegQueryValueExW(hkey, V_BSTR(&varg2), NULL, &dwType, (LPBYTE)szString, &dwSize); + switch (dwType) + { + /* Registry strings may not be null terminated */ + case REG_MULTI_SZ: + idx = (dwSize/sizeof(WCHAR))-1; + while (idx >= 0 && !szString[idx]) idx--; + for (; idx >= 0; idx--) + if (!szString[idx]) szString[idx] = '\n'; [...]
This stuff clearly needs to be split out into a few helper functions.
Just sent a new one, mainly with one additional helper function and some if/else condensation. Please let me know if you believe I need to make more helpers. Thank you. Misha