[SHLWAPI] UrlCanonicalize URL_FILE_USE_PATHURL flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
UrlCanonicalize seems to ignore URL_FILE_USE_PATHURL flag, that should
prepend the "file://" string, at least it does that in my tests with
vc.net, passing an absolute file path.
If the path is not a valid file path, it seems to work as usual.
This seems to be more functional for urlmon, but also after that I have
some problems, seems that also UrlCreateFromPath works differently from
the original one.

HTH
-- 
Flameeyes <dgp85@users.sf.net>
Index: dlls/shlwapi/url.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/url.c,v
retrieving revision 1.22
diff -u -3 -r1.22 url.c
--- dlls/shlwapi/url.c	18 Mar 2003 19:57:00 -0000	1.22
+++ dlls/shlwapi/url.c	17 Aug 2003 19:23:45 -0000
@@ -458,7 +458,19 @@
     nByteLen = (lstrlenW(pszUrl) + 1) * sizeof(WCHAR); /* length in bytes */
     lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0, nByteLen);
 
-    if (dwFlags & URL_DONT_SIMPLIFY)
+    if (dwFlags & URL_FILE_USE_PATHURL && ( *pszUrl && pszUrl[1] == ':' && pszUrl[2] == '\\' ) )
+    {
+      pszCanonicalized[0] = 'f';
+      pszCanonicalized[1] = 'i';
+      pszCanonicalized[2] = 'l';
+      pszCanonicalized[3] = 'e';
+      pszCanonicalized[4] = ':';
+      pszCanonicalized[5] = '/';
+      pszCanonicalized[6] = '/';
+      StrCpyW(pszCanonicalized+7, pszUrl);
+      TRACE("result %s\n", debugstr_w(pszCanonicalized));
+      return S_OK;
+    } else if (dwFlags & URL_DONT_SIMPLIFY)
         memcpy(lpszUrlCpy, pszUrl, nByteLen);
     else {
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux