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
3fe5e6ee
Commit
3fe5e6ee
authored
Nov 23, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Keep FILE critical section initialized after closing file.
parent
517d0800
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
file.c
dlls/msvcrt/file.c
+16
-19
No files found.
dlls/msvcrt/file.c
View file @
3fe5e6ee
...
@@ -362,7 +362,12 @@ static MSVCRT_FILE* msvcrt_alloc_fp(void)
...
@@ -362,7 +362,12 @@ static MSVCRT_FILE* msvcrt_alloc_fp(void)
if
(
file
->
_flag
==
0
)
if
(
file
->
_flag
==
0
)
{
{
if
(
i
==
MSVCRT_stream_idx
)
MSVCRT_stream_idx
++
;
if
(
i
==
MSVCRT_stream_idx
)
{
InitializeCriticalSection
(
&
((
file_crit
*
)
file
)
->
crit
);
((
file_crit
*
)
file
)
->
crit
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": file_crit.crit"
);
MSVCRT_stream_idx
++
;
}
return
file
;
return
file
;
}
}
}
}
...
@@ -385,12 +390,6 @@ static int msvcrt_init_fp(MSVCRT_FILE* file, int fd, unsigned stream_flags)
...
@@ -385,12 +390,6 @@ static int msvcrt_init_fp(MSVCRT_FILE* file, int fd, unsigned stream_flags)
file
->
_file
=
fd
;
file
->
_file
=
fd
;
file
->
_flag
=
stream_flags
;
file
->
_flag
=
stream_flags
;
if
(
file
<
MSVCRT__iob
||
file
>=
MSVCRT__iob
+
_IOB_ENTRIES
)
{
InitializeCriticalSection
(
&
((
file_crit
*
)
file
)
->
crit
);
((
file_crit
*
)
file
)
->
crit
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": file_crit.crit"
);
}
TRACE
(
":got FILE* (%p)
\n
"
,
file
);
TRACE
(
":got FILE* (%p)
\n
"
,
file
);
return
0
;
return
0
;
}
}
...
@@ -985,6 +984,16 @@ void msvcrt_free_io(void)
...
@@ -985,6 +984,16 @@ void msvcrt_free_io(void)
for
(
i
=
0
;
i
<
sizeof
(
MSVCRT___pioinfo
)
/
sizeof
(
MSVCRT___pioinfo
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
MSVCRT___pioinfo
)
/
sizeof
(
MSVCRT___pioinfo
[
0
]);
i
++
)
MSVCRT_free
(
MSVCRT___pioinfo
[
i
]);
MSVCRT_free
(
MSVCRT___pioinfo
[
i
]);
for
(
i
=
0
;
i
<
MSVCRT_stream_idx
;
i
++
)
{
MSVCRT_FILE
*
file
=
msvcrt_get_file
(
i
);
if
(
file
<
MSVCRT__iob
||
file
>=
MSVCRT__iob
+
_IOB_ENTRIES
)
{
((
file_crit
*
)
file
)
->
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
((
file_crit
*
)
file
)
->
crit
);
}
}
for
(
i
=
0
;
i
<
sizeof
(
MSVCRT_fstream
)
/
sizeof
(
MSVCRT_fstream
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
MSVCRT_fstream
)
/
sizeof
(
MSVCRT_fstream
[
0
]);
i
++
)
MSVCRT_free
(
MSVCRT_fstream
[
i
]);
MSVCRT_free
(
MSVCRT_fstream
[
i
]);
...
@@ -2607,18 +2616,6 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file)
...
@@ -2607,18 +2616,6 @@ int CDECL MSVCRT_fclose(MSVCRT_FILE* file)
file
->
_flag
=
0
;
file
->
_flag
=
0
;
MSVCRT__unlock_file
(
file
);
MSVCRT__unlock_file
(
file
);
if
(
file
<
MSVCRT__iob
||
file
>=
MSVCRT__iob
+
_IOB_ENTRIES
)
{
((
file_crit
*
)
file
)
->
crit
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
((
file_crit
*
)
file
)
->
crit
);
}
if
(
file
==
msvcrt_get_file
(
MSVCRT_stream_idx
-
1
))
{
while
(
MSVCRT_stream_idx
>
3
&&
!
file
->
_flag
)
{
MSVCRT_stream_idx
--
;
file
=
msvcrt_get_file
(
MSVCRT_stream_idx
-
1
);
}
}
return
((
r
==
-
1
)
||
(
flag
&
MSVCRT__IOERR
)
?
MSVCRT_EOF
:
0
);
return
((
r
==
-
1
)
||
(
flag
&
MSVCRT__IOERR
)
?
MSVCRT_EOF
:
0
);
}
}
...
...
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