Commit ed325359 authored by Rolf Kalbermatter's avatar Rolf Kalbermatter Committed by Alexandre Julliard

Implemented PathFileExistsAndAttributesA/W function.

parent 2cee7ac6
...@@ -1714,6 +1714,63 @@ BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath) ...@@ -1714,6 +1714,63 @@ BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
} }
/************************************************************************* /*************************************************************************
* 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] * PathMatchSingleMaskA [internal]
*/ */
static BOOL WINAPI PathMatchSingleMaskA(LPCSTR name, LPCSTR mask) static BOOL WINAPI PathMatchSingleMaskA(LPCSTR name, LPCSTR mask)
......
...@@ -442,8 +442,8 @@ ...@@ -442,8 +442,8 @@
442 stdcall @(wstr ptr long) kernel32.GetEnvironmentVariableW 442 stdcall @(wstr ptr long) kernel32.GetEnvironmentVariableW
443 stdcall @(ptr long) kernel32.GetSystemWindowsDirectoryA 443 stdcall @(ptr long) kernel32.GetSystemWindowsDirectoryA
444 stdcall @(ptr long) kernel32.GetSystemWindowsDirectoryW 444 stdcall @(ptr long) kernel32.GetSystemWindowsDirectoryW
445 stub -noname PathFileExistsAndAttributesA 445 stdcall -noname PathFileExistsAndAttributesA(str ptr)
446 stub -noname PathFileExistsAndAttributesW 446 stdcall -noname PathFileExistsAndAttributesW(wstr ptr)
447 stub -noname FixSlashesAndColonA 447 stub -noname FixSlashesAndColonA
448 stub -noname FixSlashesAndColonW 448 stub -noname FixSlashesAndColonW
449 stub -noname NextPathA 449 stub -noname NextPathA
......
...@@ -332,6 +332,10 @@ BOOL WINAPI PathFileExistsA(LPCSTR); ...@@ -332,6 +332,10 @@ BOOL WINAPI PathFileExistsA(LPCSTR);
BOOL WINAPI PathFileExistsW(LPCWSTR); BOOL WINAPI PathFileExistsW(LPCWSTR);
#define PathFileExists WINELIB_NAME_AW(PathFileExists) #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); LPSTR WINAPI PathFindExtensionA(LPCSTR);
LPWSTR WINAPI PathFindExtensionW(LPCWSTR); LPWSTR WINAPI PathFindExtensionW(LPCWSTR);
#define PathFindExtension WINELIB_NAME_AW(PathFindExtension) #define PathFindExtension WINELIB_NAME_AW(PathFindExtension)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment