diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 9beb6d3..edea29b 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -252,6 +252,7 @@ 714 stdcall @(ptr) SHELL32_714 # PathIsTemporaryW 730 stdcall -noname RestartDialogEx(long wstr long long) + 755 stdcall -noname PathIsEqualOrSubFolder(long wstr) 1217 stub FOOBAR1217 # no joke! This is the real name!! @ stdcall CheckEscapesA(str long) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 241b4a7..0ef3bf2 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -744,6 +744,44 @@ LONG WINAPI PathProcessCommandAW ( return PathProcessCommandA(lpszPath, lpszBuff, dwBuffSize, dwFlags); } +/************************************************************************* + * PathIsEqualOrSubFolder [SHELL32.755] + */ +BOOL WINAPI PathIsEqualOrSubFolder( int indexOrPath, LPCWSTR path) +{ + WCHAR szPath[MAX_PATH], szPrefixPath[MAX_PATH]; + LPWSTR pTmp; + + TRACE("(0x%x, %s)\n", indexOrPath, debugstr_w(path)); + + /* is it pointer or index param ? */ + if(indexOrPath & 0xFFFF0000) + { + if(*path == '\0') + return FALSE; + + lstrcpynW(szPath, path, MAX_PATH); + } + else + { + /* was index */ + if (FAILED (SHGetFolderPathW (NULL, indexOrPath | CSIDL_FLAG_DONT_VERIFY, NULL, SHGFP_TYPE_CURRENT, szPath))) + return FALSE; + } + + if(*szPath == '\0') + return FALSE; + + pTmp = PathRemoveBackslashW( szPath); + if(pTmp == NULL || *pTmp == '\0') + return FALSE; + + if(PathCommonPrefixW( szPath, path, szPrefixPath) == 0) + return FALSE; + + return !lstrcmpiW(szPath, szPrefixPath); +} + /* ########## special ########## */