shell32 addons

All development related issues welcome

Moderator: Moderator Team

Post Reply
sherpya
Posts: 25
Joined: Tue Dec 21, 2004 3:56 am
Location: Italy

shell32 addons

Post by sherpya » Fri Sep 30, 2005 2:51 am

I've made a patch that adds a function and a stub to shell32.dll, this make possibile to run real windows winlogon:

Code: Select all

Index: lib/shell32/undocshell.h
===================================================================
--- lib/shell32/undocshell.h    (revision 18161)
+++ lib/shell32/undocshell.h    (working copy)
@@ -400,6 +400,8 @@

 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);

+BOOL WINAPI PathIsEqualOrSubFolder(LPCWSTR path1, LPCWSTR path2);
+
 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);

 BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
Index: lib/shell32/shellpath.c
===================================================================
--- lib/shell32/shellpath.c     (revision 18161)
+++ lib/shell32/shellpath.c     (working copy)
@@ -411,6 +411,28 @@
 }

 /*************************************************************************
+ * 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;
+
+       /* a trailing backslash in path1,
+        * makes path2 reach char just after the backslash */
+       if (path2[i-1] == '\\') return TRUE;
+
+       return (!path2[i] || (path2[i] == '\\'));
+}
+
+/*************************************************************************
  * PathFileExists      [SHELL32.45]
  */
 BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
Index: lib/shell32/shell32.spec
===================================================================
--- lib/shell32/shell32.spec    (revision 18161)
+++ lib/shell32/shell32.spec    (working copy)
@@ -248,6 +248,7 @@

  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!!

@@ -321,6 +322,7 @@
 @ stub SHCreateProcessAsUserW
 @ stdcall SHDefExtractIconA(str long long ptr ptr long)
 @ stdcall SHDefExtractIconW(wstr long long ptr ptr long)
+@ stub SHCreateShellItem
 @ stdcall SHEmptyRecycleBinA(long str long)
 @ stdcall SHEmptyRecycleBinW(long wstr long)
 @ stub SHExtractIconsW
I've yet posted the patch on the wine ml, but they fogot it

w3seek
Developer
Posts: 144
Joined: Tue Nov 23, 2004 12:12 am

Post by w3seek » Thu Oct 06, 2005 7:41 pm

you should submit the patch to wine again. This way it gets merged into reactos on the next synchronization and reduces merging problems for us.

roytam1
Posts: 43
Joined: Thu Oct 06, 2005 11:14 am

Re: shell32 addons

Post by roytam1 » Fri Mar 15, 2019 5:30 pm

Code: Select all

//SHELL32.755
#define CSIDL_FLAG_DONT_VERIFY 0x4000
__declspec(dllexport) BOOL WINAPI PathIsEqualOrSubFolder(LPCWSTR path1, LPCWSTR path2) {
  wchar_t path3[512];
  int len,len2;
  if (!path2) return FALSE;
  if(((DWORD)path1&0xffff0000)==0){
    SHGetFolderPathW(NULL,CSIDL_FLAG_DONT_VERIFY|
    (DWORD)path1,NULL,NULL,path3);
    path1=path3;
  }
  len = lstrlenW(path1);
  len2 = lstrlenW(path2);
  if(len-len2==1 && path1[len-1]==L'\\'){
    len--;
  } else if (len2-len==1 && path2[len-1]==L'\\'){
    len2--;
  }
  if(len!=len2) return false;
    return (CompareStringW(LOCALE_USER_DEFAULT,NORM_IGNORECASE, path1,len,path2,len2)==CSTR_EQUAL);
}
blackwingcat wrote a better version:
http://blog.livedoor.jp/blackwingcat/ar ... 80010.html

and said that PathIsEqualOrSubFolder() needs converting CSIDL to real path first in order to compare afterwards.

hbelusca
Developer
Posts: 1151
Joined: Sat Dec 26, 2009 10:36 pm
Location: Zagreb, Croatia

Re: shell32 addons

Post by hbelusca » Sat Mar 16, 2019 12:08 am

OK reviving a 14-year old thread...

binarymaster
Posts: 318
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: shell32 addons

Post by binarymaster » Sat Mar 16, 2019 12:57 am

roytam1 wrote:
Fri Mar 15, 2019 5:30 pm
blackwingcat wrote a better version:
http://blog.livedoor.jp/blackwingcat/ar ... 80010.html

and said that PathIsEqualOrSubFolder() needs converting CSIDL to real path first in order to compare afterwards.
Propose a Pull Request with fix? ;)
hbelusca wrote:
Sat Mar 16, 2019 12:08 am
OK reviving a 14-year old thread...
Thread necromancy is fun. :lol:

ThFabba
Developer
Posts: 288
Joined: Sun Jul 11, 2010 11:39 am

Re: shell32 addons

Post by ThFabba » Sat Mar 16, 2019 10:24 am

We can't use this code unless the author submits it to us. As-is, we don't have the right to distribute it under the GPL, nor do we have any assurance that it was written in a legal manner.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest