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
6812bb74
Commit
6812bb74
authored
Jul 17, 2015
by
Iván Matellanes
Committed by
Alexandre Julliard
Jul 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcirt: Add ios instance counter.
parent
b6c5bd15
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
3 deletions
+19
-3
msvcirt.c
dlls/msvcirt/msvcirt.c
+6
-0
msvcirt.spec
dlls/msvcirt/msvcirt.spec
+1
-1
msvcirt.c
dlls/msvcirt/tests/msvcirt.c
+10
-0
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 @
6812bb74
...
...
@@ -38,6 +38,9 @@ const LONG ios_adjustfield = FLAGS_left | FLAGS_right | FLAGS_internal;
const
LONG
ios_basefield
=
FLAGS_dec
|
FLAGS_oct
|
FLAGS_hex
;
/* ?floatfield@ios@@2JB */
const
LONG
ios_floatfield
=
FLAGS_scientific
|
FLAGS_fixed
;
/* ?fLockcInit@ios@@0HA */
/* FIXME: should be initialized to 0 and increased on construction of cin, cout, cerr and clog */
int
ios_fLockcInit
=
4
;
/* ?x_lockc@ios@@0U_CRT_CRITICAL_SECTION@@A */
extern
CRITICAL_SECTION
ios_static_lock
;
CRITICAL_SECTION_DEBUG
ios_static_lock_debug
=
...
...
@@ -741,6 +744,7 @@ DEFINE_THISCALL_WRAPPER(ios_copy_ctor, 8)
ios
*
__thiscall
ios_copy_ctor
(
ios
*
this
,
const
ios
*
copy
)
{
TRACE
(
"(%p %p)
\n
"
,
this
,
copy
);
ios_fLockcInit
++
;
this
->
vtable
=
&
MSVCP_ios_vtable
;
this
->
sb
=
NULL
;
this
->
delbuf
=
0
;
...
...
@@ -754,6 +758,7 @@ DEFINE_THISCALL_WRAPPER(ios_sb_ctor, 8)
ios
*
__thiscall
ios_sb_ctor
(
ios
*
this
,
streambuf
*
sb
)
{
TRACE
(
"(%p %p)
\n
"
,
this
,
sb
);
ios_fLockcInit
++
;
this
->
vtable
=
&
MSVCP_ios_vtable
;
this
->
sb
=
sb
;
this
->
state
=
sb
?
IOSTATE_goodbit
:
IOSTATE_badbit
;
...
...
@@ -783,6 +788,7 @@ DEFINE_THISCALL_WRAPPER(ios_dtor, 4)
void
__thiscall
ios_dtor
(
ios
*
this
)
{
TRACE
(
"(%p)
\n
"
,
this
);
ios_fLockcInit
--
;
if
(
this
->
delbuf
&&
this
->
sb
)
call_streambuf_vector_dtor
(
this
->
sb
,
1
);
this
->
sb
=
NULL
;
...
...
dlls/msvcirt/msvcirt.spec
View file @
6812bb74
...
...
@@ -465,7 +465,7 @@
@ cdecl -arch=win64 ?eof@ios@@QEBAHXZ(ptr) ios_eof
@ thiscall -arch=win32 ?epptr@streambuf@@IBEPADXZ(ptr) streambuf_epptr
@ cdecl -arch=win64 ?epptr@streambuf@@IEBAPEADXZ(ptr) streambuf_epptr
# @ extern ?fLockcInit@ios@@0HA # static int ios::
fLockcInit
@ extern ?fLockcInit@ios@@0HA ios_
fLockcInit
@ thiscall -arch=win32 ?fail@ios@@QBEHXZ(ptr) ios_fail
@ cdecl -arch=win64 ?fail@ios@@QEBAHXZ(ptr) ios_fail
@ stub -arch=win32 ?fd@filebuf@@QBEHXZ # int __thiscall filebuf::fd(void)const
...
...
dlls/msvcirt/tests/msvcirt.c
View file @
6812bb74
...
...
@@ -154,6 +154,7 @@ static LONG *p_ios_statebuf;
static
LONG
*
(
*
__thiscall
p_ios_iword
)(
const
ios
*
,
int
);
static
void
**
(
*
__thiscall
p_ios_pword
)(
const
ios
*
,
int
);
static
int
(
*
__cdecl
p_ios_xalloc
)(
void
);
static
int
*
p_ios_fLockcInit
;
/* Emulate a __thiscall */
#ifdef __i386__
...
...
@@ -333,6 +334,7 @@ static BOOL init(void)
SET
(
p_ios_curindex
,
"?x_curindex@ios@@0HA"
);
SET
(
p_ios_statebuf
,
"?x_statebuf@ios@@0PAJA"
);
SET
(
p_ios_xalloc
,
"?xalloc@ios@@SAHXZ"
);
SET
(
p_ios_fLockcInit
,
"?fLockcInit@ios@@0HA"
);
init_thiscall_thunk
();
return
TRUE
;
...
...
@@ -916,6 +918,7 @@ static void test_ios(void)
call_func1
(
p_streambuf_ctor
,
psb
);
/* constructor/destructor */
ok
(
*
p_ios_fLockcInit
==
4
,
"expected 4 got %d
\n
"
,
*
p_ios_fLockcInit
);
call_func2
(
p_ios_sb_ctor
,
&
ios_obj
,
NULL
);
ok
(
ios_obj
.
sb
==
NULL
,
"expected %p got %p
\n
"
,
NULL
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
IOSTATE_badbit
,
"expected %x got %x
\n
"
,
IOSTATE_badbit
,
ios_obj
.
state
);
...
...
@@ -929,23 +932,28 @@ static void test_ios(void)
ok
(
ios_obj
.
width
==
0
,
"expected 0 got %d
\n
"
,
ios_obj
.
width
);
ok
(
ios_obj
.
do_lock
==
-
1
,
"expected -1 got %d
\n
"
,
ios_obj
.
do_lock
);
ok
(
ios_obj
.
lock
.
LockCount
==
-
1
,
"expected -1 got %d
\n
"
,
ios_obj
.
lock
.
LockCount
);
ok
(
*
p_ios_fLockcInit
==
5
,
"expected 5 got %d
\n
"
,
*
p_ios_fLockcInit
);
ios_obj
.
state
=
0x8
;
call_func1
(
p_ios_dtor
,
&
ios_obj
);
ok
(
ios_obj
.
state
==
IOSTATE_badbit
,
"expected %x got %x
\n
"
,
IOSTATE_badbit
,
ios_obj
.
state
);
ok
(
*
p_ios_fLockcInit
==
4
,
"expected 4 got %d
\n
"
,
*
p_ios_fLockcInit
);
ios_obj
.
state
=
0x8
;
call_func2
(
p_ios_sb_ctor
,
&
ios_obj
,
psb
);
ok
(
ios_obj
.
sb
==
psb
,
"expected %p got %p
\n
"
,
psb
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
IOSTATE_goodbit
,
"expected %x got %x
\n
"
,
IOSTATE_goodbit
,
ios_obj
.
state
);
ok
(
ios_obj
.
delbuf
==
0
,
"expected 0 got %d
\n
"
,
ios_obj
.
delbuf
);
ok
(
*
p_ios_fLockcInit
==
5
,
"expected 5 got %d
\n
"
,
*
p_ios_fLockcInit
);
ios_obj
.
state
=
0x8
;
call_func1
(
p_ios_dtor
,
&
ios_obj
);
ok
(
ios_obj
.
sb
==
NULL
,
"expected %p got %p
\n
"
,
NULL
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
IOSTATE_badbit
,
"expected %x got %x
\n
"
,
IOSTATE_badbit
,
ios_obj
.
state
);
ok
(
*
p_ios_fLockcInit
==
4
,
"expected 4 got %d
\n
"
,
*
p_ios_fLockcInit
);
ios_obj
.
sb
=
psb
;
ios_obj
.
state
=
0x8
;
call_func1
(
p_ios_ctor
,
&
ios_obj
);
ok
(
ios_obj
.
sb
==
NULL
,
"expected %p got %p
\n
"
,
NULL
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
IOSTATE_badbit
,
"expected %x got %x
\n
"
,
IOSTATE_badbit
,
ios_obj
.
state
);
ok
(
*
p_ios_fLockcInit
==
5
,
"expected 5 got %d
\n
"
,
*
p_ios_fLockcInit
);
/* init */
ios_obj
.
state
|=
0x8
;
...
...
@@ -973,6 +981,7 @@ static void test_ios(void)
ok
(
ios_obj
.
fill
==
(
char
)
0xab
,
"expected %d got %d
\n
"
,
(
char
)
0xab
,
ios_obj
.
fill
);
ok
(
ios_obj
.
width
==
(
char
)
0xab
,
"expected %d got %d
\n
"
,
(
char
)
0xab
,
ios_obj
.
width
);
ok
(
ios_obj
.
do_lock
==
-
1
,
"expected -1 got %d
\n
"
,
ios_obj
.
do_lock
);
ok
(
*
p_ios_fLockcInit
==
5
,
"expected 5 got %d
\n
"
,
*
p_ios_fLockcInit
);
/* assignment */
ios_obj
.
state
=
0x8
;
...
...
@@ -1137,6 +1146,7 @@ static void test_ios(void)
ios_obj
.
delbuf
=
1
;
call_func1
(
p_ios_dtor
,
&
ios_obj
);
ok
(
ios_obj
.
state
==
IOSTATE_badbit
,
"expected %x got %x
\n
"
,
IOSTATE_badbit
,
ios_obj
.
state
);
ok
(
*
p_ios_fLockcInit
==
4
,
"expected 4 got %d
\n
"
,
*
p_ios_fLockcInit
);
CloseHandle
(
lock_arg
.
lock
);
CloseHandle
(
lock_arg
.
release
[
0
]);
CloseHandle
(
lock_arg
.
release
[
1
]);
...
...
dlls/msvcrt20/msvcrt20.spec
View file @
6812bb74
...
...
@@ -453,7 +453,7 @@
@ cdecl -arch=win64 ?eof@ios@@QEBAHXZ(ptr) msvcirt.?eof@ios@@QEBAHXZ
@ thiscall -arch=win32 ?epptr@streambuf@@IBEPADXZ(ptr) msvcirt.?epptr@streambuf@@IBEPADXZ
@ cdecl -arch=win64 ?epptr@streambuf@@IEBAPEADXZ(ptr) msvcirt.?epptr@streambuf@@IEBAPEADXZ
# @ extern
?fLockcInit@ios@@0HA
@ extern ?fLockcInit@ios@@0HA msvcirt.
?fLockcInit@ios@@0HA
@ thiscall -arch=win32 ?fail@ios@@QBEHXZ(ptr) msvcirt.?fail@ios@@QBEHXZ
@ cdecl -arch=win64 ?fail@ios@@QEBAHXZ(ptr) msvcirt.?fail@ios@@QEBAHXZ
@ stub -arch=win32 ?fd@filebuf@@QBEHXZ
...
...
dlls/msvcrt40/msvcrt40.spec
View file @
6812bb74
...
...
@@ -518,7 +518,7 @@
@ cdecl -arch=win64 ?eof@ios@@QEBAHXZ(ptr) msvcirt.?eof@ios@@QEBAHXZ
@ thiscall -arch=win32 ?epptr@streambuf@@IBEPADXZ(ptr) msvcirt.?epptr@streambuf@@IBEPADXZ
@ cdecl -arch=win64 ?epptr@streambuf@@IEBAPEADXZ(ptr) msvcirt.?epptr@streambuf@@IEBAPEADXZ
# @ extern
?fLockcInit@ios@@0HA
@ extern ?fLockcInit@ios@@0HA msvcirt.
?fLockcInit@ios@@0HA
@ thiscall -arch=win32 ?fail@ios@@QBEHXZ(ptr) msvcirt.?fail@ios@@QBEHXZ
@ cdecl -arch=win64 ?fail@ios@@QEBAHXZ(ptr) msvcirt.?fail@ios@@QEBAHXZ
@ stub -arch=win32 ?fd@filebuf@@QBEHXZ
...
...
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