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
6da78ff6
Commit
6da78ff6
authored
May 06, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Implement Read() for file-based stream.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
59599486
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
main.c
dlls/mfplat/main.c
+27
-12
No files found.
dlls/mfplat/main.c
View file @
6da78ff6
...
...
@@ -2660,13 +2660,30 @@ static HRESULT WINAPI mfbytestream_IsEndOfStream(IMFByteStream *iface, BOOL *end
return
S_OK
;
}
static
HRESULT
WINAPI
mfbytestream_Read
(
IMFByteStream
*
iface
,
BYTE
*
data
,
ULONG
count
,
ULONG
*
byte_read
)
static
HRESULT
WINAPI
bytestream_file_Read
(
IMFByteStream
*
iface
,
BYTE
*
buffer
,
ULONG
size
,
ULONG
*
read_len
)
{
mfbytestream
*
This
=
impl_from_IMFByteStream
(
iface
);
struct
bytestream
*
stream
=
impl_from_IMFByteStream
(
iface
);
LARGE_INTEGER
position
;
HRESULT
hr
=
S_OK
;
BOOL
ret
;
TRACE
(
"%p, %p, %u, %p.
\n
"
,
iface
,
buffer
,
size
,
read_len
);
FIXME
(
"%p, %p, %u, %p
\n
"
,
This
,
data
,
count
,
byte_read
);
EnterCriticalSection
(
&
stream
->
cs
);
return
E_NOTIMPL
;
position
.
QuadPart
=
stream
->
position
;
if
((
ret
=
SetFilePointerEx
(
stream
->
hfile
,
position
,
NULL
,
FILE_BEGIN
)))
{
if
((
ret
=
ReadFile
(
stream
->
hfile
,
buffer
,
size
,
read_len
,
NULL
)))
stream
->
position
+=
*
read_len
;
}
if
(
!
ret
)
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
LeaveCriticalSection
(
&
stream
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
bytestream_BeginRead
(
IMFByteStream
*
iface
,
BYTE
*
data
,
ULONG
size
,
IMFAsyncCallback
*
callback
,
...
...
@@ -2744,7 +2761,7 @@ static HRESULT WINAPI mfbytestream_Close(IMFByteStream *iface)
return
E_NOTIMPL
;
}
static
const
IMFByteStreamVtbl
mfbytestream
_vtbl
=
static
const
IMFByteStreamVtbl
bytestream_file
_vtbl
=
{
bytestream_QueryInterface
,
bytestream_AddRef
,
...
...
@@ -2755,7 +2772,7 @@ static const IMFByteStreamVtbl mfbytestream_vtbl =
mfbytestream_GetCurrentPosition
,
mfbytestream_SetCurrentPosition
,
mfbytestream_IsEndOfStream
,
mfbytestream
_Read
,
bytestream_file
_Read
,
bytestream_BeginRead
,
bytestream_EndRead
,
mfbytestream_Write
,
...
...
@@ -3209,16 +3226,14 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open
LPCWSTR
url
,
IMFByteStream
**
bytestream
)
{
DWORD
capabilities
=
MFBYTESTREAM_IS_SEEKABLE
|
MFBYTESTREAM_DOES_NOT_USE_NETWORK
;
struct
bytestream
*
object
;
DWORD
fileaccessmode
=
0
;
DWORD
filecreation_disposition
=
0
,
fileaccessmode
=
0
,
fileattributes
=
0
;
DWORD
filesharemode
=
FILE_SHARE_READ
;
DWORD
filecreation_disposition
=
0
;
DWORD
fileattributes
=
0
;
struct
bytestream
*
object
;
FILETIME
writetime
;
HANDLE
file
;
HRESULT
hr
;
FIXME
(
"(%d, %d, %d, %s, %p): stub
\n
"
,
accessmode
,
openmode
,
flags
,
debugstr_w
(
url
),
bytestream
);
TRACE
(
"%d, %d, %#x, %s, %p.
\n
"
,
accessmode
,
openmode
,
flags
,
debugstr_w
(
url
),
bytestream
);
switch
(
accessmode
)
{
...
...
@@ -3279,7 +3294,7 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open
heap_free
(
object
);
return
hr
;
}
object
->
IMFByteStream_iface
.
lpVtbl
=
&
mfbytestream
_vtbl
;
object
->
IMFByteStream_iface
.
lpVtbl
=
&
bytestream_file
_vtbl
;
object
->
attributes
.
IMFAttributes_iface
.
lpVtbl
=
&
mfbytestream_attributes_vtbl
;
object
->
IMFGetService_iface
.
lpVtbl
=
&
bytestream_file_getservice_vtbl
;
object
->
read_callback
.
lpVtbl
=
&
bytestream_file_read_callback_vtbl
;
...
...
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