diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 6e860e8833e..a305cb26060 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -560,9 +560,9 @@ @ varargs _cscanf_s(str) msvcrt._cscanf_s @ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l @ cdecl _ctime32(ptr) msvcrt._ctime32 -@ stub _ctime32_s +@ cdecl _ctime32_s(str long ptr) msvcrt._ctime32_s @ cdecl _ctime64(ptr) msvcrt._ctime64 -@ stub _ctime64_s +@ cdecl _ctime64_s(str long ptr) msvcrt._ctime64_s @ cdecl _cwait(ptr long long) msvcrt._cwait @ varargs _cwprintf(wstr) msvcrt._cwprintf @ stub _cwprintf_l diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 17785be4388..36f522cc8fc 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -399,9 +399,9 @@ @ varargs _cscanf_s(str) msvcrt._cscanf_s @ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l @ cdecl _ctime32(ptr) msvcrt._ctime32 -@ stub _ctime32_s +@ cdecl _ctime32_s(str ptr long) msvcrt._ctime32_s @ cdecl _ctime64(ptr) msvcrt._ctime64 -@ stub _ctime64_s +@ cdecl _ctime64_s(str ptr long) msvcrt._ctime64_s @ cdecl _cwait(ptr long long) msvcrt._cwait @ varargs _cwprintf(wstr) msvcrt._cwprintf @ stub _cwprintf_l diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 663e1b704bf..33bfb33bc50 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -391,9 +391,9 @@ @ varargs _cscanf_s(str) msvcrt._cscanf_s @ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l @ cdecl _ctime32(ptr) msvcrt._ctime32 -@ stub _ctime32_s +@ cdecl _ctime32_s(str long ptr) msvcrt._ctime32_s @ cdecl _ctime64(ptr) msvcrt._ctime64 -@ stub _ctime64_s +@ cdecl _ctime64_s(str long ptr) msvcrt._ctime64_s @ cdecl _cwait(ptr long long) msvcrt._cwait @ varargs _cwprintf(wstr) msvcrt._cwprintf @ stub _cwprintf_l diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 3db6fa4c113..e65c152a3d2 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -356,9 +356,9 @@ @ varargs _cscanf_s(str) @ varargs _cscanf_s_l(str ptr) @ cdecl _ctime32(ptr) MSVCRT__ctime32 -# stub _ctime32_s +@ cdecl _ctime32_s(str long ptr) MSVCRT__ctime32_s @ cdecl _ctime64(ptr) MSVCRT__ctime64 -# stub _ctime64_s +@ cdecl _ctime64_s(str long ptr) MSVCRT__ctime64_s @ extern _ctype MSVCRT__ctype @ cdecl _cwait(ptr long long) @ varargs _cwprintf(wstr) diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index b345a7f8e16..7ccdc7dca16 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -901,6 +901,28 @@ char * CDECL MSVCRT__ctime64(const MSVCRT___time64_t *time) return MSVCRT_asctime( t ); } +/********************************************************************* + * _ctime64_s (MSVCRT.@) + */ +int CDECL MSVCRT__ctime64_s(char *res, MSVCRT_size_t len, const MSVCRT___time64_t *time) +{ + struct MSVCRT_tm *t; + if( !MSVCRT_CHECK_PMT( res != NULL ) || !MSVCRT_CHECK_PMT( len >= 26 ) ) + { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + res[0] = '\0'; + if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( time > 0 ) ) + { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + t = MSVCRT__localtime64( time ); + strcpy( res, MSVCRT_asctime( t ) ); + return 0; +} + /********************************************************************* * _ctime32 (MSVCRT.@) */ @@ -912,6 +934,28 @@ char * CDECL MSVCRT__ctime32(const MSVCRT___time32_t *time) return MSVCRT_asctime( t ); } +/********************************************************************* + * _ctime32_s (MSVCRT.@) + */ +int CDECL MSVCRT__ctime32_s(char *res, MSVCRT_size_t len, const MSVCRT___time32_t *time) +{ + struct MSVCRT_tm *t; + if( !MSVCRT_CHECK_PMT( res != NULL ) || !MSVCRT_CHECK_PMT( len >= 26 ) ) + { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + res[0] = '\0'; + if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( time > 0 ) ) + { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + t = MSVCRT__localtime32( time ); + strcpy( res, MSVCRT_asctime( t ) ); + return 0; +} + /********************************************************************* * ctime (MSVCRT.@) */