Implemented PathFileExistsAndAttributesA/W function.

This commit is contained in:
Rolf Kalbermatter 2004-01-19 21:46:14 +00:00 committed by Alexandre Julliard
parent 2cee7ac6d9
commit ed32535931
3 changed files with 63 additions and 2 deletions

View File

@ -1713,6 +1713,63 @@ BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE;
}
/*************************************************************************
* PathFileExistsAndAttributesA [SHLWAPI.445]
*
* Determine if a file exists.
*
* PARAMS
* lpszPath [I] Path to check
* dwAttr [O] attributes of file
*
* RETURNS
* TRUE If the file exists and is readable
* FALSE Otherwise
*/
BOOL WINAPI PathFileExistsAndAttributesA(LPCSTR lpszPath, DWORD *dwAttr)
{
UINT iPrevErrMode;
DWORD dwVal = 0;
TRACE("(%s %p)\n", debugstr_a(lpszPath), dwAttr);
if (dwAttr)
*dwAttr = INVALID_FILE_ATTRIBUTES;
if (!lpszPath)
return FALSE;
iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
dwVal = GetFileAttributesA(lpszPath);
SetErrorMode(iPrevErrMode);
if (dwAttr)
*dwAttr = dwVal;
return (dwVal != INVALID_FILE_ATTRIBUTES);
}
/*************************************************************************
* PathFileExistsAndAttributesW [SHLWAPI.446]
*
* See PathFileExistsA.
*/
BOOL WINAPI PathFileExistsAndAttributesW(LPCWSTR lpszPath, DWORD *dwAttr)
{
UINT iPrevErrMode;
DWORD dwVal;
TRACE("(%s %p)\n", debugstr_w(lpszPath), dwAttr);
if (!lpszPath)
return FALSE;
iPrevErrMode = SetErrorMode(SEM_FAILCRITICALERRORS);
dwVal = GetFileAttributesW(lpszPath);
SetErrorMode(iPrevErrMode);
if (dwAttr)
*dwAttr = dwVal;
return (dwVal != INVALID_FILE_ATTRIBUTES);
}
/*************************************************************************
* PathMatchSingleMaskA [internal]
*/

View File

@ -442,8 +442,8 @@
442 stdcall @(wstr ptr long) kernel32.GetEnvironmentVariableW
443 stdcall @(ptr long) kernel32.GetSystemWindowsDirectoryA
444 stdcall @(ptr long) kernel32.GetSystemWindowsDirectoryW
445 stub -noname PathFileExistsAndAttributesA
446 stub -noname PathFileExistsAndAttributesW
445 stdcall -noname PathFileExistsAndAttributesA(str ptr)
446 stdcall -noname PathFileExistsAndAttributesW(wstr ptr)
447 stub -noname FixSlashesAndColonA
448 stub -noname FixSlashesAndColonW
449 stub -noname NextPathA

View File

@ -332,6 +332,10 @@ BOOL WINAPI PathFileExistsA(LPCSTR);
BOOL WINAPI PathFileExistsW(LPCWSTR);
#define PathFileExists WINELIB_NAME_AW(PathFileExists)
BOOL WINAPI PathFileExistsAndAttributesA(LPCSTR lpszPath, DWORD *dwAttr);
BOOL WINAPI PathFileExistsAndAttributesW(LPCWSTR lpszPath, DWORD *dwAttr);
#define PathFileExistsAndAttributes WINELIB_NAME_AW(PathFileExistsAndAttributes)
LPSTR WINAPI PathFindExtensionA(LPCSTR);
LPWSTR WINAPI PathFindExtensionW(LPCWSTR);
#define PathFindExtension WINELIB_NAME_AW(PathFindExtension)