Piotr Caban : urlmon: Fix map_url_to_zone implementation.
Alexandre Julliard
julliard at winehq.org
Tue Feb 9 10:37:55 CST 2010
Module: wine
Branch: master
Commit: 7d3693549f2d503993a180d7c0355577e3da67c0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7d3693549f2d503993a180d7c0355577e3da67c0
Author: Piotr Caban <piotr at codeweavers.com>
Date: Tue Feb 9 01:07:46 2010 +0100
urlmon: Fix map_url_to_zone implementation.
---
dlls/urlmon/sec_mgr.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index c242274..3216333 100644
--- a/dlls/urlmon/sec_mgr.c
+++ b/dlls/urlmon/sec_mgr.c
@@ -147,12 +147,18 @@ static HRESULT map_url_to_zone(LPCWSTR url, DWORD *zone, LPWSTR *ret_url)
DWORD size=0;
HRESULT hres;
- secur_url = heap_alloc(INTERNET_MAX_URL_LENGTH*sizeof(WCHAR));
*zone = -1;
- hres = CoInternetParseUrl(url, PARSE_SECURITY_URL, 0, secur_url, INTERNET_MAX_URL_LENGTH, &size, 0);
- if(hres != S_OK)
- strcpyW(secur_url, url);
+ hres = CoInternetGetSecurityUrl(url, &secur_url, PSU_SECURITY_URL_ONLY, 0);
+ if(hres != S_OK) {
+ size = strlenW(url)*sizeof(WCHAR);
+
+ secur_url = heap_alloc(size);
+ if(!secur_url)
+ return E_OUTOFMEMORY;
+
+ memcpy(secur_url, url, size);
+ }
hres = CoInternetParseUrl(secur_url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(WCHAR), &size, 0);
if(FAILED(hres) || !*schema) {
More information about the wine-cvs
mailing list