[PATCH] Added 2 functions to shell32

Gianluigi Tiesi sherpya at netfarm.it
Sun Feb 27 05:32:47 CST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

One is implemented the other is a stub, I've added it to shell32 of reactos, but they
asked me to post here the patch, this patch allows shell32.dll from reactos to
be correctly loaded by real windows xp winlogon.exe.
PS: In PathIsEqualOrSubFolder I was using wcslen, I've replaced with strlenW in wine, I hope it's ok.
Also note I've added bound checks:
if (!path1 || !path2) return FALSE;

I doubt shell32 function on windows does this check, also original windows shell32
function is a lot more complicated and longer, I've compared the results between
real and my code and they are correct.

Bye
- --
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCIa/f3UE5cRfnO04RAnwPAJ9d2GBlDE1+RSyrekMfx7vQ8HnTPACfTGmR
6/HPls9XIZ9+DWWUo1MJ0IU=
=C1o+
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: dlls/shell32/shell32.spec
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell32.spec,v
retrieving revision 1.96
diff -u -r1.96 shell32.spec
--- dlls/shell32/shell32.spec	23 Feb 2005 15:41:14 -0000	1.96
+++ dlls/shell32/shell32.spec	27 Feb 2005 11:27:57 -0000
@@ -250,6 +250,7 @@
 # >= NT5
  714 stdcall @(ptr) SHELL32_714 # PathIsTemporaryW
  730 stdcall -noname RestartDialogEx(long wstr long long)
+ 755 stdcall -noname PathIsEqualOrSubFolder(wstr wstr)
 
 1217 stub FOOBAR1217   # no joke! This is the real name!!
 
@@ -456,3 +457,4 @@
 # _WIN32_IE >= 0x600
 @ stdcall SHDefExtractIconA(str long long ptr ptr long)
 @ stdcall SHDefExtractIconW(wstr long long ptr ptr long)
+@ stub SHCreateShellItem
Index: dlls/shell32/shellpath.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shellpath.c,v
retrieving revision 1.98
diff -u -r1.98 shellpath.c
--- dlls/shell32/shellpath.c	14 Feb 2005 11:07:55 -0000	1.98
+++ dlls/shell32/shellpath.c	27 Feb 2005 11:28:00 -0000
@@ -411,6 +411,23 @@
 }
 
 /*************************************************************************
+ * PathIsEqualOrSubFolder     [SHELL32.755]
+ */
+BOOL WINAPI PathIsEqualOrSubFolder(LPCWSTR path1, LPCWSTR path2)
+{
+	int i;
+	int len;
+	if (!path1 || !path2) return FALSE;
+
+	len = strlenW(path1);
+	if (len > strlenW(path2)) return FALSE;
+
+	for (i=0; i < len; i++)
+		if (path1[i] != path2[i]) return FALSE;
+	return TRUE;
+}
+
+/*************************************************************************
  * PathFileExists	[SHELL32.45]
  */
 BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
Index: dlls/shell32/undocshell.h
===================================================================
RCS file: /home/wine/wine/dlls/shell32/undocshell.h,v
retrieving revision 1.28
diff -u -r1.28 undocshell.h
--- dlls/shell32/undocshell.h	13 Dec 2004 21:19:01 -0000	1.28
+++ dlls/shell32/undocshell.h	27 Feb 2005 11:28:00 -0000
@@ -410,6 +410,8 @@
 
 BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
 
+BOOL WINAPI PathIsEqualOrSubFolder(LPCWSTR path1, LPCWSTR path2);
+
 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
 
 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);


More information about the wine-patches mailing list