shlwapi patch

Andreas Mohr a.mohr at mailto.de
Thu May 24 12:10:47 CDT 2001


Hi all,

in an effort to debug and/or improve ICQ 2000b,
I decided to improve support for shlwapi.

- add stubs SHLWAPI_294, UrlApplySchemeW
- correct SHLWAPI_151 parameters
- implemented StrTrimA

Now ICQ 2000b works slightly better (not really usable, though, it seems).

Andreas Mohr
-------------- next part --------------
Determining best CVS host...
Using CVSROOT :pserver:cvs at rhlx01.fht-esslingen.de:/home/wine
Index: dlls/shlwapi/ordinal.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/ordinal.c,v
retrieving revision 1.12
diff -u -r1.12 ordinal.c
--- dlls/shlwapi/ordinal.c	2001/02/13 20:17:59	1.12
+++ dlls/shlwapi/ordinal.c	2001/05/24 15:07:05
@@ -187,10 +187,12 @@
 
 /*************************************************************************
  *      SHLWAPI_151	[SHLWAPI.151]
+ *
+ *      pStr "HTTP/1.1", dw1 0x5
  */
-DWORD WINAPI SHLWAPI_151(void)
+DWORD WINAPI SHLWAPI_151(LPSTR pStr, LPVOID ptr, DWORD dw1)
 {
-  FIXME(": stub\n");
+  FIXME("('%s', %p, %08lx): stub\n", pStr, ptr, dw1);
   return 0;
 }
 
@@ -213,9 +215,9 @@
 /*************************************************************************
  *      SHLWAPI_153	[SHLWAPI.153]
  */
-DWORD WINAPI SHLWAPI_153(DWORD dw1, DWORD dw2, DWORD dw3)
+DWORD WINAPI SHLWAPI_153(LPSTR str1, LPSTR str2, DWORD dw3)
 {
-    FIXME("%08lx %08lx %08lx - stub\n", dw1, dw2, dw3);
+    FIXME("'%s' '%s' %08lx - stub\n", str1, str2, dw3);
     return 0;
 }
 
@@ -456,10 +458,10 @@
 HRESULT WINAPI SHLWAPI_219 (
 	LPVOID w, /* [???] NOTE: returned by LocalAlloc, 0x450 bytes, iface */
 	LPVOID x,
-	REFIID riid,
+	REFIID riid, /* e.g. IWebBrowser2 */
 	LPWSTR z) /* [???] NOTE: OUT: path */
 {
-	FIXME("(%p %p %s %p)stub\n",w,x,debugstr_guid(riid),z);
+	FIXME("(%p %s %s %p)stub\n",w,debugstr_a(x),debugstr_guid(riid),z);
 	return 0xabba1252;
 }
 
@@ -639,6 +641,30 @@
 }
 
 /*************************************************************************
+ *      SHLWAPI_294	[SHLWAPI.294]
+ */
+BOOL WINAPI SHLWAPI_294(LPSTR str1, LPSTR str2, LPSTR pStr, DWORD some_len,  LPCSTR lpStr2)
+{
+    /*
+     * str1:		"I"	"I"	pushl esp+0x20
+     * str2:		"U"	"I"	pushl 0x77c93810
+     * (is "I" and "U" "integer" and "unsigned" ??)
+     *
+     * pStr:		""	""	pushl eax
+     * some_len:	0x824	0x104	pushl 0x824
+     * lpStr2:		"%l"	"%l"	pushl esp+0xc
+     *
+     * shlwapi. StrCpyNW(lpStr2, irrelevant_var, 0x104);
+     * LocalAlloc(0x00, some_len) -> irrelevant_var
+     * LocalAlloc(0x40, irrelevant_len) -> pStr
+     * shlwapi.294(str1, str2, pStr, some_len, lpStr2);
+     * shlwapi.PathRemoveBlanksW(pStr);
+     */
+    ERR("('%s', '%s', '%s', %08lx, '%s'): stub!\n", str1, str2, pStr, some_len, lpStr2);
+    return TRUE;
+}
+
+/*************************************************************************
  *      SHLWAPI_313	[SHLWAPI.313]
  *
  * Late bound call to shell32.SHGetFileInfoW
@@ -991,7 +1017,7 @@
  *      SHLWAPI_437	[SHLWAPI.437]
  *
  * NOTES
- *  In the real shlwapi, One time initilisation calls GetVersionEx and reads
+ *  In the real shlwapi, One time initialisation calls GetVersionEx and reads
  *  the registry to determine what O/S & Service Pack level is running, and
  *  therefore which functions are available. Currently we always run as NT,
  *  since this means that we don't need extra code to emulate Unicode calls,
Index: dlls/shlwapi/shlwapi.spec
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/shlwapi.spec,v
retrieving revision 1.15
diff -u -r1.15 shlwapi.spec
--- dlls/shlwapi/shlwapi.spec	2001/04/25 19:51:56	1.15
+++ dlls/shlwapi/shlwapi.spec	2001/05/24 15:07:06
@@ -160,7 +160,7 @@
 148 forward @ user32.VkKeyScanW
 149 forward @ user32.WinHelpW
 150 forward @ user32.wvsprintfW
-151 stdcall @() SHLWAPI_151
+151 stdcall @(str ptr long) SHLWAPI_151
 152 stdcall @(wstr wstr long) SHLWAPI_152
 153 stdcall @(long long long) SHLWAPI_153
 154 stub @
@@ -303,7 +303,7 @@
 291 stub @
 292 stub @
 293 stub @
-294 stub @
+294 stdcall @(long long long long long) SHLWAPI_294
 295 stub @
 296 stub @
 297 stub @
@@ -659,10 +659,10 @@
 @ stdcall StrToIntExA(str long ptr) StrToIntExA
 @ stdcall StrToIntExW(wstr long ptr) StrToIntExW
 @ stdcall StrToIntW(wstr)StrToIntW
-@ stub    StrTrimA
+@ stdcall StrTrimA(str str) StrTrimA
 @ stub    StrTrimW
 @ stub    UrlApplySchemeA
-@ stub    UrlApplySchemeW
+@ stdcall UrlApplySchemeW(str ptr ptr long) UrlApplySchemeW
 @ stdcall UrlCanonicalizeA(str ptr ptr long) UrlCanonicalizeA
 @ stdcall UrlCanonicalizeW(wstr ptr ptr long) UrlCanonicalizeW
 @ stub    UrlCombineA
Index: dlls/shlwapi/string.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/string.c,v
retrieving revision 1.10
diff -u -r1.10 string.c
--- dlls/shlwapi/string.c	2001/04/25 19:51:56	1.10
+++ dlls/shlwapi/string.c	2001/05/24 15:07:06
@@ -504,6 +504,31 @@
 }
 
 /*************************************************************************
+ *      StrTrimA	[SHLWAPI]
+ */
+BOOL WINAPI StrTrimA(LPSTR pszSource, LPCSTR pszTrimChars)
+{
+    BOOL trimmed = FALSE;
+    LPSTR pSrc;
+    LPCSTR pTrim;
+
+    TRACE("('%s', '%s');\n", pszSource, pszTrimChars);
+    for (pTrim = pszTrimChars; *pTrim; pTrim++)
+    {
+	 for (pSrc = pszSource; *pSrc; pSrc++)
+	     if (*pSrc == *pTrim)
+	     {
+		 /* match -> remove this char.
+		  * strlen(pSrc) equiv. to the correct strlen(pSrc+1)+1 */
+		 memmove(pSrc, pSrc+1, strlen(pSrc));
+		 trimmed = TRUE;
+	     }
+    }
+    TRACE("<- '%s'\n", pszSource);
+    return trimmed;
+}
+
+/*************************************************************************
  *      wnsprintfA	[SHLWAPI]
  */
 int WINAPIV wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...)
Index: dlls/shlwapi/url.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/url.c,v
retrieving revision 1.3
diff -u -r1.3 url.c
--- dlls/shlwapi/url.c	2001/02/13 20:17:59	1.3
+++ dlls/shlwapi/url.c	2001/05/24 15:07:06
@@ -8,6 +8,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
+#include "wine/unicode.h"
 #include "shlwapi.h"
 #include "debugtools.h"
 
@@ -358,5 +359,17 @@
 
   HashData(pszUrl, strlen(pszUrl), lpDest, nDestLen);
   return NOERROR;
+}
+
+/*************************************************************************
+ *      UrlApplySchemeW	[SHLWAPI]
+ */
+HRESULT WINAPI UrlApplySchemeW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, DWORD dwFlags)
+{
+    HRESULT err = NOERROR;
+    FIXME("(%s %p %p %08lx): stub !\n", debugstr_w(pszIn), pszOut, pcchOut, dwFlags);
+    strcpyW(pszOut, pszIn);
+    *pcchOut = (err != E_POINTER) ? strlenW(pszOut) : 0;
+  return err;
 }
 


More information about the wine-patches mailing list