SHELL32.755 PathIsEqualOrSubFolder について

shell32 addons - ReactOS Website
ReactOS にソースあったけど間違ってるみたいなので(・ω・)

//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);
}

単純にPathを比較するのではなく、第一パラメータが CSIDL の場合は、Pathに変換して比較しなくてはならない。

おすすめ

2件のフィードバック

  1. piotrhn より:

    Hi, I’m prepared update of SHELL, based on WinXP v2211 and maybe later 😀 v2257
    Whistler builds:
    https://winworldpc.com/product/windows-xp/early-whistler
    Download and replace files: shell32, explorer webvw & we must use shlwapi from XP WHISTLER early versions NOT 6.xxx 🙁
    Please update this shell with your functions: SHGetFolderPathAndSubDir Ex, ShelItem etc..
    SHELL 2211 https://www1.zippyshare.com/v/j03H1s7F/file.html
    Shell from WinXP v2211(FULL compatible with 2000). It adds:
    categorized control panel….
    256 full color icons on tray
    WIAACMGR we can copy from 2211.
    If you want i ported from v2410 SHIMGVW Image Viewer and PRINT DIRECTORY foldery and it works perfect. 😀
    SHELL 2257 https://www1.zippyshare.com/v/a11ABaA4/file.html
    New Start Menu
    Autorun
    much more…
    functions: SHCreateShellItem, SHEnumerateUnreadMail…, SHOPenFolderAndSelectItems, SHSetLocalizedName, , …
    Crash when run Control Panel, must use COMCTLv6 as comctl32 and USER32 with Paint/CalcMenuBar & Register/UnregisterUserApiHook

  2. WhyDoIHaveToEnterMyName? より:

    ReactOS accepts pull requests on GitHub now: https://github.com/reactos/reactos

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です