[PATCH] Added 2 functions to shell32
Gianluigi Tiesi
sherpya at netfarm.it
Sun Feb 27 21:06:26 CST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dmitry Timoshkov wrote:
| "Gianluigi Tiesi" <sherpya at netfarm.it> wrote:
|
|
|>+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;
|>+}
|
|
| You need to do a case insensitive comparison of paths.
|
| Also, if you could use a usual for Wine formatting style with 4 space
| indentation that would be very nice.
|
This version does case insensitive check, I'm using tolowerW instead of standard windows towlower,
hope it's correct. I've used one tab indentation since the other code uses the same indentation.
I may provide other documented/undocumented functions if you like.
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
iD8DBQFCIoqy3UE5cRfnO04RAlAiAJ4igIRlGRlXKSaRyi5VJsL/UzdVzwCgkn2c
vB/SAxWHX1hkDn2BEe6MEUo=
=449f
-----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 28 Feb 2005 03:03:45 -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 28 Feb 2005 03:03:49 -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 (tolowerW(path1[i]) != tolowerW(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 28 Feb 2005 03:03:49 -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-devel
mailing list