diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index ab4e654569a..e6fadd692d7 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -490,7 +490,7 @@ @ cdecl _abnormal_termination() msvcrt._abnormal_termination @ stub _abs64 @ cdecl _access(str long) msvcrt._access -@ stub _access_s +@ cdecl _access_s(str long) msvcrt._access_s @ extern _acmdln msvcrt._acmdln @ cdecl _aligned_free(ptr) msvcrt._aligned_free @ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc @@ -1274,7 +1274,7 @@ @ stub _vwprintf_p_l @ stub _vwprintf_s_l @ cdecl _waccess(wstr long) msvcrt._waccess -@ stub _waccess_s +@ cdecl _waccess_s(wstr long) msvcrt.waccess_s @ cdecl _wasctime(ptr) msvcrt._wasctime @ stub _wasctime_s @ stub _wassert diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 7e14ecf4b4b..3953b5cf41f 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -314,7 +314,7 @@ @ cdecl _abnormal_termination() msvcrt._abnormal_termination @ stub _abs64 @ cdecl _access(str long) msvcrt._access -@ stub _access_s +@ cdecl _access_s(str long) msvcrt._access_s @ extern _acmdln msvcrt._acmdln @ stdcall -arch=i386 _adj_fdiv_m16i(long) msvcrt._adj_fdiv_m16i @ stdcall -arch=i386 _adj_fdiv_m32(long) msvcrt._adj_fdiv_m32 @@ -1127,7 +1127,7 @@ @ stub _vwprintf_p_l @ stub _vwprintf_s_l @ cdecl _waccess(wstr long) msvcrt._waccess -@ stub _waccess_s +@ cdecl _waccess_s(wstr long) msvcrt._waccess_s @ cdecl _wasctime(ptr) msvcrt._wasctime @ stub _wasctime_s @ stub _wassert diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index c331365b005..f9188e3a24a 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -306,7 +306,7 @@ @ cdecl _abnormal_termination() msvcrt._abnormal_termination @ stub _abs64 @ cdecl _access(str long) msvcrt._access -@ stub _access_s +@ cdecl _access_s(str long) msvcrt._access_s @ extern _acmdln msvcrt._acmdln @ stdcall -arch=i386 _adj_fdiv_m16i(long) msvcrt._adj_fdiv_m16i @ stdcall -arch=i386 _adj_fdiv_m32(long) msvcrt._adj_fdiv_m32 @@ -1114,7 +1114,7 @@ @ stub _vwprintf_p_l @ stub _vwprintf_s_l @ cdecl _waccess(wstr long) msvcrt._waccess -@ stub _waccess_s +@ cdecl _waccess_s(wstr long) msvcrt._waccess_s @ cdecl _wasctime(ptr) msvcrt._wasctime @ stub _wasctime_s @ stub _wassert diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 7074120074f..ab18c1f3d28 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -55,6 +55,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); /* _access() bit flags FIXME: incomplete */ #define MSVCRT_W_OK 0x02 +#define MSVCRT_R_OK 0x04 /* values for wxflag in file descriptor */ #define WX_OPEN 0x01 @@ -506,6 +507,21 @@ int CDECL MSVCRT__access(const char *filename, int mode) return 0; } +/********************************************************************* + * _access_s (MSVCRT.@) + */ +int CDECL _access_s(const char *filename, int mode) +{ + if (!MSVCRT_CHECK_PMT(filename != NULL) || + !MSVCRT_CHECK_PMT((mode & ~(MSVCRT_R_OK | MSVCRT_W_OK)) == 0)) + { + *MSVCRT__errno() = MSVCRT_EINVAL; + return -1; + } + + return MSVCRT__access(filename, mode); +} + /********************************************************************* * _waccess (MSVCRT.@) */ @@ -528,6 +544,21 @@ int CDECL _waccess(const MSVCRT_wchar_t *filename, int mode) return 0; } +/********************************************************************* + * _waccess_s (MSVCRT.@) + */ +int CDECL _waccess_s(const MSVCRT_wchar_t *filename, int mode) +{ + if (!MSVCRT_CHECK_PMT(filename != NULL) || + !MSVCRT_CHECK_PMT((mode & ~(MSVCRT_R_OK | MSVCRT_W_OK)) == 0)) + { + *MSVCRT__errno() = MSVCRT_EINVAL; + return -1; + } + + return _waccess(filename, mode); +} + /********************************************************************* * _chmod (MSVCRT.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 0a929afca11..f6baa107cd7 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -271,7 +271,7 @@ @ cdecl _abnormal_termination() # stub _abs64 @ cdecl _access(str long) MSVCRT__access -# stub _access_s +@ cdecl _access_s(str long) @ extern _acmdln MSVCRT__acmdln @ stdcall -arch=i386 _adj_fdiv_m16i(long) @ stdcall -arch=i386 _adj_fdiv_m32(long) @@ -1046,7 +1046,7 @@ # stub _vwprintf_p_l # stub _vwprintf_s_l @ cdecl _waccess(wstr long) -# stub _waccess_s +@ cdecl _waccess_s(wstr long) @ cdecl _wasctime(ptr) MSVCRT__wasctime # stub _wasctime_s # stub _wassert