Commit 52f374ad authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat: Implement IsEndOfStream() for file stream.

parent 6da78ff6
...@@ -2648,16 +2648,25 @@ static HRESULT WINAPI mfbytestream_SetCurrentPosition(IMFByteStream *iface, QWOR ...@@ -2648,16 +2648,25 @@ static HRESULT WINAPI mfbytestream_SetCurrentPosition(IMFByteStream *iface, QWOR
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI mfbytestream_IsEndOfStream(IMFByteStream *iface, BOOL *endstream) static HRESULT WINAPI bytestream_file_IsEndOfStream(IMFByteStream *iface, BOOL *ret)
{ {
mfbytestream *This = impl_from_IMFByteStream(iface); struct bytestream *stream = impl_from_IMFByteStream(iface);
LARGE_INTEGER position, length;
HRESULT hr = S_OK;
FIXME("%p, %p\n", This, endstream); TRACE("%p, %p.\n", iface, ret);
if(endstream) EnterCriticalSection(&stream->cs);
*endstream = TRUE;
return S_OK; position.QuadPart = 0;
if (SetFilePointerEx(stream->hfile, position, &length, FILE_END))
*ret = stream->position >= length.QuadPart;
else
hr = HRESULT_FROM_WIN32(GetLastError());
LeaveCriticalSection(&stream->cs);
return hr;
} }
static HRESULT WINAPI bytestream_file_Read(IMFByteStream *iface, BYTE *buffer, ULONG size, ULONG *read_len) static HRESULT WINAPI bytestream_file_Read(IMFByteStream *iface, BYTE *buffer, ULONG size, ULONG *read_len)
...@@ -2771,7 +2780,7 @@ static const IMFByteStreamVtbl bytestream_file_vtbl = ...@@ -2771,7 +2780,7 @@ static const IMFByteStreamVtbl bytestream_file_vtbl =
mfbytestream_SetLength, mfbytestream_SetLength,
mfbytestream_GetCurrentPosition, mfbytestream_GetCurrentPosition,
mfbytestream_SetCurrentPosition, mfbytestream_SetCurrentPosition,
mfbytestream_IsEndOfStream, bytestream_file_IsEndOfStream,
bytestream_file_Read, bytestream_file_Read,
bytestream_BeginRead, bytestream_BeginRead,
bytestream_EndRead, bytestream_EndRead,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment