Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4bb80afe
Commit
4bb80afe
authored
Oct 20, 2014
by
Iván Matellanes
Committed by
Alexandre Julliard
Oct 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added _fflush_nolock implementation.
Thanks to Piotr Caban for the test.
parent
c35f0161
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
9 deletions
+45
-9
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
msvcr90.c
dlls/msvcr90/tests/msvcr90.c
+20
-0
file.c
dlls/msvcrt/file.c
+19
-5
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-0
stdio.h
include/msvcrt/stdio.h
+1
-0
No files found.
dlls/msvcr100/msvcr100.spec
View file @
4bb80afe
...
...
@@ -799,7 +799,7 @@
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@
stub
_fflush_nolock
@
cdecl _fflush_nolock(ptr) MSVCRT_
_fflush_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
...
...
dlls/msvcr110/msvcr110.spec
View file @
4bb80afe
...
...
@@ -1147,7 +1147,7 @@
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@
stub
_fflush_nolock
@
cdecl _fflush_nolock(ptr) MSVCRT_
_fflush_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
...
...
dlls/msvcr80/msvcr80.spec
View file @
4bb80afe
...
...
@@ -466,7 +466,7 @@
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@
stub
_fflush_nolock
@
cdecl _fflush_nolock(ptr) MSVCRT_
_fflush_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
...
...
dlls/msvcr90/msvcr90.spec
View file @
4bb80afe
...
...
@@ -448,7 +448,7 @@
@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt
@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s
@ cdecl _fdopen(long str) MSVCRT__fdopen
@
stub
_fflush_nolock
@
cdecl _fflush_nolock(ptr) MSVCRT_
_fflush_nolock
@ cdecl _fgetchar() MSVCRT__fgetchar
@ stub _fgetwc_nolock
@ cdecl _fgetwchar() MSVCRT__fgetwchar
...
...
dlls/msvcr90/tests/msvcr90.c
View file @
4bb80afe
...
...
@@ -121,6 +121,7 @@ static int (__cdecl *p_flsbuf)(int, FILE*);
static
unsigned
long
(
__cdecl
*
p_byteswap_ulong
)(
unsigned
long
);
static
void
**
(
__cdecl
*
p__pxcptinfoptrs
)(
void
);
static
void
*
(
__cdecl
*
p__AdjustPointer
)(
void
*
,
const
void
*
);
static
int
(
__cdecl
*
p_fflush_nolock
)(
FILE
*
);
/* make sure we use the correct errno */
#undef errno
...
...
@@ -379,6 +380,7 @@ static BOOL init(void)
SET
(
p_byteswap_ulong
,
"_byteswap_ulong"
);
SET
(
p__pxcptinfoptrs
,
"__pxcptinfoptrs"
);
SET
(
p__AdjustPointer
,
"__AdjustPointer"
);
SET
(
p_fflush_nolock
,
"_fflush_nolock"
);
if
(
sizeof
(
void
*
)
==
8
)
{
SET
(
p_type_info_name_internal_method
,
"?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z"
);
...
...
@@ -1207,16 +1209,22 @@ struct block_file_arg
FILE
*
write
;
HANDLE
init
;
HANDLE
finish
;
int
deadlock_test
;
};
static
DWORD
WINAPI
block_file
(
void
*
arg
)
{
struct
block_file_arg
*
files
=
arg
;
int
deadlock_test
;
p_lock_file
(
files
->
read
);
p_lock_file
(
files
->
write
);
SetEvent
(
files
->
init
);
WaitForSingleObject
(
files
->
finish
,
INFINITE
);
Sleep
(
200
);
deadlock_test
=
InterlockedIncrement
(
&
files
->
deadlock_test
);
ok
(
deadlock_test
==
1
,
"deadlock_test = %d
\n
"
,
deadlock_test
);
p_unlock_file
(
files
->
read
);
p_unlock_file
(
files
->
write
);
return
0
;
...
...
@@ -1250,6 +1258,7 @@ static void test_nonblocking_file_access(void)
arg
.
write
=
filew
;
arg
.
init
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
arg
.
finish
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
arg
.
deadlock_test
=
0
;
ok
(
arg
.
init
!=
NULL
,
"CreateEventW failed
\n
"
);
ok
(
arg
.
finish
!=
NULL
,
"CreateEventW failed
\n
"
);
thread
=
CreateThread
(
NULL
,
0
,
block_file
,
(
void
*
)
&
arg
,
0
,
NULL
);
...
...
@@ -1276,7 +1285,18 @@ static void test_nonblocking_file_access(void)
ret
=
p_flsbuf
(
'a'
,
filew
);
ok
(
ret
==
'a'
,
"_flsbuf(filew) returned %d
\n
"
,
ret
);
ret
=
p_fflush_nolock
(
filer
);
ok
(
ret
==
0
,
"_fflush_nolock(filer) returned %d
\n
"
,
ret
);
ret
=
p_fflush_nolock
(
filew
);
ok
(
ret
==
0
,
"_fflush_nolock(filew) returned %d
\n
"
,
ret
);
SetEvent
(
arg
.
finish
);
ret
=
p_fflush_nolock
(
NULL
);
ok
(
ret
==
0
,
"_fflush_nolock(NULL) returned %d
\n
"
,
ret
);
ret
=
InterlockedIncrement
(
&
arg
.
deadlock_test
);
ok
(
ret
==
2
,
"InterlockedIncrement returned %d
\n
"
,
ret
);
WaitForSingleObject
(
thread
,
INFINITE
);
CloseHandle
(
arg
.
init
);
CloseHandle
(
arg
.
finish
);
...
...
dlls/msvcrt/file.c
View file @
4bb80afe
...
...
@@ -919,24 +919,38 @@ int CDECL MSVCRT__flushall(void)
*/
int
CDECL
MSVCRT_fflush
(
MSVCRT_FILE
*
file
)
{
int
ret
;
if
(
!
file
)
{
msvcrt_flush_all_buffers
(
MSVCRT__IOWRT
);
ret
=
0
;
}
else
{
MSVCRT__lock_file
(
file
);
ret
=
MSVCRT__fflush_nolock
(
file
);
MSVCRT__unlock_file
(
file
);
}
return
ret
;
}
/*********************************************************************
* _fflush_nolock (MSVCRT.@)
*/
int
CDECL
MSVCRT__fflush_nolock
(
MSVCRT_FILE
*
file
)
{
if
(
!
file
)
{
msvcrt_flush_all_buffers
(
MSVCRT__IOWRT
);
}
else
if
(
file
->
_flag
&
MSVCRT__IOWRT
)
{
int
res
;
MSVCRT__lock_file
(
file
);
res
=
msvcrt_flush_buffer
(
file
);
if
(
!
res
&&
(
file
->
_flag
&
MSVCRT__IOCOMMIT
))
res
=
MSVCRT__commit
(
file
->
_file
)
?
MSVCRT_EOF
:
0
;
MSVCRT__unlock_file
(
file
);
return
res
;
}
else
if
(
file
->
_flag
&
MSVCRT__IOREAD
)
{
MSVCRT__lock_file
(
file
);
file
->
_cnt
=
0
;
file
->
_ptr
=
file
->
_base
;
MSVCRT__unlock_file
(
file
);
return
0
;
}
...
...
dlls/msvcrt/msvcrt.h
View file @
4bb80afe
...
...
@@ -931,6 +931,7 @@ MSVCRT_size_t __cdecl MSVCRT__fread_nolock(void*,MSVCRT_size_t,MSVCRT_size_t,MSV
MSVCRT_size_t
__cdecl
MSVCRT__fwrite_nolock
(
const
void
*
,
MSVCRT_size_t
,
MSVCRT_size_t
,
MSVCRT_FILE
*
);
int
__cdecl
MSVCRT_fclose
(
MSVCRT_FILE
*
);
int
__cdecl
MSVCRT__fclose_nolock
(
MSVCRT_FILE
*
);
int
__cdecl
MSVCRT__fflush_nolock
(
MSVCRT_FILE
*
);
void
__cdecl
MSVCRT_terminate
(
void
);
MSVCRT_FILE
*
__cdecl
MSVCRT__iob_func
(
void
);
MSVCRT_clock_t
__cdecl
MSVCRT_clock
(
void
);
...
...
include/msvcrt/stdio.h
View file @
4bb80afe
...
...
@@ -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
_fflush_nolock
(
FILE
*
);
int
__cdecl
_fseek_nolock
(
FILE
*
,
__msvcrt_long
,
int
);
int
__cdecl
_fseeki64_nolock
(
FILE
*
,
__int64
,
int
);
__msvcrt_long
__cdecl
_ftell_nolock
(
FILE
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment