Changes in dlls/urlmon/umon.c

Carlos clozano at andago.com
Sun Oct 13 07:34:43 CDT 2002


Hello,

When you try to install ie5 or ie6 using the ieXsetup.exe,
it doesn't show the list of download sites. It is 
because the function URLMonikerImpl_BindToStorage in
urlmon library is calling to 4 W functions from wininet
what are not implemented. It is possible see the list of
download sites if you use urlmon native, even when
the wininet used is builtin. Probably it means that the
original urlmon (saw the list of imported functions in
original urlmon and it doesn't import from wininet) is 
not using wininet functions. This patch change the 4 W 
functions calls to A functions what it needs. So it is
possible see the list of download sites and start to
install ie5/ie6 using only builtin code, anyway it stops 
later :(

Carlos.

Changelog:
 * dlls/urlmon/umon.c
   Changed some calls from W to A type.

-- 
____________________________________________________
     ___   _____  _   ____
    / __// _   // /  / o)    clozano
   / /_ / /_/ // /_ /  \  @andago.com
  /___//_/ /_//___//__)
____________________________________________________

-------------- next part --------------
Index: dlls/urlmon/umon.c
===================================================================
RCS file: /home/wine/wine/dlls/urlmon/umon.c,v
retrieving revision 1.16
diff -u -r1.16 umon.c
--- dlls/urlmon/umon.c	2 Oct 2002 01:24:27 -0000	1.16
+++ dlls/urlmon/umon.c	13 Oct 2002 12:20:02 -0000
@@ -443,12 +443,13 @@
 	    bindf = 0;
 	    hres = IBindStatusCallback_GetBindInfo(pbscb, &bindf, &bi);
 	    if(SUCCEEDED(hres)) {
-		URL_COMPONENTSW url;
-		WCHAR *host, *path;
+		URL_COMPONENTSA url;
+		CHAR *host, *path;
 		DWORD len, lensz = sizeof(len), total_read = 0;
 		LARGE_INTEGER last_read_pos;
 		FORMATETC fmt;
 		STGMEDIUM stg;
+		CHAR URLNameA[INTERNET_MAX_URL_LENGTH+1];
 
 		TRACE("got bindinfo. bindf = %08lx extrainfo = %s bindinfof = %08lx bindverb = %08lx iid %s\n",
 		      bindf, debugstr_w(bi.szExtraInfo), bi.grfBindInfoF, bi.dwBindVerb, debugstr_guid(&bi.iid));
@@ -469,30 +470,34 @@
 		memset(&url, 0, sizeof(url));
 		url.dwStructSize = sizeof(url);
 		url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = 1;
-		InternetCrackUrlW(This->URLName, 0, 0, &url);
-		host = HeapAlloc(GetProcessHeap(), 0, (url.dwHostNameLength + 1) * sizeof(WCHAR));
-		memcpy(host, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR));
+		WideCharToMultiByte( CP_ACP, 0, This->URLName, strlenW(This->URLName),
+			URLNameA,strlenW(This->URLName), NULL, NULL );
+		URLNameA[strlenW(This->URLName)] = 0;
+
+		InternetCrackUrlA(URLNameA, 0, 0, &url);
+		host = HeapAlloc(GetProcessHeap(), 0, (url.dwHostNameLength + 1));
+		memcpy(host, url.lpszHostName, url.dwHostNameLength);
 		host[url.dwHostNameLength] = '\0';
-		path = HeapAlloc(GetProcessHeap(), 0, (url.dwUrlPathLength + 1) * sizeof(WCHAR));
-		memcpy(path, url.lpszUrlPath, url.dwUrlPathLength * sizeof(WCHAR));
+		path = HeapAlloc(GetProcessHeap(), 0, (url.dwUrlPathLength + 1));
+		memcpy(path, url.lpszUrlPath, url.dwUrlPathLength);
 		path[url.dwUrlPathLength] = '\0';
 
 		This->hinternet = InternetOpenA("User Agent", 0, NULL, NULL, 0 /*INTERNET_FLAG_ASYNC*/);
 /*		InternetSetStatusCallback(This->hinternet, URLMON_InternetCallback);*/
 
-		This->hconnect = InternetConnectW(This->hinternet, host, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL,
+		This->hconnect = InternetConnectA(This->hinternet, host, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL,
 					    INTERNET_SERVICE_HTTP, 0, (DWORD)This);
-		This->hrequest = HttpOpenRequestW(This->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD)This);
+		This->hrequest = HttpOpenRequestA(This->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD)This);
 
 		hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, 0x22, NULL);
 		hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_FINDINGRESOURCE, NULL);
 		hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_CONNECTING, NULL);
 		hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_SENDINGREQUEST, NULL);
 		hres = E_OUTOFMEMORY; /* FIXME */
-		if(HttpSendRequestW(This->hrequest, NULL, 0, NULL, 0)) {
+		if(HttpSendRequestA(This->hrequest, NULL, 0, NULL, 0)) {
 
 		    len = 0;
-		    HttpQueryInfoW(This->hrequest, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &len, &lensz, NULL);
+		    HttpQueryInfoA(This->hrequest, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &len, &lensz, NULL);
 
 		    TRACE("res = %ld gle = %08lx url len = %ld\n", hres, GetLastError(), len);
 


More information about the wine-patches mailing list