Commit ba5b0c34 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

msvcrt: Implement freopen_s.

parent 09202ee9
......@@ -1469,7 +1469,7 @@
@ stub fread_s
@ cdecl free(ptr) msvcrt.free
@ cdecl freopen(str str ptr) msvcrt.freopen
@ stub freopen_s
@ cdecl freopen_s(ptr str str ptr) msvcrt.freopen_s
@ cdecl frexp(double ptr) msvcrt.frexp
@ varargs fscanf(ptr str) msvcrt.fscanf
@ varargs fscanf_s(ptr str) msvcrt.fscanf_s
......
......@@ -1325,7 +1325,7 @@
@ stub fread_s
@ cdecl free(ptr) msvcrt.free
@ cdecl freopen(str str ptr) msvcrt.freopen
@ stub freopen_s
@ cdecl freopen_s(ptr str str ptr) msvcrt.freopen_s
@ cdecl frexp(double ptr) msvcrt.frexp
@ varargs fscanf(ptr str) msvcrt.fscanf
@ varargs fscanf_s(ptr str) msvcrt.fscanf_s
......
......@@ -1326,7 +1326,7 @@
@ stub fread_s
@ cdecl free(ptr) msvcrt.free
@ cdecl freopen(str str ptr) msvcrt.freopen
@ stub freopen_s
@ cdecl freopen_s(ptr str str ptr) msvcrt.freopen_s
@ cdecl frexp(double ptr) msvcrt.frexp
@ varargs fscanf(ptr str) msvcrt.fscanf
@ varargs fscanf_s(ptr str) msvcrt.fscanf_s
......
......@@ -3300,6 +3300,25 @@ MSVCRT_FILE* CDECL MSVCRT_freopen(const char *path, const char *mode, MSVCRT_FIL
}
/*********************************************************************
* freopen_s (MSVCRT.@)
*/
int CDECL MSVCRT_freopen_s(MSVCRT_FILE** pFile,
const char *path, const char *mode, MSVCRT_FILE* file)
{
if (!MSVCRT_CHECK_PMT(pFile != NULL) || !MSVCRT_CHECK_PMT(path != NULL) ||
!MSVCRT_CHECK_PMT(mode != NULL) || !MSVCRT_CHECK_PMT(file != NULL)) {
*MSVCRT__errno() = MSVCRT_EINVAL;
return MSVCRT_EINVAL;
}
*pFile = MSVCRT_freopen(path, mode, file);
if(!*pFile)
return *MSVCRT__errno();
return 0;
}
/*********************************************************************
* fsetpos (MSVCRT.@)
*/
int CDECL MSVCRT_fsetpos(MSVCRT_FILE* file, MSVCRT_fpos_t *pos)
......
......@@ -1269,7 +1269,7 @@
@ cdecl fread(ptr long long ptr) MSVCRT_fread
@ cdecl free(ptr) MSVCRT_free
@ cdecl freopen(str str ptr) MSVCRT_freopen
# stub freopen_s(ptr str str ptr)
@ cdecl freopen_s(ptr str str ptr) MSVCRT_freopen_s
@ cdecl frexp(double ptr) MSVCRT_frexp
@ cdecl -arch=x86_64 frexpf(float ptr) MSVCRT_frexpf
@ varargs fscanf(ptr str) MSVCRT_fscanf
......
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