Module: wine Branch: master Commit: 510ed24f9acfa28975d559f6b022721d44b7aea9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=510ed24f9acfa28975d559f6b0...
Author: Rob Shearman robertshearman@gmail.com Date: Sun Nov 29 20:38:28 2009 +0000
ole32: Cope with double quotes in paths for libraries to be loaded from the registry.
---
dlls/ole32/compobj.c | 10 ++++++++++ dlls/ole32/tests/marshal.c | 2 +- 2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 321f2e9..58e8f0d 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -828,6 +828,16 @@ static DWORD COM_RegReadPath(HKEY hkeyroot, const WCHAR *keyname, const WCHAR *v if (keytype == REG_EXPAND_SZ) { if (dstlen <= ExpandEnvironmentStringsW(src, dst, dstlen)) ret = ERROR_MORE_DATA; } 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); } } diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index b4a2384..1ef9790 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -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); 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); RegCloseKey(hkey); }