mirror of
https://github.com/reactos/wine.git
synced 2025-02-22 22:01:51 +00:00
ole32: CoGetInterfaceAndReleaseStream shouldn't crash when passed a NULL stream.
This commit is contained in:
parent
267e660bd6
commit
1f34fdffee
@ -1815,6 +1815,7 @@ HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID riid,
|
||||
|
||||
TRACE("(%p, %s, %p)\n", pStm, debugstr_guid(riid), ppv);
|
||||
|
||||
if(!pStm) return E_INVALIDARG;
|
||||
hres = CoUnmarshalInterface(pStm, riid, ppv);
|
||||
IStream_Release(pStm);
|
||||
return hres;
|
||||
|
@ -2253,6 +2253,15 @@ static void test_marshal_HENHMETAFILE(void)
|
||||
HENHMETAFILE_UserFree(&flags, &hemf2);
|
||||
}
|
||||
|
||||
static void test_CoGetInterfaceAndReleaseStream(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
IUnknown *pUnk;
|
||||
|
||||
hr = CoGetInterfaceAndReleaseStream(NULL, &IID_IUnknown, (void**)&pUnk);
|
||||
ok(hr == E_INVALIDARG, "hr %08x\n", hr);
|
||||
}
|
||||
|
||||
START_TEST(marshal)
|
||||
{
|
||||
WNDCLASS wndclass;
|
||||
@ -2313,6 +2322,8 @@ START_TEST(marshal)
|
||||
test_marshal_HGLOBAL();
|
||||
test_marshal_HENHMETAFILE();
|
||||
|
||||
test_CoGetInterfaceAndReleaseStream();
|
||||
|
||||
CoUninitialize();
|
||||
return;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user