Signed-off-by: Sven Baars sven.wine@gmail.com ---
v2: Added NULL checks to PropVariantCopy instead.
dlls/ole32/ole2.c | 3 +++ dlls/ole32/tests/propvariant.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+)
diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index 2de9edbb80..b3f0d1f9bf 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -2928,6 +2928,9 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */ ULONG len; HRESULT hr;
+ if (!pvarDest || !pvarSrc) + return E_INVALIDARG; + TRACE("(%p, %p vt %04x)\n", pvarDest, pvarSrc, pvarSrc->vt);
hr = PROPVARIANT_ValidateType(pvarSrc->vt); diff --git a/dlls/ole32/tests/propvariant.c b/dlls/ole32/tests/propvariant.c index 97c4eec4ca..8d74391110 100644 --- a/dlls/ole32/tests/propvariant.c +++ b/dlls/ole32/tests/propvariant.c @@ -306,6 +306,20 @@ static void test_copy(void) PROPVARIANT propvarDst; HRESULT hr;
+ propvarSrc.vt = VT_ILLEGAL; + hr = PropVariantCopy(&propvarDst, &propvarSrc); + ok(hr == DISP_E_BADVARTYPE, "got 0x%08x\n", hr); + + hr = PropVariantCopy(NULL, &propvarSrc); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + propvarSrc.vt = VT_EMPTY; + hr = PropVariantCopy(NULL, &propvarSrc); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = PropVariantCopy(&propvarDst, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + propvarSrc.vt = VT_BSTR; U(propvarSrc).bstrVal = SysAllocString(wszTestString);
Signed-off-by: Sven Baars sven.wine@gmail.com ---
v2: Added NULL checks to PropVariantCopy instead.
dlls/mfplat/main.c | 13 ++++++++++--- dlls/mfplat/tests/mfplat.c | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 46a697538c..312f36d51a 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -2094,6 +2094,9 @@ static HRESULT WINAPI mfmediaevent_GetType(IMFMediaEvent *iface, MediaEventType
TRACE("%p, %p\n", This, type);
+ if (!type) + return E_INVALIDARG; + *type = This->type;
return S_OK; @@ -2105,6 +2108,9 @@ static HRESULT WINAPI mfmediaevent_GetExtendedType(IMFMediaEvent *iface, GUID *e
TRACE("%p, %p\n", This, extended_type);
+ if (!extended_type) + return E_INVALIDARG; + *extended_type = This->extended_type;
return S_OK; @@ -2116,6 +2122,9 @@ static HRESULT WINAPI mfmediaevent_GetStatus(IMFMediaEvent *iface, HRESULT *stat
TRACE("%p, %p\n", This, status);
+ if (!status) + return E_INVALIDARG; + *status = This->status;
return S_OK; @@ -2125,9 +2134,7 @@ static HRESULT WINAPI mfmediaevent_GetValue(IMFMediaEvent *iface, PROPVARIANT *v { mfmediaevent *This = impl_from_IMFMediaEvent(iface);
- PropVariantCopy(value, &This->value); - - return S_OK; + return PropVariantCopy(value, &This->value); }
static const IMFMediaEventVtbl mfmediaevent_vtbl = diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 48a8d0d361..8b6dd4523f 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -278,6 +278,20 @@ static void test_MFCreateMediaEvent(void) hr = MFCreateMediaEvent(MEError, &GUID_NULL, E_FAIL, &value, &mediaevent); ok(hr == S_OK, "got 0x%08x\n", hr);
+ hr = IMFMediaEvent_GetType(mediaevent, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IMFMediaEvent_GetExtendedType(mediaevent, NULL); + ok(hr == E_INVALIDARG || + /* wvistau64 */ + broken(hr == S_OK), "got 0x%08x\n", hr); + + hr = IMFMediaEvent_GetStatus(mediaevent, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IMFMediaEvent_GetValue(mediaevent, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + PropVariantClear(&value);
hr = IMFMediaEvent_GetType(mediaevent, &type);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44519
Your paranoid android.
=== debian9 (64 bit WoW report) ===
ole32: clipboard.c:1049: Test failed: OleIsCurrentClipboard returned 0 clipboard.c:1117: Test failed: 1 WM_DRAWCLIPBOARD received
This seems to be a test that usually fails on the testbot, but sometimes randomly does not fail. In the latest daily run it did fail, so I suppose that after patch 1/3 it did not fail, and after this one it failed again. Anyhow, it's unrelated to my patches.
Sven
On 17-11-18 22:11, Marvin wrote:
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=44519
Your paranoid android.
=== debian9 (64 bit WoW report) ===
ole32: clipboard.c:1049: Test failed: OleIsCurrentClipboard returned 0 clipboard.c:1117: Test failed: 1 WM_DRAWCLIPBOARD received
Signed-off-by: Sven Baars sven.wine@gmail.com ---
v2: Rebased on previous two patches.
dlls/mfplat/main.c | 187 +++++++++++++++++++++++++++++++++++++ dlls/mfplat/tests/mfplat.c | 78 +++++++++++++++- include/mfidl.idl | 47 ++++++++++ 3 files changed, 310 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 312f36d51a..b8bd620c62 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1315,6 +1315,174 @@ HRESULT WINAPI MFGetPluginControl(IMFPluginControl **ret) return S_OK; }
+typedef struct _mfsource +{ + IMFMediaSource IMFMediaSource_iface; + LONG ref; +} mfsource; + +static inline mfsource *impl_from_IMFMediaSource(IMFMediaSource *iface) +{ + return CONTAINING_RECORD(iface, mfsource, IMFMediaSource_iface); +} + +static HRESULT WINAPI mfsource_QueryInterface(IMFMediaSource *iface, REFIID riid, void **out) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IMFMediaSource) || + IsEqualIID(riid, &IID_IMFMediaEventGenerator) || + IsEqualIID(riid, &IID_IUnknown)) + { + *out = &This->IMFMediaSource_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 mfsource_AddRef(IMFMediaSource *iface) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%u\n", This, ref); + + return ref; +} + +static ULONG WINAPI mfsource_Release(IMFMediaSource *iface) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%u\n", This, ref); + + if (!ref) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI mfsource_GetEvent(IMFMediaSource *iface, DWORD flags, IMFMediaEvent **event) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%#x, %p)\n", This, flags, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_BeginGetEvent(IMFMediaSource *iface, IMFAsyncCallback *callback, IUnknown *state) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p, %p)\n", This, callback, state); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_EndGetEvent(IMFMediaSource *iface, IMFAsyncResult *result, IMFMediaEvent **event) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p, %p)\n", This, result, event); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_QueueEvent(IMFMediaSource *iface, MediaEventType event_type, REFGUID ext_type, + HRESULT hr, const PROPVARIANT *value) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%d, %s, %#x, %p)\n", This, event_type, debugstr_guid(ext_type), hr, value); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_GetCharacteristics(IMFMediaSource *iface, DWORD *characteristics) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p): stub\n", This, characteristics); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_CreatePresentationDescriptor(IMFMediaSource *iface, IMFPresentationDescriptor **descriptor) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p): stub\n", This, descriptor); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_Start(IMFMediaSource *iface, IMFPresentationDescriptor *descriptor, + const GUID *time_format, const PROPVARIANT *start_position) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p)->(%p, %p, %p): stub\n", This, descriptor, time_format, start_position); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_Stop(IMFMediaSource *iface) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p): stub\n", This); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_Pause(IMFMediaSource *iface) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p): stub\n", This); + + return E_NOTIMPL; +} + +static HRESULT WINAPI mfsource_Shutdown(IMFMediaSource *iface) +{ + mfsource *This = impl_from_IMFMediaSource(iface); + + FIXME("(%p): stub\n", This); + + return S_OK; +} + +static const IMFMediaSourceVtbl mfsourcevtbl = +{ + mfsource_QueryInterface, + mfsource_AddRef, + mfsource_Release, + mfsource_GetEvent, + mfsource_BeginGetEvent, + mfsource_EndGetEvent, + mfsource_QueueEvent, + mfsource_GetCharacteristics, + mfsource_CreatePresentationDescriptor, + mfsource_Start, + mfsource_Stop, + mfsource_Pause, + mfsource_Shutdown, +}; + typedef struct _mfsourceresolver { IMFSourceResolver IMFSourceResolver_iface; @@ -1388,6 +1556,25 @@ static HRESULT WINAPI mfsourceresolver_CreateObjectFromByteStream(IMFSourceResol
FIXME("(%p)->(%p, %s, %#x, %p, %p, %p): stub\n", This, stream, debugstr_w(url), flags, props, obj_type, object);
+ if (!stream || !obj_type || !object) + return E_POINTER; + + if (flags & MF_RESOLUTION_MEDIASOURCE) + { + mfsource *new_object; + + new_object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) ); + if (!new_object) + return E_OUTOFMEMORY; + + new_object->IMFMediaSource_iface.lpVtbl = &mfsourcevtbl; + new_object->ref = 1; + + *object = (IUnknown *)&new_object->IMFMediaSource_iface; + *obj_type = MF_OBJECT_MEDIASOURCE; + return S_OK; + } + return E_NOTIMPL; }
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 8b6dd4523f..0b608ccdec 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -42,6 +42,8 @@ static HRESULT (WINAPI *pMFCreateMemoryBuffer)(DWORD max_length, IMFMediaBuffer
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
+DEFINE_GUID(MF_BYTESTREAM_CONTENT_TYPE, 0xfc358289,0x3cb6,0x460c,0xa4,0x24,0xb6,0x68,0x12,0x60,0x37,0x5a); + DEFINE_GUID(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, 0xa634a91c, 0x822b, 0x41b9, 0xa4, 0x94, 0x4d, 0xe4, 0x64, 0x36, 0x12, 0xb0);
DEFINE_GUID(MFT_CATEGORY_OTHER, 0x90175d57,0xb7ea,0x4901,0xae,0xb3,0x93,0x3a,0x87,0x47,0x75,0x6f); @@ -200,7 +202,14 @@ if(0) static void test_source_resolver(void) { IMFSourceResolver *resolver, *resolver2; + IMFByteStream *bytestream; + IMFAttributes *attributes; + IMFMediaSource *mediasource; + MF_OBJECT_TYPE obj_type; HRESULT hr; + WCHAR *filename; + + static const WCHAR file_type[] = {'v','i','d','e','o','/','m','p','4',0};
if (!pMFCreateSourceResolver) { @@ -208,6 +217,9 @@ static void test_source_resolver(void) return; }
+ hr = MFStartup(MF_VERSION, MFSTARTUP_FULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = pMFCreateSourceResolver(NULL); ok(hr == E_POINTER, "got %#x\n", hr);
@@ -218,8 +230,70 @@ static void test_source_resolver(void) ok(hr == S_OK, "got %#x\n", hr); ok(resolver != resolver2, "Expected new instance\n");
- IMFSourceResolver_Release(resolver); IMFSourceResolver_Release(resolver2); + + filename = load_resource(mp4file); + + hr = MFCreateFile(MF_ACCESSMODE_READ, MF_OPENMODE_FAIL_IF_NOT_EXIST, + MF_FILEFLAGS_NONE, filename, &bytestream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IMFSourceResolver_CreateObjectFromByteStream( + resolver, NULL, NULL, MF_RESOLUTION_MEDIASOURCE, NULL, + &obj_type, (IUnknown **)&mediasource); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IMFSourceResolver_CreateObjectFromByteStream( + resolver, bytestream, NULL, MF_RESOLUTION_MEDIASOURCE, NULL, + NULL, (IUnknown **)&mediasource); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IMFSourceResolver_CreateObjectFromByteStream( + resolver, bytestream, NULL, MF_RESOLUTION_MEDIASOURCE, NULL, + &obj_type, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IMFSourceResolver_CreateObjectFromByteStream( + resolver, bytestream, NULL, MF_RESOLUTION_MEDIASOURCE, NULL, + &obj_type, (IUnknown **)&mediasource); + todo_wine ok(hr == MF_E_UNSUPPORTED_BYTESTREAM_TYPE, "got 0x%08x\n", hr); + if (hr == S_OK) IMFMediaSource_Release(mediasource); + + hr = IMFSourceResolver_CreateObjectFromByteStream( + resolver, bytestream, NULL, MF_RESOLUTION_BYTESTREAM, NULL, + &obj_type, (IUnknown **)&mediasource); + todo_wine ok(hr == MF_E_UNSUPPORTED_BYTESTREAM_TYPE, "got 0x%08x\n", hr); + + IMFByteStream_Release(bytestream); + + /* We have to create a new bytestream here, because all following + * calls to CreateObjectFromByteStream will fail. */ + hr = MFCreateFile(MF_ACCESSMODE_READ, MF_OPENMODE_FAIL_IF_NOT_EXIST, + MF_FILEFLAGS_NONE, filename, &bytestream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IUnknown_QueryInterface(bytestream, &IID_IMFAttributes, + (void **)&attributes); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IMFAttributes_SetString(attributes, &MF_BYTESTREAM_CONTENT_TYPE, file_type); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + IMFAttributes_Release(attributes); + + hr = IMFSourceResolver_CreateObjectFromByteStream( + resolver, bytestream, NULL, MF_RESOLUTION_MEDIASOURCE, NULL, + &obj_type, (IUnknown **)&mediasource); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mediasource != NULL, "got %p\n", mediasource); + ok(obj_type == MF_OBJECT_MEDIASOURCE, "got %d\n", obj_type); + + IMFMediaSource_Release(mediasource); + IMFByteStream_Release(bytestream); + + IMFSourceResolver_Release(resolver); + + MFShutdown(); + + DeleteFileW(filename); }
static void init_functions(void) @@ -633,7 +707,6 @@ START_TEST(mfplat) init_functions();
test_register(); - test_source_resolver(); test_MFCreateMediaType(); test_MFCreateMediaEvent(); test_MFCreateAttributes(); @@ -641,6 +714,7 @@ START_TEST(mfplat) test_MFCreateFile(); test_MFCreateMFByteStreamOnStream(); test_MFCreateMemoryBuffer(); + test_source_resolver();
CoUninitialize(); } diff --git a/include/mfidl.idl b/include/mfidl.idl index 84be055d09..ac5acc50f5 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -212,6 +212,53 @@ interface IMFStreamDescriptor : IMFAttributes HRESULT GetMediaTypeHandler([out] IMFMediaTypeHandler **handler); }
+[ + object, + uuid(03cb2711-24d7-4db6-a17f-f3a7a479a536), +] +interface IMFPresentationDescriptor : IMFAttributes +{ + HRESULT GetStreamDescriptorCount([out] DWORD *pdwDescriptorCount); + HRESULT GetStreamDescriptorByIndex([in] DWORD dwIndex, [out] BOOL *pfSelected, [out] IMFStreamDescriptor **ppDescriptor); + HRESULT SelectStream([in] DWORD dwDescriptorIndex); + HRESULT DeselectStream([in] DWORD dwDescriptorIndex); + HRESULT Clone([out] IMFPresentationDescriptor **ppPresentationDescriptor); +} + +[ + object, + uuid(279a808d-aec7-40c8-9c6b-a6b492c78a66), +] +interface IMFMediaSource : IMFMediaEventGenerator +{ + HRESULT GetCharacteristics([out] DWORD *pdwCharacteristics); + + [local] + HRESULT CreatePresentationDescriptor([out] IMFPresentationDescriptor **ppPresentationDescriptor); + [call_as(CreatePresentationDescriptor)] + HRESULT RemoteCreatePresentationDescriptor( + [out] DWORD *pcbPD, + [out, size_is(,*pcbPD)] BYTE **pbPD, + [out] IMFPresentationDescriptor **ppRemotePD); + + HRESULT Start( + [in] IMFPresentationDescriptor *pPresentationDescriptor, + [in, unique] const GUID *pguidTimeFormat, + [in, unique] const PROPVARIANT *pvarStartPosition); + + HRESULT Stop(); + HRESULT Pause(); + HRESULT Shutdown(); +} + +cpp_quote("#define MF_RESOLUTION_MEDIASOURCE 0x00000001") +cpp_quote("#define MF_RESOLUTION_BYTESTREAM 0x00000002") +cpp_quote("#define MF_RESOLUTION_CONTENT_DOES_NOT_HAVE_TO_MATCH_EXTENSION_OR_MIME_TYPE 0x00000010") +cpp_quote("#define MF_RESOLUTION_KEEP_BYTE_STREAM_ALIVE_ON_FAIL 0x00000020") +cpp_quote("#define MF_RESOLUTION_READ 0x00010000") +cpp_quote("#define MF_RESOLUTION_WRITE 0x00020000") +cpp_quote("#define MF_RESOLUTION_DISABLE_LOCAL_PLUGINS 0x00000040") + [ object, uuid(f6696e82-74f7-4f3d-a178-8a5e09c3659f)
On Sat, Nov 17, 2018 at 10:03:09PM +0100, Sven Baars wrote:
Signed-off-by: Sven Baars sven.wine@gmail.com
v2: Added NULL checks to PropVariantCopy instead.
dlls/ole32/ole2.c | 3 +++ dlls/ole32/tests/propvariant.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+)
Do you have an app that depends on this behaviour?
Huw.
On Tue, Nov 20, 2018 at 9:55 AM Huw Davies huw@codeweavers.com wrote:
On Sat, Nov 17, 2018 at 10:03:09PM +0100, Sven Baars wrote:
Signed-off-by: Sven Baars sven.wine@gmail.com
v2: Added NULL checks to PropVariantCopy instead.
dlls/ole32/ole2.c | 3 +++ dlls/ole32/tests/propvariant.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+)
Do you have an app that depends on this behaviour?
Huw.
Hi Huw,
No, but Nikolay asked me to implement this here instead of in mfplat. For that I had an app that depended on it for a few days or so, which was obviously a bug since they tried to put something into a NULL pointer, so they fixed that already. I thought I should submit the patch anyway since it matches Windows behaviour.
Sven
On Tue, Nov 20, 2018 at 10:17:42AM +0100, Sven Baars wrote:
On Tue, Nov 20, 2018 at 9:55 AM Huw Davies huw@codeweavers.com wrote: On Sat, Nov 17, 2018 at 10:03:09PM +0100, Sven Baars wrote: > Signed-off-by: Sven Baars sven.wine@gmail.com > --- > > v2: Added NULL checks to PropVariantCopy instead. > > dlls/ole32/ole2.c | 3 +++ > dlls/ole32/tests/propvariant.c | 14 ++++++++++++++ > 2 files changed, 17 insertions(+)
Do you have an app that depends on this behaviour? Huw.
Hi Huw,
No, but Nikolay asked me to implement this here instead of in mfplat. For that I had an app that depended on it for a few days or so, which was obviously a bug since they tried to put something into a NULL pointer, so they fixed that already. I thought I should submit the patch anyway since it matches Windows behaviour.
If the app doesn't require it any longer then let's leave this out. We tend to avoid adding NULL-ptr checks unless we need to.
Huw.
On Tue, Nov 20, 2018 at 10:26 AM Huw Davies huw@codeweavers.com wrote:
On Tue, Nov 20, 2018 at 10:17:42AM +0100, Sven Baars wrote:
On Tue, Nov 20, 2018 at 9:55 AM Huw Davies huw@codeweavers.com wrote: On Sat, Nov 17, 2018 at 10:03:09PM +0100, Sven Baars wrote: > Signed-off-by: Sven Baars sven.wine@gmail.com > --- > > v2: Added NULL checks to PropVariantCopy instead. > > dlls/ole32/ole2.c | 3 +++ > dlls/ole32/tests/propvariant.c | 14 ++++++++++++++ > 2 files changed, 17 insertions(+)
Do you have an app that depends on this behaviour? Huw.
Hi Huw,
No, but Nikolay asked me to implement this here instead of in mfplat. For that I had an app that depended on it for a few days or so, which was obviously a bug since they tried to put something into a NULL pointer, so they fixed that already. I thought I should submit the patch anyway since it matches Windows behaviour.
If the app doesn't require it any longer then let's leave this out. We tend to avoid adding NULL-ptr checks unless we need to.
Huw.
Ok, I'll keep that in mind for future patches.
Sven