Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
06d055f0
Commit
06d055f0
authored
Dec 09, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msado15: Implement _Stream_get_Position and _Stream_put_Position.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
59c8fb9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
5 deletions
+54
-5
stream.c
dlls/msado15/stream.c
+18
-4
msado15.c
dlls/msado15/tests/msado15.c
+36
-1
No files found.
dlls/msado15/stream.c
View file @
06d055f0
...
...
@@ -125,8 +125,13 @@ static HRESULT WINAPI stream_get_EOS( _Stream *iface, VARIANT_BOOL *eos )
static
HRESULT
WINAPI
stream_get_Position
(
_Stream
*
iface
,
LONG
*
pos
)
{
FIXME
(
"%p, %p
\n
"
,
iface
,
pos
);
return
E_NOTIMPL
;
struct
stream
*
stream
=
impl_from_Stream
(
iface
);
TRACE
(
"%p, %p
\n
"
,
stream
,
pos
);
if
(
stream
->
state
==
adStateClosed
)
return
MAKE_ADO_HRESULT
(
adErrObjectClosed
);
*
pos
=
stream
->
pos
;
return
S_OK
;
}
static
HRESULT
resize_buffer
(
struct
stream
*
stream
,
LONG
size
)
...
...
@@ -145,8 +150,17 @@ static HRESULT resize_buffer( struct stream *stream, LONG size )
static
HRESULT
WINAPI
stream_put_Position
(
_Stream
*
iface
,
LONG
pos
)
{
FIXME
(
"%p, %d
\n
"
,
iface
,
pos
);
return
E_NOTIMPL
;
struct
stream
*
stream
=
impl_from_Stream
(
iface
);
HRESULT
hr
;
TRACE
(
"%p, %d
\n
"
,
stream
,
pos
);
if
(
stream
->
state
==
adStateClosed
)
return
MAKE_ADO_HRESULT
(
adErrObjectClosed
);
if
(
pos
<
0
)
return
MAKE_ADO_HRESULT
(
adErrInvalidArgument
);
if
((
hr
=
resize_buffer
(
stream
,
stream
->
pos
))
!=
S_OK
)
return
hr
;
stream
->
pos
=
pos
;
return
S_OK
;
}
static
HRESULT
WINAPI
stream_get_Type
(
_Stream
*
iface
,
StreamTypeEnum
*
type
)
...
...
dlls/msado15/tests/msado15.c
View file @
06d055f0
...
...
@@ -50,7 +50,7 @@ static void test_Stream(void)
{
_Stream
*
stream
;
StreamTypeEnum
type
;
LONG
refs
;
LONG
refs
,
pos
;
ObjectStateEnum
state
;
VARIANT
missing
,
val
;
HRESULT
hr
;
...
...
@@ -58,6 +58,12 @@ static void test_Stream(void)
hr
=
CoCreateInstance
(
&
CLSID_Stream
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Stream
,
(
void
**
)
&
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
hr
=
_Stream_put_Position
(
stream
,
0
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
/* check default type */
type
=
0
;
hr
=
_Stream_get_Type
(
stream
,
&
type
);
...
...
@@ -97,9 +103,19 @@ static void test_Stream(void)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
adStateOpen
,
"got %u
\n
"
,
state
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
pos
,
"got %d
\n
"
,
pos
);
hr
=
_Stream_Read
(
stream
,
2
,
&
val
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrIllegalOperation
),
"got %08x
\n
"
,
hr
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
pos
,
"got %d
\n
"
,
pos
);
hr
=
_Stream_Close
(
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -139,6 +155,25 @@ static void test_Stream(void)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
VariantClear
(
&
val
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
pos
==
4
,
"got %d
\n
"
,
pos
);
hr
=
_Stream_put_Position
(
stream
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
VariantInit
(
&
val
);
hr
=
_Stream_Read
(
stream
,
adReadAll
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
V_VT
(
&
val
)
==
(
VT_ARRAY
|
VT_UI1
),
"got %04x
\n
"
,
V_VT
(
&
val
)
);
VariantClear
(
&
val
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
pos
==
4
,
"got %d
\n
"
,
pos
);
refs
=
_Stream_Release
(
stream
);
ok
(
!
refs
,
"got %d
\n
"
,
refs
);
}
...
...
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