msvcrt: Added _ftelli64_nolock implementation.

This commit is contained in:
Iván Matellanes 2014-10-15 16:46:01 +02:00 committed by Alexandre Julliard
parent 4c0ec6700c
commit 7cf0c877b3
7 changed files with 22 additions and 12 deletions

View file

@ -850,7 +850,7 @@
@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32
@ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64
@ stub _ftelli64_nolock
@ cdecl -ret64 _ftelli64_nolock(ptr) MSVCRT__ftelli64_nolock
@ cdecl _ftime32(ptr) MSVCRT__ftime32
@ cdecl _ftime32_s(ptr) MSVCRT__ftime32_s
@ cdecl _ftime64(ptr) MSVCRT__ftime64

View file

@ -1198,7 +1198,7 @@
@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32
@ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64
@ stub _ftelli64_nolock
@ cdecl -ret64 _ftelli64_nolock(ptr) MSVCRT__ftelli64_nolock
@ cdecl _ftime32(ptr) MSVCRT__ftime32
@ cdecl _ftime32_s(ptr) MSVCRT__ftime32_s
@ cdecl _ftime64(ptr) MSVCRT__ftime64

View file

@ -517,7 +517,7 @@
@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32
@ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64
@ stub _ftelli64_nolock
@ cdecl -ret64 _ftelli64_nolock(ptr) MSVCRT__ftelli64_nolock
@ cdecl _ftime32(ptr) MSVCRT__ftime32
@ cdecl _ftime32_s(ptr) MSVCRT__ftime32_s
@ cdecl _ftime64(ptr) MSVCRT__ftime64

View file

@ -499,7 +499,7 @@
@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32
@ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64
@ stub _ftelli64_nolock
@ cdecl -ret64 _ftelli64_nolock(ptr) MSVCRT__ftelli64_nolock
@ cdecl _ftime32(ptr) MSVCRT__ftime32
@ cdecl _ftime32_s(ptr) MSVCRT__ftime32_s
@ cdecl _ftime64(ptr) MSVCRT__ftime64

View file

@ -4226,14 +4226,25 @@ int CDECL MSVCRT_fsetpos(MSVCRT_FILE* file, MSVCRT_fpos_t *pos)
*/
__int64 CDECL MSVCRT__ftelli64(MSVCRT_FILE* file)
{
__int64 pos;
__int64 ret;
MSVCRT__lock_file(file);
ret = MSVCRT__ftelli64_nolock(file);
MSVCRT__unlock_file(file);
return ret;
}
/*********************************************************************
* _ftelli64_nolock (MSVCRT.@)
*/
__int64 CDECL MSVCRT__ftelli64_nolock(MSVCRT_FILE* file)
{
__int64 pos;
pos = _telli64(file->_file);
if(pos == -1) {
MSVCRT__unlock_file(file);
if(pos == -1)
return -1;
}
if(file->_flag & (MSVCRT__IOMYBUF | MSVCRT__USERBUF)) {
if(file->_flag & MSVCRT__IOWRT) {
pos += file->_ptr - file->_base;
@ -4258,10 +4269,8 @@ __int64 CDECL MSVCRT__ftelli64(MSVCRT_FILE* file)
} else {
char *p;
if(MSVCRT__lseeki64(file->_file, pos, SEEK_SET) != pos) {
MSVCRT__unlock_file(file);
if(MSVCRT__lseeki64(file->_file, pos, SEEK_SET) != pos)
return -1;
}
pos -= file->_bufsiz;
pos += file->_ptr - file->_base;
@ -4277,7 +4286,6 @@ __int64 CDECL MSVCRT__ftelli64(MSVCRT_FILE* file)
}
}
MSVCRT__unlock_file(file);
return pos;
}

View file

@ -920,6 +920,7 @@ int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*);
MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
__int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);
__int64 __cdecl MSVCRT__ftelli64_nolock(MSVCRT_FILE*);
void __cdecl MSVCRT__exit(int);
void __cdecl MSVCRT_abort(void);
MSVCRT_ulong* __cdecl MSVCRT___doserrno(void);

View file

@ -130,6 +130,7 @@ int __cdecl _vsprintf_p_l(char*,size_t,const char*,_locale_t,__ms_va_list);
size_t __cdecl _fread_nolock(void*,size_t,size_t,FILE*);
size_t __cdecl _fwrite_nolock(const void*,size_t,size_t,FILE*);
int __cdecl _fclose_nolock(FILE*);
__int64 __cdecl _ftelli64_nolock(FILE*);
void __cdecl clearerr(FILE*);
int __cdecl fclose(FILE*);