Rebase against 18e2df401eb545f0ce490daaaf12a6c1c248119f.

This commit is contained in:
Zebediah Figura 2018-09-10 20:28:36 -05:00
parent 28e66e552f
commit 6e0d8f18d9
11 changed files with 29 additions and 939 deletions

View File

@ -1,25 +0,0 @@
From 29ac40e7943195bda7acbc0ffa5cc966d8c1a40a Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Mon, 31 Aug 2015 22:54:59 -0300
Subject: crypt32: Print CryptUnprotectMemory FIXME only once.
---
dlls/crypt32/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/crypt32/main.c b/dlls/crypt32/main.c
index 241a1d9..696195a 100644
--- a/dlls/crypt32/main.c
+++ b/dlls/crypt32/main.c
@@ -259,6 +259,7 @@ BOOL WINAPI CryptProtectMemory(void *data, DWORD len, DWORD flags)
BOOL WINAPI CryptUnprotectMemory(void *data, DWORD len, DWORD flags)
{
- FIXME("(%p %u %08x): stub\n", data, len, flags);
+ static int fixme_once;
+ if (!fixme_once++) FIXME("(%p %u %08x): stub\n", data, len, flags);
return TRUE;
}
--
2.5.0

View File

@ -1,328 +0,0 @@
From 5a5a686df602a66a5211bee21e127011456e6491 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 24 Aug 2018 11:20:54 +1000
Subject: [PATCH] mfplat: Implement MFCreateMFByteStreamOnStream
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45372
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/mfplat/main.c | 240 +++++++++++++++++++++++++++++++++++++++++++++
dlls/mfplat/mfplat.spec | 2 +-
dlls/mfplat/tests/mfplat.c | 17 ++++
include/mfidl.idl | 1 +
4 files changed, 259 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index e429324..2209924 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -424,6 +424,246 @@ HRESULT WINAPI MFShutdown(void)
return S_OK;
}
+
+typedef struct _mfbytestream
+{
+ IMFByteStream IMFByteStream_iface;
+ LONG ref;
+} mfbytestream;
+
+static inline mfbytestream *impl_from_IMFByteStream(IMFByteStream *iface)
+{
+ return CONTAINING_RECORD(iface, mfbytestream, IMFByteStream_iface);
+}
+
+static HRESULT WINAPI mfbytestream_QueryInterface(IMFByteStream *iface, REFIID riid, void **out)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
+
+ if(IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IMFByteStream))
+ {
+ *out = &This->IMFByteStream_iface;
+ }
+ else
+ {
+ FIXME("(%s, %p)\n", debugstr_guid(riid), out);
+ *out = NULL;
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown*)*out);
+ return S_OK;
+}
+
+static ULONG WINAPI mfbytestream_AddRef(IMFByteStream *iface)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI mfbytestream_Release(IMFByteStream *iface)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ if (!ref)
+ {
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+
+ return ref;
+}
+
+static HRESULT WINAPI mfbytestream_GetCapabilities(IMFByteStream *iface, DWORD *capabilities)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p\n", This, capabilities);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_GetLength(IMFByteStream *iface, QWORD *length)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p\n", This, length);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_SetLength(IMFByteStream *iface, QWORD length)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %s\n", This, wine_dbgstr_longlong(length));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_GetCurrentPosition(IMFByteStream *iface, QWORD *position)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p\n", This, position);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_SetCurrentPosition(IMFByteStream *iface, QWORD position)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %s\n", This, wine_dbgstr_longlong(position));
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_IsEndOfStream(IMFByteStream *iface, BOOL *endstream)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p\n", This, endstream);
+
+ if(endstream)
+ *endstream = TRUE;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI mfbytestream_Read(IMFByteStream *iface, BYTE *data, ULONG count, ULONG *byte_read)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p, %u, %p\n", This, data, count, byte_read);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_BeginRead(IMFByteStream *iface, BYTE *data, ULONG count,
+ IMFAsyncCallback *callback, IUnknown *state)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p, %u, %p, %p\n", This, data, count, callback, state);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_EndRead(IMFByteStream *iface, IMFAsyncResult *result, ULONG *byte_read)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p, %p\n", This, result, byte_read);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_Write(IMFByteStream *iface, const BYTE *data, ULONG count, ULONG *written)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p, %u, %p\n", This, data, count, written);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_BeginWrite(IMFByteStream *iface, const BYTE *data, ULONG count,
+ IMFAsyncCallback *callback, IUnknown *state)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p, %u, %p, %p\n", This, data, count, callback, state);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_EndWrite(IMFByteStream *iface, IMFAsyncResult *result, ULONG *written)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %p, %p\n", This, result, written);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_Seek(IMFByteStream *iface, MFBYTESTREAM_SEEK_ORIGIN seek, LONGLONG offset,
+ DWORD flags, QWORD *current)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p, %u, %s, 0x%08x, %p\n", This, seek, wine_dbgstr_longlong(offset), flags, current);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_Flush(IMFByteStream *iface)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI mfbytestream_Close(IMFByteStream *iface)
+{
+ mfbytestream *This = impl_from_IMFByteStream(iface);
+
+ FIXME("%p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static const IMFByteStreamVtbl mfbytesteam_vtbl =
+{
+ mfbytestream_QueryInterface,
+ mfbytestream_AddRef,
+ mfbytestream_Release,
+ mfbytestream_GetCapabilities,
+ mfbytestream_GetLength,
+ mfbytestream_SetLength,
+ mfbytestream_GetCurrentPosition,
+ mfbytestream_SetCurrentPosition,
+ mfbytestream_IsEndOfStream,
+ mfbytestream_Read,
+ mfbytestream_BeginRead,
+ mfbytestream_EndRead,
+ mfbytestream_Write,
+ mfbytestream_BeginWrite,
+ mfbytestream_EndWrite,
+ mfbytestream_Seek,
+ mfbytestream_Flush,
+ mfbytestream_Close
+};
+
+HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **bytestream)
+{
+ mfbytestream *object;
+
+ TRACE("(%p, %p): stub\n", stream, bytestream);
+
+ object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
+ if(!object)
+ return E_OUTOFMEMORY;
+
+ object->ref = 1;
+ object->IMFByteStream_iface.lpVtbl = &mfbytesteam_vtbl;
+
+ *bytestream = &object->IMFByteStream_iface;
+
+ return S_OK;
+}
+
static HRESULT WINAPI MFPluginControl_QueryInterface(IMFPluginControl *iface, REFIID riid, void **ppv)
{
if(IsEqualGUID(riid, &IID_IUnknown)) {
diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec
index 0ad15a5..b98e24a 100644
--- a/dlls/mfplat/mfplat.spec
+++ b/dlls/mfplat/mfplat.spec
@@ -45,7 +45,7 @@
@ stdcall MFCreateEventQueue(ptr)
@ stub MFCreateFile
@ stub MFCreateLegacyMediaBufferOnMFMediaBuffer
-@ stub MFCreateMFByteStreamOnStream
+@ stdcall MFCreateMFByteStreamOnStream(ptr ptr)
@ stub MFCreateMFVideoFormatFromMFMediaType
@ stub MFCreateMediaBufferWrapper
@ stub MFCreateMediaEvent
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index f5a3197..c59f0cc 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -266,6 +266,22 @@ static void test_MFSample(void)
IMFSample_Release(sample);
}
+static void test_MFCreateMFByteStreamOnStream(void)
+{
+ IMFByteStream *bytestream;
+ IStream *stream;
+ HRESULT hr;
+
+ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = MFCreateMFByteStreamOnStream(stream, &bytestream );
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ IStream_Release(stream);
+ IMFByteStream_Release(bytestream);
+}
+
START_TEST(mfplat)
{
CoInitialize(NULL);
@@ -277,6 +293,7 @@ START_TEST(mfplat)
test_MFCreateMediaType();
test_MFCreateAttributes();
test_MFSample();
+ test_MFCreateMFByteStreamOnStream();
CoUninitialize();
}
diff --git a/include/mfidl.idl b/include/mfidl.idl
index 12b351d..84be055 100644
--- a/include/mfidl.idl
+++ b/include/mfidl.idl
@@ -251,6 +251,7 @@ interface IMFGetService : IUnknown
}
cpp_quote("HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **session);")
+cpp_quote("HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **bytestream);" )
cpp_quote("HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver);")
cpp_quote("HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD cMediaTypes,")
cpp_quote(" IMFMediaType **types, IMFStreamDescriptor **descriptor);")
--
1.9.1

View File

@ -1,3 +0,0 @@
Fixes: [45372] Implement MFCreateMFByteStreamOnStream.
# Required because of tests.
Depends: mfplat-MFCreateSample

View File

@ -1,324 +0,0 @@
From 612778028be2aa70c35f4b86bcc39ec1baeacd6c Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 28 Aug 2018 10:16:45 +1000
Subject: [PATCH] mfplat: Implement MFCreateMemoryBuffer
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45715
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/mfplat/main.c | 176 +++++++++++++++++++++++++++++++++++++++++++++
dlls/mfplat/mfplat.spec | 2 +-
dlls/mfplat/tests/mfplat.c | 80 +++++++++++++++++++++
include/mfapi.h | 1 +
4 files changed, 258 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 2209924..648a782 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -2603,3 +2603,179 @@ HRESULT WINAPI MFCreateSample(IMFSample **sample)
return S_OK;
}
+
+
+typedef struct _mfbuffer
+{
+ IMFMediaBuffer IMFMediaBuffer_iface;
+ LONG ref;
+
+ BYTE *buffer;
+ DWORD max_length;
+ DWORD current;
+} mfbuffer;
+
+static inline mfbuffer *impl_from_IMFMediaBuffer(IMFMediaBuffer *iface)
+{
+ return CONTAINING_RECORD(iface, mfbuffer, IMFMediaBuffer_iface);
+}
+
+static HRESULT WINAPI mfbuffer_QueryInterface(IMFMediaBuffer *iface, REFIID riid, void **out)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
+
+ if(IsEqualGUID(riid, &IID_IUnknown) ||
+ IsEqualGUID(riid, &IID_IMFMediaBuffer))
+ {
+ *out = &This->IMFMediaBuffer_iface;
+ }
+ else
+ {
+ FIXME("(%s, %p)\n", debugstr_guid(riid), out);
+ *out = NULL;
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown*)*out);
+ return S_OK;
+}
+
+static ULONG WINAPI mfbuffer_AddRef(IMFMediaBuffer *iface)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+ ULONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ return ref;
+}
+
+static ULONG WINAPI mfbuffer_Release(IMFMediaBuffer *iface)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+ ULONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%u\n", This, ref);
+
+ if (!ref)
+ {
+ heap_free(This->buffer);
+ heap_free(This);
+ }
+
+ return ref;
+}
+
+static HRESULT WINAPI mfbuffer_Lock(IMFMediaBuffer *iface, BYTE **buffer, DWORD *max, DWORD *current)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+
+ TRACE("%p, %p %p, %p\n", This, buffer, max, current);
+
+ if(!buffer)
+ return E_INVALIDARG;
+
+ *buffer = This->buffer;
+ if(max)
+ *max = This->max_length;
+ if(current)
+ *current = This->current;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI mfbuffer_Unlock(IMFMediaBuffer *iface)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+
+ TRACE("%p\n", This);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI mfbuffer_GetCurrentLength(IMFMediaBuffer *iface, DWORD *current)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+
+ TRACE("%p\n", This);
+
+ if(!current)
+ return E_INVALIDARG;
+
+ *current = This->current;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI mfbuffer_SetCurrentLength(IMFMediaBuffer *iface, DWORD current)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+
+ TRACE("%p, %u\n", This, current);
+
+ if(current > This->max_length)
+ return E_INVALIDARG;
+
+ This->current = current;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI mfbuffer_GetMaxLength(IMFMediaBuffer *iface, DWORD *max)
+{
+ mfbuffer *This = impl_from_IMFMediaBuffer(iface);
+
+ TRACE("%p, %p\n", This, max);
+
+ if(!max)
+ return E_INVALIDARG;
+
+ *max = This->max_length;
+
+ return S_OK;
+}
+
+static const IMFMediaBufferVtbl mfbuffer_vtbl =
+{
+ mfbuffer_QueryInterface,
+ mfbuffer_AddRef,
+ mfbuffer_Release,
+ mfbuffer_Lock,
+ mfbuffer_Unlock,
+ mfbuffer_GetCurrentLength,
+ mfbuffer_SetCurrentLength,
+ mfbuffer_GetMaxLength
+};
+
+HRESULT WINAPI MFCreateMemoryBuffer(DWORD max_length, IMFMediaBuffer **buffer)
+{
+ mfbuffer *object;
+ BYTE *bytes;
+
+ TRACE("%u, %p\n", max_length, buffer);
+
+ if(!buffer)
+ return E_INVALIDARG;
+
+ object = heap_alloc( sizeof(*object) );
+ if(!object)
+ return E_OUTOFMEMORY;
+
+ bytes = heap_alloc( max_length );
+ if(!bytes)
+ {
+ heap_free(object);
+ return E_OUTOFMEMORY;
+ }
+
+ object->ref = 1;
+ object->max_length = max_length;
+ object->current = 0;
+ object->buffer = bytes;
+ object->IMFMediaBuffer_iface.lpVtbl = &mfbuffer_vtbl;
+ *buffer = &object->IMFMediaBuffer_iface;
+
+ return S_OK;
+}
diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec
index b98e24a..8503b20 100644
--- a/dlls/mfplat/mfplat.spec
+++ b/dlls/mfplat/mfplat.spec
@@ -51,7 +51,7 @@
@ stub MFCreateMediaEvent
@ stdcall MFCreateMediaType(ptr)
@ stub MFCreateMediaTypeFromRepresentation
-@ stub MFCreateMemoryBuffer
+@ stdcall MFCreateMemoryBuffer(long ptr)
@ stub MFCreateMemoryStream
@ stub MFCreatePathFromURL
@ stub MFCreatePresentationDescriptor
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index c59f0cc..9fd3bbe 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -282,6 +282,85 @@ static void test_MFCreateMFByteStreamOnStream(void)
IMFByteStream_Release(bytestream);
}
+static void test_MFCreateMemoryBuffer(void)
+{
+ IMFMediaBuffer *buffer;
+ HRESULT hr;
+ DWORD length, max;
+ BYTE data;
+
+ hr = MFCreateMemoryBuffer(1024, NULL);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ hr = MFCreateMemoryBuffer(0, &buffer);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ if(buffer)
+ {
+ hr = IMFMediaBuffer_GetMaxLength(buffer, &length);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(length == 0, "got %u\n", length);
+
+ IMFMediaBuffer_Release(buffer);
+ }
+
+ hr = MFCreateMemoryBuffer(1024, &buffer);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_GetMaxLength(buffer, NULL);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_GetMaxLength(buffer, &length);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(length == 1024, "got %u\n", length);
+
+ hr = IMFMediaBuffer_SetCurrentLength(buffer, 1025);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_SetCurrentLength(buffer, 10);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_GetCurrentLength(buffer, NULL);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_GetCurrentLength(buffer, &length);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(length == 10, "got %u\n", length);
+
+ length = 0;
+ max = 0;
+ hr = IMFMediaBuffer_Lock(buffer, NULL, &length, &max);
+ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
+ ok(length == 0, "got %u\n", length);
+ ok(max == 0, "got %u\n", length);
+
+ hr = IMFMediaBuffer_Lock(buffer, (BYTE**)&data, &max, &length);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(length == 10, "got %u\n", length);
+ ok(max == 1024, "got %u\n", max);
+
+ /* Attempt to lock the bufer twice */
+ hr = IMFMediaBuffer_Lock(buffer, (BYTE**)&data, &max, &length);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_Unlock(buffer);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_Unlock(buffer);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_Lock(buffer, (BYTE**)&data, NULL, NULL);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ hr = IMFMediaBuffer_Unlock(buffer);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ /* Extra Unlock */
+ hr = IMFMediaBuffer_Unlock(buffer);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+
+ IMFMediaBuffer_Release(buffer);
+}
+
START_TEST(mfplat)
{
CoInitialize(NULL);
@@ -294,6 +373,7 @@ START_TEST(mfplat)
test_MFCreateAttributes();
test_MFSample();
test_MFCreateMFByteStreamOnStream();
+ test_MFCreateMemoryBuffer();
CoUninitialize();
}
diff --git a/include/mfapi.h b/include/mfapi.h
index 978726b..a4f0dfe 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -67,6 +67,7 @@ HRESULT WINAPI MFCancelWorkItem(MFWORKITEM_KEY key);
HRESULT WINAPI MFCreateAttributes(IMFAttributes **attributes, UINT32 size);
HRESULT WINAPI MFCreateEventQueue(IMFMediaEventQueue **queue);
HRESULT WINAPI MFCreateMediaType(IMFMediaType **type);
+HRESULT WINAPI MFCreateMemoryBuffer(DWORD max_length, IMFMediaBuffer **buffer);
HRESULT WINAPI MFCreateSample(IMFSample **sample);
HRESULT WINAPI MFGetTimerPeriodicity(DWORD *periodicity);
HRESULT WINAPI MFTEnum(GUID category, UINT32 flags, MFT_REGISTER_TYPE_INFO *input_type,
--
1.9.1

View File

@ -1,3 +0,0 @@
Fixes: [45715] Implement MFCreateMemoryBuffer.
# Required because of tests.
Depends: mfplat-MFCreateMFByteStreamOnStream

View File

@ -1,27 +1,18 @@
From 2c97bba1bdd02bb72d185635c7f162024be521b4 Mon Sep 17 00:00:00 2001
From 794bad144407eaaa1c046984dae2942d75a7afe1 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 23 Aug 2018 12:22:07 +1000
Subject: [PATCH 1/3] mfplat: Forward IMFMediaType to IMFAttributes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/mfplat/main.c | 166 ++++++++++++---------------------------------
1 file changed, 42 insertions(+), 124 deletions(-)
dlls/mfplat/main.c | 164 ++++++++++++++---------------------------------------
1 file changed, 41 insertions(+), 123 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index df61f3cdc9..744f074b56 100644
index 9f381ef..ee9be91 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -31,7 +31,7 @@
#include "mfapi.h"
#include "mfidl.h"
#include "mferror.h"
-
+#include "wine/heap.h"
#include "wine/debug.h"
#include "wine/unicode.h"
@@ -890,6 +890,12 @@ static const IMFAttributesVtbl mfattributes_vtbl =
@@ -1148,6 +1148,12 @@ static const IMFAttributesVtbl mfattributes_vtbl =
mfattributes_CopyAllItems
};
@ -34,7 +25,7 @@ index df61f3cdc9..744f074b56 100644
/***********************************************************************
* MFCreateAttributes (mfplat.@)
*/
@@ -903,10 +909,9 @@ HRESULT WINAPI MFCreateAttributes(IMFAttributes **attributes, UINT32 size)
@@ -1161,10 +1167,9 @@ HRESULT WINAPI MFCreateAttributes(IMFAttributes **attributes, UINT32 size)
if(!object)
return E_OUTOFMEMORY;
@ -47,7 +38,7 @@ index df61f3cdc9..744f074b56 100644
return S_OK;
}
@@ -1077,6 +1082,7 @@ HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver)
@@ -1335,6 +1340,7 @@ HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver)
typedef struct _mfmediatype
{
@ -55,7 +46,7 @@ index df61f3cdc9..744f074b56 100644
IMFMediaType IMFMediaType_iface;
LONG ref;
} mfmediatype;
@@ -1137,269 +1143,179 @@ static ULONG WINAPI mediatype_Release(IMFMediaType *iface)
@@ -1395,269 +1401,179 @@ static ULONG WINAPI mediatype_Release(IMFMediaType *iface)
static HRESULT WINAPI mediatype_GetItem(IMFMediaType *iface, REFGUID key, PROPVARIANT *value)
{
mfmediatype *This = impl_from_IMFMediaType(iface);
@ -354,7 +345,7 @@ index df61f3cdc9..744f074b56 100644
}
static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes *dest)
@@ -1510,14 +1426,16 @@ HRESULT WINAPI MFCreateMediaType(IMFMediaType **type)
@@ -1768,14 +1684,16 @@ HRESULT WINAPI MFCreateMediaType(IMFMediaType **type)
if(!type)
return E_INVALIDARG;
@ -373,5 +364,5 @@ index df61f3cdc9..744f074b56 100644
}
--
2.18.0
2.7.4

