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
277da0ea
Commit
277da0ea
authored
Jul 16, 2015
by
Iván Matellanes
Committed by
Alexandre Julliard
Jul 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcirt: Implement ios static locking.
parent
9939ac8f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
7 deletions
+34
-7
msvcirt.c
dlls/msvcirt/msvcirt.c
+14
-2
msvcirt.spec
dlls/msvcirt/msvcirt.spec
+1
-1
msvcirt.c
dlls/msvcirt/tests/msvcirt.c
+17
-2
msvcrt20.spec
dlls/msvcrt20/msvcrt20.spec
+1
-1
msvcrt40.spec
dlls/msvcrt40/msvcrt40.spec
+1
-1
No files found.
dlls/msvcirt/msvcirt.c
View file @
277da0ea
...
...
@@ -31,6 +31,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcirt);
#define RESERVE_SIZE 512
/* ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A */
extern
CRITICAL_SECTION
ios_static_lock
;
CRITICAL_SECTION_DEBUG
ios_static_lock_debug
=
{
0
,
0
,
&
ios_static_lock
,
{
&
ios_static_lock_debug
.
ProcessLocksList
,
&
ios_static_lock_debug
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": ios_static_lock"
)
}
};
CRITICAL_SECTION
ios_static_lock
=
{
&
ios_static_lock_debug
,
-
1
,
0
,
0
,
0
,
0
};
/* class streambuf */
typedef
struct
{
const
vtable_ptr
*
vtable
;
...
...
@@ -1001,7 +1011,8 @@ void __cdecl ios_lockbuf(ios *this)
/* ?lockc@ios@@KAXXZ */
void
__cdecl
ios_lockc
(
void
)
{
FIXME
(
"() stub
\n
"
);
TRACE
(
"()
\n
"
);
EnterCriticalSection
(
&
ios_static_lock
);
}
/* ?lockptr@ios@@IAEPAU_CRT_CRITICAL_SECTION@@XZ */
...
...
@@ -1138,7 +1149,8 @@ void __cdecl ios_unlockbuf(ios *this)
/* ?unlockc@ios@@KAXXZ */
void
__cdecl
ios_unlockc
(
void
)
{
FIXME
(
"() stub
\n
"
);
TRACE
(
"()
\n
"
);
LeaveCriticalSection
(
&
ios_static_lock
);
}
/* ?unsetf@ios@@QAEJJ@Z */
...
...
dlls/msvcirt/msvcirt.spec
View file @
277da0ea
...
...
@@ -777,7 +777,7 @@
@ stub -arch=win32 ?ws@@YAAAVistream@@AAV1@@Z # class istream & __cdecl ws(class istream &)
@ stub -arch=win64 ?ws@@YAAEAVistream@@AEAV1@@Z
# @ extern ?x_curindex@ios@@0HA # static int ios::x_curindex
# @ extern ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A # static struct _CRT_CRITICAL_SECTION ios::x_lockc
@ extern ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A ios_static_lock
# @ extern ?x_maxbit@ios@@0JA # static long ios::x_maxbit
# @ extern ?x_statebuf@ios@@0PAJA # static long * ios::x_statebuf
@ cdecl ?xalloc@ios@@SAHXZ() ios_xalloc
...
...
dlls/msvcirt/tests/msvcirt.c
View file @
277da0ea
...
...
@@ -134,6 +134,9 @@ static void (*__cdecl p_ios_lock)(ios*);
static
void
(
*
__cdecl
p_ios_unlock
)(
ios
*
);
static
void
(
*
__cdecl
p_ios_lockbuf
)(
ios
*
);
static
void
(
*
__cdecl
p_ios_unlockbuf
)(
ios
*
);
static
CRITICAL_SECTION
*
p_ios_static_lock
;
static
void
(
*
__cdecl
p_ios_lockc
)(
void
);
static
void
(
*
__cdecl
p_ios_unlockc
)(
void
);
/* Emulate a __thiscall */
#ifdef __i386__
...
...
@@ -281,6 +284,9 @@ static BOOL init(void)
SET
(
p_ios_lockbuf
,
"?lockbuf@ios@@QAAXXZ"
);
SET
(
p_ios_unlockbuf
,
"?unlockbuf@ios@@QAAXXZ"
);
}
SET
(
p_ios_static_lock
,
"?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A"
);
SET
(
p_ios_lockc
,
"?lockc@ios@@KAXXZ"
);
SET
(
p_ios_unlockc
,
"?unlockc@ios@@KAXXZ"
);
init_thiscall_thunk
();
return
TRUE
;
...
...
@@ -827,7 +833,7 @@ struct ios_lock_arg
{
ios
*
ios_obj
;
HANDLE
lock
;
HANDLE
release
[
2
];
HANDLE
release
[
3
];
};
static
DWORD
WINAPI
lock_ios
(
void
*
arg
)
...
...
@@ -835,10 +841,13 @@ static DWORD WINAPI lock_ios(void *arg)
struct
ios_lock_arg
*
lock_arg
=
arg
;
p_ios_lock
(
lock_arg
->
ios_obj
);
p_ios_lockbuf
(
lock_arg
->
ios_obj
);
p_ios_lockc
();
SetEvent
(
lock_arg
->
lock
);
WaitForSingleObject
(
lock_arg
->
release
[
0
],
INFINITE
);
p_ios_unlock
buf
(
lock_arg
->
ios_obj
);
p_ios_unlock
c
(
);
WaitForSingleObject
(
lock_arg
->
release
[
1
],
INFINITE
);
p_ios_unlockbuf
(
lock_arg
->
ios_obj
);
WaitForSingleObject
(
lock_arg
->
release
[
2
],
INFINITE
);
p_ios_unlock
(
lock_arg
->
ios_obj
);
return
0
;
}
...
...
@@ -962,6 +971,8 @@ static void test_ios(void)
ok
(
lock_arg
.
release
[
0
]
!=
NULL
,
"CreateEventW failed
\n
"
);
lock_arg
.
release
[
1
]
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
lock_arg
.
release
[
1
]
!=
NULL
,
"CreateEventW failed
\n
"
);
lock_arg
.
release
[
2
]
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
lock_arg
.
release
[
2
]
!=
NULL
,
"CreateEventW failed
\n
"
);
thread
=
CreateThread
(
NULL
,
0
,
lock_ios
,
(
void
*
)
&
lock_arg
,
0
,
NULL
);
ok
(
thread
!=
NULL
,
"CreateThread failed
\n
"
);
WaitForSingleObject
(
lock_arg
.
lock
,
INFINITE
);
...
...
@@ -970,9 +981,12 @@ static void test_ios(void)
ok
(
locked
==
0
,
"the ios object was not locked before
\n
"
);
locked
=
TryEnterCriticalSection
(
&
ios_obj
.
sb
->
lock
);
ok
(
locked
==
0
,
"the streambuf was not locked before
\n
"
);
locked
=
TryEnterCriticalSection
(
p_ios_static_lock
);
ok
(
locked
==
0
,
"the static critical section was not locked before
\n
"
);
SetEvent
(
lock_arg
.
release
[
0
]);
SetEvent
(
lock_arg
.
release
[
1
]);
SetEvent
(
lock_arg
.
release
[
2
]);
WaitForSingleObject
(
thread
,
INFINITE
);
ios_obj
.
delbuf
=
1
;
...
...
@@ -981,6 +995,7 @@ static void test_ios(void)
CloseHandle
(
lock_arg
.
lock
);
CloseHandle
(
lock_arg
.
release
[
0
]);
CloseHandle
(
lock_arg
.
release
[
1
]);
CloseHandle
(
lock_arg
.
release
[
2
]);
CloseHandle
(
thread
);
}
...
...
dlls/msvcrt20/msvcrt20.spec
View file @
277da0ea
...
...
@@ -765,7 +765,7 @@
@ stub -arch=win32 ?ws@@YAAAVistream@@AAV1@@Z
@ stub -arch=win64 ?ws@@YAAEAVistream@@AEAV1@@Z
# @ extern ?x_curindex@ios@@0HA
# @ extern ?x_lockc@ios@@0U_RTL
_CRITICAL_SECTION@@A
@ extern ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A msvcirt.?x_lockc@ios@@0U_CRT
_CRITICAL_SECTION@@A
# @ extern ?x_maxbit@ios@@0JA
# @ extern ?x_statebuf@ios@@0QAJA
@ cdecl ?xalloc@ios@@SAHXZ() msvcirt.?xalloc@ios@@SAHXZ
...
...
dlls/msvcrt40/msvcrt40.spec
View file @
277da0ea
...
...
@@ -839,7 +839,7 @@
@ stub -arch=win32 ?ws@@YAAAVistream@@AAV1@@Z
@ stub -arch=win64 ?ws@@YAAEAVistream@@AEAV1@@Z
# @ extern ?x_curindex@ios@@0HA
# @ extern
?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A
@ extern ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A msvcirt.
?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A
# @ extern ?x_maxbit@ios@@0JA
# @ extern ?x_statebuf@ios@@0PAJA
@ cdecl ?xalloc@ios@@SAHXZ() msvcirt.?xalloc@ios@@SAHXZ
...
...
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