ole32: Cope with double quotes in paths for libraries to be loaded from the registry.

This commit is contained in:
Rob Shearman 2009-11-29 20:38:28 +00:00 committed by Alexandre Julliard
parent f3560ece31
commit 510ed24f9a
2 changed files with 11 additions and 1 deletions

View File

@ -828,6 +828,16 @@ static DWORD COM_RegReadPath(HKEY hkeyroot, const WCHAR *keyname, const WCHAR *v
if (keytype == REG_EXPAND_SZ) { if (keytype == REG_EXPAND_SZ) {
if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) ret = ERROR_MORE_DATA; if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) ret = ERROR_MORE_DATA;
} else { } else {
const WCHAR *quote_start;
quote_start = strchrW(src, '\"');
if (quote_start) {
const WCHAR *quote_end = strchrW(quote_start + 1, '\"');
if (quote_end) {
memmove(src, quote_start + 1,
(quote_end - quote_start - 1) * sizeof(WCHAR));
src[quote_end - quote_start - 1] = '\0';
}
}
lstrcpynW(dst, src, dstlen); lstrcpynW(dst, src, dstlen);
} }
} }

View File

@ -2293,7 +2293,7 @@ static void reg_unreg_wine_test_class(BOOL Register)
{ {
error = RegCreateKeyEx(HKEY_CLASSES_ROOT, buffer, 0, NULL, 0, KEY_SET_VALUE, NULL, &hkey, &dwDisposition); error = RegCreateKeyEx(HKEY_CLASSES_ROOT, buffer, 0, NULL, 0, KEY_SET_VALUE, NULL, &hkey, &dwDisposition);
ok(error == ERROR_SUCCESS, "RegCreateKeyEx failed with error %d\n", error); ok(error == ERROR_SUCCESS, "RegCreateKeyEx failed with error %d\n", error);
error = RegSetValueEx(hkey, NULL, 0, REG_SZ, (const unsigned char *)"ole32.dll", strlen("ole32.dll") + 1); error = RegSetValueEx(hkey, NULL, 0, REG_SZ, (const unsigned char *)"\"ole32.dll\" \"a\"", strlen("\"ole32.dll\" \"a\"") + 1);
ok(error == ERROR_SUCCESS, "RegSetValueEx failed with error %d\n", error); ok(error == ERROR_SUCCESS, "RegSetValueEx failed with error %d\n", error);
RegCloseKey(hkey); RegCloseKey(hkey);
} }