View File

@ -1,4 +1,4 @@
From befe5cfba7094d1be9b71de2ea11b62de411fd7a Mon Sep 17 00:00:00 2001
From 7ddeecfd4195dc718f9a74aa5ccd2e3c6589f6b1 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 24 Aug 2018 10:32:26 +1000
Subject: [PATCH 3/3] mfplat: Implement MFCreateSample
@ -6,17 +6,17 @@ Subject: [PATCH 3/3] mfplat: Implement MFCreateSample
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45617
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/mfplat/main.c | 445 +++++++++++++++++++++++++++++++++++++
dlls/mfplat/main.c | 445 +++++++++++++++++++++++++++++++++++++++++++++
dlls/mfplat/mfplat.spec | 2 +-
dlls/mfplat/tests/mfplat.c | 16 ++
dlls/mfplat/tests/mfplat.c | 17 ++
include/mfapi.h | 1 +
4 files changed, 463 insertions(+), 1 deletion(-)
4 files changed, 464 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index ce5d446bfb..5cc84a0566 100644
index 73bc564..771abb3 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -1919,3 +1919,448 @@ HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD count,
@@ -2353,3 +2353,448 @@ HRESULT WINAPI MFCreateMemoryBuffer(DWORD max_length, IMFMediaBuffer **buffer)
return S_OK;
}
@ -466,7 +466,7 @@ index ce5d446bfb..5cc84a0566 100644
+ return S_OK;
+}
diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec
index a66f4d1817..0ad15a5f10 100644
index 42b0b86..c58233d 100644
--- a/dlls/mfplat/mfplat.spec
+++ b/dlls/mfplat/mfplat.spec
@@ -55,7 +55,7 @@
@ -479,11 +479,11 @@ index a66f4d1817..0ad15a5f10 100644
@ stub MFCreateSocketListener
@ stdcall MFCreateSourceResolver(ptr)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index f3a452179b..f5a3197d73 100644
index ccbbfb7..17cdc46 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -250,6 +250,21 @@ static void test_MFCreateAttributes(void)
IMFAttributes_Release(attributes);
@@ -363,6 +363,22 @@ static void test_MFCreateMemoryBuffer(void)
IMFMediaBuffer_Release(buffer);
}
+static void test_MFSample(void)
@ -501,19 +501,20 @@ index f3a452179b..f5a3197d73 100644
+
+ IMFSample_Release(sample);
+}
+
START_TEST(mfplat)
{
@@ -261,6 +276,7 @@ START_TEST(mfplat)
CoInitialize(NULL);
@@ -373,6 +389,7 @@ START_TEST(mfplat)
test_source_resolver();
test_MFCreateMediaType();
test_MFCreateAttributes();
+ test_MFSample();
test_MFCreateMFByteStreamOnStream();
test_MFCreateMemoryBuffer();
CoUninitialize();
}
diff --git a/include/mfapi.h b/include/mfapi.h
index 5aead1e0bc..978726b358 100644
index 5b98187..45449b1 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -67,6 +67,7 @@ HRESULT WINAPI MFCancelWorkItem(MFWORKITEM_KEY key);
@ -521,9 +522,9 @@ index 5aead1e0bc..978726b358 100644
HRESULT WINAPI MFCreateEventQueue(IMFMediaEventQueue **queue);
HRESULT WINAPI MFCreateMediaType(IMFMediaType **type);
+HRESULT WINAPI MFCreateSample(IMFSample **sample);
HRESULT WINAPI MFCreateMemoryBuffer(DWORD max_length, IMFMediaBuffer **buffer);
HRESULT WINAPI MFGetTimerPeriodicity(DWORD *periodicity);
HRESULT WINAPI MFTEnum(GUID category, UINT32 flags, MFT_REGISTER_TYPE_INFO *input_type,
MFT_REGISTER_TYPE_INFO *output_type, IMFAttributes *attributes,
--
2.18.0
2.7.4

View File

@ -1,64 +0,0 @@
From 1756ba1db0f6ad6f473107f8cb258d6ba6eedcbb Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 23 Aug 2018 15:27:51 +1000
Subject: [PATCH 1/2] mfplat: Add MFTRegisterLocal stub
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45622
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/mfplat/main.c | 10 ++++++++++
dlls/mfplat/mfplat.spec | 2 +-
include/mfapi.h | 3 +++
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index df61f3c..c5c8ad8 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -230,6 +230,16 @@ HRESULT WINAPI MFTRegister(CLSID clsid, GUID category, LPWSTR name, UINT32 flags
return hr;
}
+HRESULT WINAPI MFTRegisterLocal(IClassFactory *factory, REFGUID category, LPCWSTR name,
+ UINT32 flags, UINT32 cinput, const MFT_REGISTER_TYPE_INFO *input_types,
+ UINT32 coutput, const MFT_REGISTER_TYPE_INFO* output_types)
+{
+ FIXME("(%p, %s, %s, %x, %u, %p, %u, %p)\n", factory, debugstr_guid(category), debugstr_w(name),
+ flags, cinput, input_types, coutput, output_types);
+
+ return S_OK;
+}
+
static BOOL match_type(const WCHAR *clsid_str, const WCHAR *type_str, MFT_REGISTER_TYPE_INFO *type)
{
HKEY htransform, hfilter;
diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec
index a66f4d1..c143814 100644
--- a/dlls/mfplat/mfplat.spec
+++ b/dlls/mfplat/mfplat.spec
@@ -138,7 +138,7 @@
@ stdcall MFTEnumEx(int128 long ptr ptr ptr ptr)
@ stub MFTGetInfo
@ stdcall MFTRegister(int128 int128 wstr long long ptr long ptr ptr)
-@ stub MFTRegisterLocal
+@ stub MFTRegisterLocal(ptr ptr wstr long long ptr long ptr)
@ stub MFTRegisterLocalByCLSID
@ stdcall MFTUnregister(int128)
@ stub MFTUnregisterLocal
diff --git a/include/mfapi.h b/include/mfapi.h
index 5aead1e..f889840 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -78,6 +78,9 @@ HRESULT WINAPI MFLockPlatform(void);
HRESULT WINAPI MFTRegister(CLSID clsid, GUID category, LPWSTR name, UINT32 flags, UINT32 cinput,
MFT_REGISTER_TYPE_INFO *input_types, UINT32 coutput,
MFT_REGISTER_TYPE_INFO *output_types, IMFAttributes *attributes);
+HRESULT WINAPI MFTRegisterLocal(IClassFactory *factory, REFGUID category, LPCWSTR name,
+ UINT32 flags, UINT32 cinput, const MFT_REGISTER_TYPE_INFO *input_types,
+ UINT32 coutput, const MFT_REGISTER_TYPE_INFO* output_types);
HRESULT WINAPI MFShutdown(void);
HRESULT WINAPI MFStartup(ULONG version, DWORD flags);
HRESULT WINAPI MFUnlockPlatform(void);
--
1.9.1

View File

@ -1,58 +0,0 @@
From 07b9d77b6b374fcf777c53dca09efe5c2cb5beda Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Fri, 24 Aug 2018 09:34:24 +1000
Subject: [PATCH 2/2] mfplat: Add MFTUnregisterLocal stub
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
---
dlls/mfplat/main.c | 7 +++++++
dlls/mfplat/mfplat.spec | 2 +-
include/mfapi.h | 1 +
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index c5c8ad8..56f844f 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -240,6 +240,13 @@ HRESULT WINAPI MFTRegisterLocal(IClassFactory *factory, REFGUID category, LPCWST
return S_OK;
}
+HRESULT WINAPI MFTUnregisterLocal(IClassFactory *factory)
+{
+ FIXME("(%p)\n", factory);
+
+ return S_OK;
+}
+
static BOOL match_type(const WCHAR *clsid_str, const WCHAR *type_str, MFT_REGISTER_TYPE_INFO *type)
{
HKEY htransform, hfilter;
diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec
index c143814..1b33e2d 100644
--- a/dlls/mfplat/mfplat.spec
+++ b/dlls/mfplat/mfplat.spec
@@ -141,7 +141,7 @@
@ stub MFTRegisterLocal(ptr ptr wstr long long ptr long ptr)
@ stub MFTRegisterLocalByCLSID
@ stdcall MFTUnregister(int128)
-@ stub MFTUnregisterLocal
+@ stdcall MFTUnregisterLocal(ptr)
@ stub MFTUnregisterLocalByCLSID
@ stub MFTraceError
@ stub MFTraceFuncEnter
diff --git a/include/mfapi.h b/include/mfapi.h
index f889840..890d7bd 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -85,6 +85,7 @@ HRESULT WINAPI MFShutdown(void);
HRESULT WINAPI MFStartup(ULONG version, DWORD flags);
HRESULT WINAPI MFUnlockPlatform(void);
HRESULT WINAPI MFTUnregister(CLSID clsid);
+HRESULT WINAPI MFTUnregisterLocal(IClassFactory *factory);
HRESULT WINAPI MFGetPluginControl(IMFPluginControl**);
#endif /* __WINE_MFAPI_H */
--
1.9.1

View File

@ -1,2 +0,0 @@
Fixes: [45622] Add MFTRegisterLocal stub
Fixes: Add MFTUnregisterLocal stub

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "bfe8510ec0c7bcef0be1f6990c56ad235d8bccd6"
echo "18e2df401eb545f0ce490daaaf12a6c1c248119f"
}
# Show version information
@ -102,7 +102,6 @@ patch_enable_all ()
enable_comdlg32_lpstrFileTitle="$1"
enable_configure_Absolute_RPATH="$1"
enable_crypt32_CMS_Certificates="$1"
enable_crypt32_CryptUnprotectMemory="$1"
enable_crypt32_MS_Root_Certs="$1"
enable_d2d1_ID2D1Factory1="$1"
enable_d3d11_Deferred_Context="$1"
@ -182,10 +181,7 @@ patch_enable_all ()
enable_libs_Debug_Channel="$1"
enable_libs_Unicode_Collation="$1"
enable_loader_OSX_Preloader="$1"
enable_mfplat_MFCreateMFByteStreamOnStream="$1"
enable_mfplat_MFCreateMemoryBuffer="$1"
enable_mfplat_MFCreateSample="$1"
enable_mfplat_MFTRegisterLocal="$1"
enable_mmsystem_dll16_MIDIHDR_Refcount="$1"
enable_mountmgr_DosDevices="$1"
enable_mscoree_CorValidateImage="$1"
@ -482,9 +478,6 @@ patch_enable ()
crypt32-CMS_Certificates)
enable_crypt32_CMS_Certificates="$2"
;;
crypt32-CryptUnprotectMemory)
enable_crypt32_CryptUnprotectMemory="$2"
;;
crypt32-MS_Root_Certs)
enable_crypt32_MS_Root_Certs="$2"
;;
@ -722,18 +715,9 @@ patch_enable ()
loader-OSX_Preloader)
enable_loader_OSX_Preloader="$2"
;;
mfplat-MFCreateMFByteStreamOnStream)
enable_mfplat_MFCreateMFByteStreamOnStream="$2"
;;
mfplat-MFCreateMemoryBuffer)
enable_mfplat_MFCreateMemoryBuffer="$2"
;;
mfplat-MFCreateSample)
enable_mfplat_MFCreateSample="$2"
;;
mfplat-MFTRegisterLocal)
enable_mfplat_MFTRegisterLocal="$2"
;;
mmsystem.dll16-MIDIHDR_Refcount)
enable_mmsystem_dll16_MIDIHDR_Refcount="$2"
;;
@ -2186,20 +2170,6 @@ if test "$enable_ntdll_ApiSetMap" -eq 1; then
enable_ntdll_ThreadTime=1
fi
if test "$enable_mfplat_MFCreateMemoryBuffer" -eq 1; then
if test "$enable_mfplat_MFCreateMFByteStreamOnStream" -gt 1; then
abort "Patchset mfplat-MFCreateMFByteStreamOnStream disabled, but mfplat-MFCreateMemoryBuffer depends on that."
fi
enable_mfplat_MFCreateMFByteStreamOnStream=1
fi
if test "$enable_mfplat_MFCreateMFByteStreamOnStream" -eq 1; then
if test "$enable_mfplat_MFCreateSample" -gt 1; then
abort "Patchset mfplat-MFCreateSample disabled, but mfplat-MFCreateMFByteStreamOnStream depends on that."
fi
enable_mfplat_MFCreateSample=1
fi
if test "$enable_loader_OSX_Preloader" -eq 1; then
if test "$enable_Staging" -gt 1; then
abort "Patchset Staging disabled, but loader-OSX_Preloader depends on that."
@ -2755,18 +2725,6 @@ if test "$enable_crypt32_CMS_Certificates" -eq 1; then
) >> "$patchlist"
fi
# Patchset crypt32-CryptUnprotectMemory
# |
# | Modified files:
# | * dlls/crypt32/main.c
# |
if test "$enable_crypt32_CryptUnprotectMemory" -eq 1; then
patch_apply crypt32-CryptUnprotectMemory/0001-crypt32-Print-CryptUnprotectMemory-FIXME-only-once.patch
(
printf '%s\n' '+ { "Christian Costa", "crypt32: Print CryptUnprotectMemory FIXME only once.", 1 },';
) >> "$patchlist"
fi
# Patchset crypt32-MS_Root_Certs
# |
# | Modified files:
@ -4393,59 +4351,6 @@ if test "$enable_mfplat_MFCreateSample" -eq 1; then
) >> "$patchlist"
fi
# Patchset mfplat-MFCreateMFByteStreamOnStream
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * mfplat-MFCreateSample
# |
# | This patchset fixes the following Wine bugs:
# | * [#45372] Implement MFCreateMFByteStreamOnStream.
# |
# | Modified files:
# | * dlls/mfplat/main.c, dlls/mfplat/mfplat.spec, dlls/mfplat/tests/mfplat.c, include/mfidl.idl
# |
if test "$enable_mfplat_MFCreateMFByteStreamOnStream" -eq 1; then
patch_apply mfplat-MFCreateMFByteStreamOnStream/0001-mfplat-Implement-MFCreateMFByteStreamOnStream.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "mfplat: Implement MFCreateMFByteStreamOnStream.", 1 },';
) >> "$patchlist"
fi
# Patchset mfplat-MFCreateMemoryBuffer
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * mfplat-MFCreateSample, mfplat-MFCreateMFByteStreamOnStream
# |
# | This patchset fixes the following Wine bugs:
# | * [#45715] Implement MFCreateMemoryBuffer.
# |
# | Modified files:
# | * dlls/mfplat/main.c, dlls/mfplat/mfplat.spec, dlls/mfplat/tests/mfplat.c, include/mfapi.h
# |
if test "$enable_mfplat_MFCreateMemoryBuffer" -eq 1; then
patch_apply mfplat-MFCreateMemoryBuffer/0001-mfplat-Implement-MFCreateMemoryBuffer.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "mfplat: Implement MFCreateMemoryBuffer.", 1 },';
) >> "$patchlist"
fi
# Patchset mfplat-MFTRegisterLocal
# |
# | This patchset fixes the following Wine bugs:
# | * [#45622] Add MFTRegisterLocal stub
# |
# | Modified files:
# | * dlls/mfplat/main.c, dlls/mfplat/mfplat.spec, include/mfapi.h
# |
if test "$enable_mfplat_MFTRegisterLocal" -eq 1; then
patch_apply mfplat-MFTRegisterLocal/0001-mfplat-Add-MFTRegisterLocal-stub.patch
patch_apply mfplat-MFTRegisterLocal/0002-mfplat-Add-MFTUnregisterLocal-stub.patch
(
printf '%s\n' '+ { "Alistair Leslie-Hughes", "mfplat: Add MFTRegisterLocal stub.", 1 },';
printf '%s\n' '+ { "Alistair Leslie-Hughes", "mfplat: Add MFTUnregisterLocal stub.", 1 },';
) >> "$patchlist"
fi
# Patchset mmsystem.dll16-MIDIHDR_Refcount
# |
# | This patchset fixes the following Wine bugs: