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
28c61981
Commit
28c61981
authored
Aug 10, 2015
by
Iván Matellanes
Committed by
Alexandre Julliard
Aug 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcirt: Implement filebuf::setbuf.
parent
43bb8163
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
msvcirt.c
dlls/msvcirt/msvcirt.c
+9
-1
msvcirt.c
dlls/msvcirt/tests/msvcirt.c
+30
-0
No files found.
dlls/msvcirt/msvcirt.c
View file @
28c61981
...
...
@@ -1001,8 +1001,16 @@ streampos __thiscall filebuf_seekoff(filebuf *this, streamoff offset, ios_seek_d
DEFINE_THISCALL_WRAPPER
(
filebuf_setbuf
,
12
)
streambuf
*
__thiscall
filebuf_setbuf
(
filebuf
*
this
,
char
*
buffer
,
int
length
)
{
FIXME
(
"(%p %p %d) stub
\n
"
,
this
,
buffer
,
length
);
streambuf
*
ret
;
TRACE
(
"(%p %p %d)
\n
"
,
this
,
buffer
,
length
);
if
(
this
->
base
.
base
!=
NULL
)
return
NULL
;
streambuf_lock
(
&
this
->
base
);
ret
=
streambuf_setbuf
(
&
this
->
base
,
buffer
,
length
);
streambuf_unlock
(
&
this
->
base
);
return
ret
;
}
/* ?setmode@filebuf@@QAEHH@Z */
...
...
dlls/msvcirt/tests/msvcirt.c
View file @
28c61981
...
...
@@ -158,6 +158,7 @@ static filebuf* (*__thiscall p_filebuf_attach)(filebuf*, filedesc);
static
filebuf
*
(
*
__thiscall
p_filebuf_open
)(
filebuf
*
,
const
char
*
,
ios_open_mode
,
int
);
static
filebuf
*
(
*
__thiscall
p_filebuf_close
)(
filebuf
*
);
static
int
(
*
__thiscall
p_filebuf_setmode
)(
filebuf
*
,
int
);
static
streambuf
*
(
*
__thiscall
p_filebuf_setbuf
)(
filebuf
*
,
char
*
,
int
);
/* ios */
static
ios
*
(
*
__thiscall
p_ios_copy_ctor
)(
ios
*
,
const
ios
*
);
...
...
@@ -297,6 +298,7 @@ static BOOL init(void)
SET
(
p_filebuf_open
,
"?open@filebuf@@QEAAPEAV1@PEBDHH@Z"
);
SET
(
p_filebuf_close
,
"?close@filebuf@@QEAAPEAV1@XZ"
);
SET
(
p_filebuf_setmode
,
"?setmode@filebuf@@QEAAHH@Z"
);
SET
(
p_filebuf_setbuf
,
"?setbuf@filebuf@@UEAAPEAVstreambuf@@PEADH@Z"
);
SET
(
p_ios_copy_ctor
,
"??0ios@@IEAA@AEBV0@@Z"
);
SET
(
p_ios_ctor
,
"??0ios@@IEAA@XZ"
);
...
...
@@ -356,6 +358,7 @@ static BOOL init(void)
SET
(
p_filebuf_open
,
"?open@filebuf@@QAEPAV1@PBDHH@Z"
);
SET
(
p_filebuf_close
,
"?close@filebuf@@QAEPAV1@XZ"
);
SET
(
p_filebuf_setmode
,
"?setmode@filebuf@@QAEHH@Z"
);
SET
(
p_filebuf_setbuf
,
"?setbuf@filebuf@@UAEPAVstreambuf@@PADH@Z"
);
SET
(
p_ios_copy_ctor
,
"??0ios@@IAE@ABV0@@Z"
);
SET
(
p_ios_ctor
,
"??0ios@@IAE@XZ"
);
...
...
@@ -997,6 +1000,33 @@ static void test_filebuf(void)
ok
(
thread
!=
NULL
,
"CreateThread failed
\n
"
);
WaitForSingleObject
(
lock_arg
.
lock
,
INFINITE
);
/* setbuf */
fb1
.
base
.
do_lock
=
0
;
pret
=
(
filebuf
*
)
call_func3
(
p_filebuf_setbuf
,
&
fb1
,
read_buffer
,
16
);
ok
(
pret
==
&
fb1
,
"wrong return, expected %p got %p
\n
"
,
&
fb1
,
pret
);
ok
(
fb1
.
base
.
allocated
==
0
,
"wrong allocate value, expected 0 got %d
\n
"
,
fb1
.
base
.
allocated
);
ok
(
fb1
.
base
.
base
==
read_buffer
,
"wrong buffer, expected %p got %p
\n
"
,
read_buffer
,
fb1
.
base
.
base
);
ok
(
fb1
.
base
.
pbase
==
NULL
,
"wrong put area, expected %p got %p
\n
"
,
NULL
,
fb1
.
base
.
pbase
);
fb1
.
base
.
pbase
=
fb1
.
base
.
pptr
=
fb1
.
base
.
base
;
fb1
.
base
.
epptr
=
fb1
.
base
.
ebuf
;
fb1
.
base
.
do_lock
=
-
1
;
pret
=
(
filebuf
*
)
call_func3
(
p_filebuf_setbuf
,
&
fb1
,
read_buffer
,
16
);
ok
(
pret
==
NULL
,
"wrong return, expected %p got %p
\n
"
,
NULL
,
pret
);
ok
(
fb1
.
base
.
allocated
==
0
,
"wrong allocate value, expected 0 got %d
\n
"
,
fb1
.
base
.
allocated
);
ok
(
fb1
.
base
.
base
==
read_buffer
,
"wrong buffer, expected %p got %p
\n
"
,
read_buffer
,
fb1
.
base
.
base
);
ok
(
fb1
.
base
.
pbase
==
read_buffer
,
"wrong put area, expected %p got %p
\n
"
,
read_buffer
,
fb1
.
base
.
pbase
);
fb1
.
base
.
base
=
fb1
.
base
.
ebuf
=
NULL
;
fb1
.
base
.
do_lock
=
0
;
pret
=
(
filebuf
*
)
call_func3
(
p_filebuf_setbuf
,
&
fb1
,
read_buffer
,
0
);
ok
(
pret
==
&
fb1
,
"wrong return, expected %p got %p
\n
"
,
&
fb1
,
pret
);
ok
(
fb1
.
base
.
allocated
==
0
,
"wrong allocate value, expected 0 got %d
\n
"
,
fb1
.
base
.
allocated
);
ok
(
fb1
.
base
.
unbuffered
==
1
,
"wrong unbuffered value, expected 1 got %d
\n
"
,
fb1
.
base
.
unbuffered
);
ok
(
fb1
.
base
.
base
==
NULL
,
"wrong buffer, expected %p got %p
\n
"
,
NULL
,
fb1
.
base
.
base
);
ok
(
fb1
.
base
.
pbase
==
read_buffer
,
"wrong put area, expected %p got %p
\n
"
,
read_buffer
,
fb1
.
base
.
pbase
);
fb1
.
base
.
pbase
=
fb1
.
base
.
pptr
=
fb1
.
base
.
epptr
=
NULL
;
fb1
.
base
.
unbuffered
=
0
;
fb1
.
base
.
do_lock
=
-
1
;
/* attach */
pret
=
(
filebuf
*
)
call_func2
(
p_filebuf_attach
,
&
fb1
,
2
);
ok
(
pret
==
NULL
,
"wrong return, expected %p got %p
\n
"
,
NULL
,
pret
);
...
...
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