Commit b00be289 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplat: Return capabilities for file stream.

parent b74b5991
...@@ -2823,6 +2823,7 @@ static const IMFGetServiceVtbl bytestream_file_getservice_vtbl = ...@@ -2823,6 +2823,7 @@ static const IMFGetServiceVtbl bytestream_file_getservice_vtbl =
HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE openmode, MF_FILE_FLAGS flags, HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE openmode, MF_FILE_FLAGS flags,
LPCWSTR url, IMFByteStream **bytestream) LPCWSTR url, IMFByteStream **bytestream)
{ {
DWORD capabilities = MFBYTESTREAM_IS_SEEKABLE | MFBYTESTREAM_DOES_NOT_USE_NETWORK;
struct bytestream *object; struct bytestream *object;
DWORD fileaccessmode = 0; DWORD fileaccessmode = 0;
DWORD filesharemode = FILE_SHARE_READ; DWORD filesharemode = FILE_SHARE_READ;
...@@ -2838,12 +2839,15 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open ...@@ -2838,12 +2839,15 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open
{ {
case MF_ACCESSMODE_READ: case MF_ACCESSMODE_READ:
fileaccessmode = GENERIC_READ; fileaccessmode = GENERIC_READ;
capabilities |= MFBYTESTREAM_IS_READABLE;
break; break;
case MF_ACCESSMODE_WRITE: case MF_ACCESSMODE_WRITE:
fileaccessmode = GENERIC_WRITE; fileaccessmode = GENERIC_WRITE;
capabilities |= MFBYTESTREAM_IS_WRITABLE;
break; break;
case MF_ACCESSMODE_READWRITE: case MF_ACCESSMODE_READWRITE:
fileaccessmode = GENERIC_READ | GENERIC_WRITE; fileaccessmode = GENERIC_READ | GENERIC_WRITE;
capabilities |= (MFBYTESTREAM_IS_READABLE | MFBYTESTREAM_IS_WRITABLE);
break; break;
} }
...@@ -2897,6 +2901,7 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open ...@@ -2897,6 +2901,7 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open
object->write_callback.lpVtbl = &bytestream_file_write_callback_vtbl; object->write_callback.lpVtbl = &bytestream_file_write_callback_vtbl;
InitializeCriticalSection(&object->cs); InitializeCriticalSection(&object->cs);
list_init(&object->pending); list_init(&object->pending);
object->capabilities = capabilities;
object->hfile = file; object->hfile = file;
if (GetFileTime(file, NULL, NULL, &writetime)) if (GetFileTime(file, NULL, NULL, &writetime))
......
...@@ -1153,7 +1153,6 @@ static void test_file_stream(void) ...@@ -1153,7 +1153,6 @@ static void test_file_stream(void)
ok(hr == S_OK, "Failed to get stream capabilities, hr %#x.\n", hr); ok(hr == S_OK, "Failed to get stream capabilities, hr %#x.\n", hr);
if (is_win8_plus) if (is_win8_plus)
{ {
todo_wine
ok(caps == (MFBYTESTREAM_IS_READABLE | MFBYTESTREAM_IS_SEEKABLE | MFBYTESTREAM_DOES_NOT_USE_NETWORK), ok(caps == (MFBYTESTREAM_IS_READABLE | MFBYTESTREAM_IS_SEEKABLE | MFBYTESTREAM_DOES_NOT_USE_NETWORK),
"Unexpected caps %#x.\n", caps); "Unexpected caps %#x.\n", caps);
} }
......
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