Page 1 of 1

[PATCH] shell32.dll - winxp addons

Posted: Mon Feb 14, 2005 4:06 am
by sherpya
This patch make shell32.dll works with windows xp winlogon and other base stuff, I've added two new functions, one is stub since it needs some stuff to implement, the other is the undocumented PathIsEqualOrSubFolder,
that I've implemented and tested with the normal windows xp version with same results. The function is unicode only.

Code: Select all

Index: undocshell.h
===================================================================
--- undocshell.h        (revision 13553)
+++ undocshell.h        (working copy)
@@ -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);
Index: shellpath.c
===================================================================
--- shellpath.c (revision 13553)
+++ shellpath.c (working copy)
@@ -401,6 +401,21 @@
 }

 /*************************************************************************
+ *  PathIsEqualOrSubFolder     [SHELL32.755]
+ */
+BOOL WINAPI PathIsEqualOrSubFolder(LPCWSTR path1, LPCWSTR path2)
+{
+       int i;
+       int len = wcslen(path1);
+       if (len > wcslen(path2)) return FALSE;
+
+       for (i=0; i < len; i++)
+               if (path1[i] != path2[i]) return FALSE;
+
+       return TRUE;
+}
+
+/*************************************************************************
  * PathIsDirectory     [SHELL32.159]
  */
 BOOL WINAPI PathIsDirectoryAW (LPCVOID lpszPath)
Index: shell32.spec
===================================================================
--- shell32.spec        (revision 13553)
+++ shell32.spec        (working copy)
@@ -314,6 +314,7 @@
 # >= NT5
  714 stdcall @(ptr)SHELL32_714 # PathIsTemporaryW
  730 stdcall RestartDialogEx(long wstr long long)
+ 755 stdcall PathIsEqualOrSubFolder(wstr wstr)

 1217 stub FOOBAR1217   # no joke! This is the real name!!

@@ -439,3 +440,4 @@
 # _WIN32_IE >= 0x600
 @ stdcall SHDefExtractIconA(str long long ptr ptr long)
 @ stdcall SHDefExtractIconW(wstr long long ptr ptr long)
+@ stub SHCreateShellItem

Posted: Mon Feb 14, 2005 4:24 am
by sherpya
bound checks can be added if needed

Posted: Mon Feb 14, 2005 2:13 pm
by w3seek
great! You should submit your bug to the wine team! We just merge back their changes frequently.