forked from Mirrors/wine-wine
Implemented PathFileExistsAndAttributesA/W function.
parent
2cee7ac6d9
commit
ed32535931
|
@ -1713,6 +1713,63 @@ BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
|
||||||
return dwAttr == INVALID_FILE_ATTRIBUTES ? FALSE : TRUE;
|
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]
|
* PathMatchSingleMaskA [internal]
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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);
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue