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
bc01af8f
Commit
bc01af8f
authored
Jul 04, 2015
by
Iván Matellanes
Committed by
Alexandre Julliard
Jul 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcirt: Implement ios constructors and assignment.
parent
0dcb382a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
29 deletions
+54
-29
msvcirt.c
dlls/msvcirt/msvcirt.c
+52
-15
msvcirt.c
dlls/msvcirt/tests/msvcirt.c
+2
-14
No files found.
dlls/msvcirt/msvcirt.c
View file @
bc01af8f
...
...
@@ -71,6 +71,8 @@ typedef struct {
CRITICAL_SECTION
lock
;
}
ios
;
ios
*
__thiscall
ios_assign
(
ios
*
,
const
ios
*
);
/* class ostream */
typedef
struct
_ostream
{
const
vtable_ptr
*
vtable
;
...
...
@@ -707,17 +709,12 @@ void __thiscall streambuf_dbp(streambuf *this)
DEFINE_THISCALL_WRAPPER
(
ios_copy_ctor
,
8
)
ios
*
__thiscall
ios_copy_ctor
(
ios
*
this
,
const
ios
*
copy
)
{
FIXME
(
"(%p %p) stub
\n
"
,
this
,
copy
);
return
this
;
}
/* ??0ios@@IAE@XZ */
/* ??0ios@@IEAA@XZ */
DEFINE_THISCALL_WRAPPER
(
ios_ctor
,
4
)
ios
*
__thiscall
ios_ctor
(
ios
*
this
)
{
FIXME
(
"(%p) stub
\n
"
,
this
);
return
this
;
TRACE
(
"(%p %p)
\n
"
,
this
,
copy
);
this
->
vtable
=
&
MSVCP_ios_vtable
;
this
->
sb
=
NULL
;
this
->
delbuf
=
0
;
InitializeCriticalSection
(
&
this
->
lock
);
return
ios_assign
(
this
,
copy
);
}
/* ??0ios@@QAE@PAVstreambuf@@@Z */
...
...
@@ -725,16 +722,41 @@ ios* __thiscall ios_ctor(ios *this)
DEFINE_THISCALL_WRAPPER
(
ios_sb_ctor
,
8
)
ios
*
__thiscall
ios_sb_ctor
(
ios
*
this
,
streambuf
*
sb
)
{
FIXME
(
"(%p %p) stub
\n
"
,
this
,
sb
);
TRACE
(
"(%p %p)
\n
"
,
this
,
sb
);
this
->
vtable
=
&
MSVCP_ios_vtable
;
this
->
sb
=
sb
;
this
->
state
=
sb
?
IOSTATE_goodbit
:
IOSTATE_badbit
;
this
->
special
[
0
]
=
this
->
special
[
1
]
=
0
;
this
->
delbuf
=
0
;
this
->
tie
=
NULL
;
this
->
flags
=
0
;
this
->
precision
=
6
;
this
->
fill
=
' '
;
this
->
width
=
0
;
this
->
do_lock
=
-
1
;
InitializeCriticalSection
(
&
this
->
lock
);
return
this
;
}
/* ??0ios@@IAE@XZ */
/* ??0ios@@IEAA@XZ */
DEFINE_THISCALL_WRAPPER
(
ios_ctor
,
4
)
ios
*
__thiscall
ios_ctor
(
ios
*
this
)
{
return
ios_sb_ctor
(
this
,
NULL
);
}
/* ??1ios@@UAE@XZ */
/* ??1ios@@UEAA@XZ */
DEFINE_THISCALL_WRAPPER
(
ios_dtor
,
4
)
void
__thiscall
ios_dtor
(
ios
*
this
)
{
FIXME
(
"(%p) stub
\n
"
,
this
);
TRACE
(
"(%p)
\n
"
,
this
);
if
(
this
->
delbuf
&&
this
->
sb
)
MSVCRT_operator_delete
(
this
->
sb
);
this
->
sb
=
NULL
;
this
->
state
=
IOSTATE_badbit
;
DeleteCriticalSection
(
&
this
->
lock
);
}
/* ??4ios@@IAEAAV0@ABV0@@Z */
...
...
@@ -742,7 +764,15 @@ void __thiscall ios_dtor(ios *this)
DEFINE_THISCALL_WRAPPER
(
ios_assign
,
8
)
ios
*
__thiscall
ios_assign
(
ios
*
this
,
const
ios
*
rhs
)
{
FIXME
(
"(%p %p) stub
\n
"
,
this
,
rhs
);
TRACE
(
"(%p %p)
\n
"
,
this
,
rhs
);
this
->
state
=
rhs
->
state
;
if
(
!
this
->
sb
)
this
->
state
|=
IOSTATE_badbit
;
this
->
tie
=
rhs
->
tie
;
this
->
flags
=
rhs
->
flags
;
this
->
precision
=
(
char
)
rhs
->
precision
;
this
->
fill
=
rhs
->
fill
;
this
->
width
=
(
char
)
rhs
->
width
;
return
this
;
}
...
...
@@ -926,7 +956,14 @@ ios* __cdecl ios_hex(ios *this)
DEFINE_THISCALL_WRAPPER
(
ios_init
,
8
)
void
__thiscall
ios_init
(
ios
*
this
,
streambuf
*
sb
)
{
FIXME
(
"(%p %p) stub
\n
"
,
this
,
sb
);
TRACE
(
"(%p %p)
\n
"
,
this
,
sb
);
if
(
this
->
delbuf
&&
this
->
sb
)
MSVCRT_operator_delete
(
this
->
sb
);
this
->
sb
=
sb
;
if
(
sb
==
NULL
)
this
->
state
|=
IOSTATE_badbit
;
else
this
->
state
&=
~
IOSTATE_badbit
;
}
/* ?iword@ios@@QBEAAJH@Z */
...
...
dlls/msvcirt/tests/msvcirt.c
View file @
bc01af8f
...
...
@@ -818,7 +818,6 @@ static void test_ios(void)
/* constructor/destructor */
call_func2
(
p_ios_sb_ctor
,
&
ios_obj
,
NULL
);
todo_wine
{
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
(
ios_obj
.
special
[
0
]
==
0
,
"expected 0 got %d
\n
"
,
ios_obj
.
special
[
0
]);
...
...
@@ -848,7 +847,6 @@ todo_wine {
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
);
}
/* init */
ios_obj
.
state
|=
0x8
;
...
...
@@ -856,10 +854,8 @@ todo_wine {
ok
(
ios_obj
.
sb
==
psb
,
"expected %p got %p
\n
"
,
psb
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
0x8
,
"expected %x got %x
\n
"
,
0x8
,
ios_obj
.
state
);
call_func2
(
p_ios_init
,
&
ios_obj
,
NULL
);
todo_wine
{
ok
(
ios_obj
.
sb
==
NULL
,
"expected %p got %p
\n
"
,
NULL
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
(
0x8
|
IOSTATE_badbit
),
"expected %x got %x
\n
"
,
(
0x8
|
IOSTATE_badbit
),
ios_obj
.
state
);
}
ios_obj
.
sb
=
psb
;
ios_obj
.
delbuf
=
1
;
call_func2
(
p_ios_init
,
&
ios_obj
,
psb
);
...
...
@@ -868,19 +864,15 @@ todo_wine {
/* copy constructor */
call_func2
(
p_ios_copy_ctor
,
&
ios_obj
,
&
ios_obj2
);
todo_wine
{
ok
(
ios_obj
.
sb
==
NULL
,
"expected %p got %p
\n
"
,
NULL
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
(
ios_obj2
.
state
|
IOSTATE_badbit
),
"expected %x got %x
\n
"
,
(
ios_obj2
.
state
|
IOSTATE_badbit
),
ios_obj
.
state
);
ok
(
ios_obj
.
delbuf
==
0
,
"expected 0 got %d
\n
"
,
ios_obj
.
delbuf
);
}
ok
(
ios_obj
.
tie
==
ios_obj2
.
tie
,
"expected %p got %p
\n
"
,
ios_obj2
.
tie
,
ios_obj
.
tie
);
ok
(
ios_obj
.
flags
==
ios_obj2
.
flags
,
"expected %x got %x
\n
"
,
ios_obj2
.
flags
,
ios_obj
.
flags
);
todo_wine
ok
(
ios_obj
.
precision
==
(
char
)
0xab
,
"expected %d got %d
\n
"
,
(
char
)
0xab
,
ios_obj
.
precision
);
ok
(
ios_obj
.
precision
==
(
char
)
0xab
,
"expected %d got %d
\n
"
,
(
char
)
0xab
,
ios_obj
.
precision
);
ok
(
ios_obj
.
fill
==
(
char
)
0xab
,
"expected %d got %d
\n
"
,
(
char
)
0xab
,
ios_obj
.
fill
);
todo_wine
{
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
);
}
/* assignment */
ios_obj
.
state
=
0x8
;
...
...
@@ -892,22 +884,18 @@ todo_wine {
ios_obj
.
width
=
0
;
ios_obj
.
do_lock
=
2
;
call_func2
(
p_ios_assign
,
&
ios_obj
,
&
ios_obj2
);
todo_wine
{
ok
(
ios_obj
.
sb
==
NULL
,
"expected %p got %p
\n
"
,
NULL
,
ios_obj
.
sb
);
ok
(
ios_obj
.
state
==
(
ios_obj2
.
state
|
IOSTATE_badbit
),
"expected %x got %x
\n
"
,
(
ios_obj2
.
state
|
IOSTATE_badbit
),
ios_obj
.
state
);
}
ok
(
ios_obj
.
delbuf
==
2
,
"expected 2 got %d
\n
"
,
ios_obj
.
delbuf
);
todo_wine
{
ok
(
ios_obj
.
tie
==
ios_obj2
.
tie
,
"expected %p got %p
\n
"
,
ios_obj2
.
tie
,
ios_obj
.
tie
);
ok
(
ios_obj
.
flags
==
ios_obj2
.
flags
,
"expected %x got %x
\n
"
,
ios_obj2
.
flags
,
ios_obj
.
flags
);
ok
(
ios_obj
.
precision
==
(
char
)
0xab
,
"expected %d got %d
\n
"
,
(
char
)
0xab
,
ios_obj
.
precision
);
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
==
2
,
"expected 2 got %d
\n
"
,
ios_obj
.
do_lock
);
ios_obj
.
delbuf
=
0
;
call_func1
(
p_ios_dtor
,
&
ios_obj
);
todo_wine
ok
(
ios_obj
.
state
==
IOSTATE_badbit
,
"expected %x got %x
\n
"
,
IOSTATE_badbit
,
ios_obj
.
state
);
ok
(
ios_obj
.
state
==
IOSTATE_badbit
,
"expected %x got %x
\n
"
,
IOSTATE_badbit
,
ios_obj
.
state
);
}
START_TEST
(
msvcirt
)
...
...
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