msvcrt: Added _fseeki64_nolock implementation.

This commit is contained in:
Iván Matellanes 2014-10-15 16:47:07 +02:00 committed by Alexandre Julliard
parent 50574ccffa
commit 5077d8c137
7 changed files with 21 additions and 7 deletions

View File

@ -842,7 +842,7 @@
@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l
@ stub _fseek_nolock
@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64
@ stub _fseeki64_nolock
@ cdecl _fseeki64_nolock(ptr int64 long) MSVCRT__fseeki64_nolock
@ cdecl _fsopen(str str long) MSVCRT__fsopen
@ cdecl _fstat32(long ptr) MSVCRT__fstat32
@ stub _fstat32i64

View File

@ -1190,7 +1190,7 @@
@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l
@ stub _fseek_nolock
@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64
@ stub _fseeki64_nolock
@ cdecl _fseeki64_nolock(ptr int64 long) MSVCRT__fseeki64_nolock
@ cdecl _fsopen(str str long) MSVCRT__fsopen
@ cdecl _fstat32(long ptr) MSVCRT__fstat32
@ stub _fstat32i64

View File

@ -509,7 +509,7 @@
@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l
@ stub _fseek_nolock
@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64
@ stub _fseeki64_nolock
@ cdecl _fseeki64_nolock(ptr int64 long) MSVCRT__fseeki64_nolock
@ cdecl _fsopen(str str long) MSVCRT__fsopen
@ cdecl _fstat32(long ptr) MSVCRT__fstat32
@ stub _fstat32i64

View File

@ -491,7 +491,7 @@
@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l
@ stub _fseek_nolock
@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64
@ stub _fseeki64_nolock
@ cdecl _fseeki64_nolock(ptr int64 long) MSVCRT__fseeki64_nolock
@ cdecl _fsopen(str str long) MSVCRT__fsopen
@ cdecl _fstat32(long ptr) MSVCRT__fstat32
@ stub _fstat32i64

View File

@ -1249,13 +1249,26 @@ int CDECL MSVCRT__fseeki64(MSVCRT_FILE* file, __int64 offset, int whence)
int ret;
MSVCRT__lock_file(file);
ret = MSVCRT__fseeki64_nolock(file, offset, whence);
MSVCRT__unlock_file(file);
return ret;
}
/*********************************************************************
* _fseeki64_nolock (MSVCRT.@)
*/
int CDECL MSVCRT__fseeki64_nolock(MSVCRT_FILE* file, __int64 offset, int whence)
{
int ret;
/* Flush output if needed */
if(file->_flag & MSVCRT__IOWRT)
msvcrt_flush_buffer(file);
if(whence == SEEK_CUR && file->_flag & MSVCRT__IOREAD ) {
whence = SEEK_SET;
offset += MSVCRT__ftelli64(file);
offset += MSVCRT__ftelli64_nolock(file);
}
/* Discard buffered input */
@ -1269,7 +1282,6 @@ int CDECL MSVCRT__fseeki64(MSVCRT_FILE* file, __int64 offset, int whence)
file->_flag &= ~MSVCRT__IOEOF;
ret = (MSVCRT__lseeki64(file->_file,offset,whence) == -1)?-1:0;
MSVCRT__unlock_file(file);
return ret;
}

View File

@ -919,6 +919,7 @@ int __cdecl MSVCRT_fgetc(MSVCRT_FILE*);
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*);
int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int);
__int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file);
__int64 __cdecl MSVCRT__ftelli64_nolock(MSVCRT_FILE*);
void __cdecl MSVCRT__exit(int);

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*);
int __cdecl _fseeki64_nolock(FILE*,__int64,int);
__msvcrt_long __cdecl _ftell_nolock(FILE*);
__int64 __cdecl _ftelli64_nolock(FILE*);