Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
598ff4dd
Commit
598ff4dd
authored
Jun 04, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Reuse FILE object in wfreopen function.
parent
6d1db050
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
file.c
dlls/msvcrt/file.c
+20
-12
No files found.
dlls/msvcrt/file.c
View file @
598ff4dd
...
@@ -3797,20 +3797,28 @@ MSVCRT_size_t CDECL fread_s(void *buf, MSVCRT_size_t buf_size, MSVCRT_size_t ele
...
@@ -3797,20 +3797,28 @@ MSVCRT_size_t CDECL fread_s(void *buf, MSVCRT_size_t buf_size, MSVCRT_size_t ele
*/
*/
MSVCRT_FILE
*
CDECL
MSVCRT__wfreopen
(
const
MSVCRT_wchar_t
*
path
,
const
MSVCRT_wchar_t
*
mode
,
MSVCRT_FILE
*
file
)
MSVCRT_FILE
*
CDECL
MSVCRT__wfreopen
(
const
MSVCRT_wchar_t
*
path
,
const
MSVCRT_wchar_t
*
mode
,
MSVCRT_FILE
*
file
)
{
{
int
fd
;
int
open_flags
,
stream_flags
,
fd
;
TRACE
(
":path (%s) mode (%s) file (%p) fd (%d)
\n
"
,
debugstr_w
(
path
),
debugstr_w
(
mode
),
file
,
file
->
_file
);
TRACE
(
":path (%s) mode (%s) file (%p) fd (%d)
\n
"
,
debugstr_w
(
path
),
debugstr_w
(
mode
),
file
,
file
->
_file
);
LOCK_FILES
();
LOCK_FILES
();
if
(
!
file
||
((
fd
=
file
->
_file
)
<
0
)
||
fd
>
MSVCRT_fdend
)
if
(
!
file
||
((
fd
=
file
->
_file
)
<
0
)
||
fd
>
MSVCRT_fdend
)
file
=
NULL
;
file
=
NULL
;
else
else
{
{
MSVCRT_fclose
(
file
);
MSVCRT_fclose
(
file
);
file
=
MSVCRT__wfsopen
(
path
,
mode
,
MSVCRT__SH_DENYNO
);
if
(
msvcrt_get_flags
(
mode
,
&
open_flags
,
&
stream_flags
)
==
-
1
)
}
file
=
NULL
;
UNLOCK_FILES
();
else
if
((
fd
=
MSVCRT__wopen
(
path
,
open_flags
,
MSVCRT__S_IREAD
|
MSVCRT__S_IWRITE
))
<
0
)
return
file
;
file
=
NULL
;
else
if
(
msvcrt_init_fp
(
file
,
fd
,
stream_flags
)
==
-
1
)
{
file
->
_flag
=
0
;
file
=
NULL
;
}
}
UNLOCK_FILES
();
return
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