ole32: Add a check for hglobal pointer to GetHGlobalFromStream.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
019fcaa364
commit
d5c5387622
|
@ -664,10 +664,10 @@ HRESULT WINAPI GetHGlobalFromStream(IStream* pstm, HGLOBAL* phglobal)
|
|||
{
|
||||
HGLOBALStreamImpl* pStream;
|
||||
|
||||
if (pstm == NULL)
|
||||
if (!pstm || !phglobal)
|
||||
return E_INVALIDARG;
|
||||
|
||||
pStream = (HGLOBALStreamImpl*) pstm;
|
||||
pStream = impl_from_IStream(pstm);
|
||||
|
||||
/*
|
||||
* Verify that the stream object was created with CreateStreamOnHGlobal.
|
||||
|
|
|
@ -561,6 +561,12 @@ static void test_IStream_Clone(void)
|
|||
hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
|
||||
hr = GetHGlobalFromStream(stream, NULL);
|
||||
ok(hr == E_INVALIDARG, "unexpected %#x\n", hr);
|
||||
|
||||
hr = GetHGlobalFromStream(NULL, &hmem);
|
||||
ok(hr == E_INVALIDARG, "unexpected %#x\n", hr);
|
||||
|
||||
stream_info(stream, &hmem, &size, &pos);
|
||||
ok(hmem == orig_hmem, "handles should match\n");
|
||||
ok(size == 0, "unexpected %d\n", size);
|
||||
|
|
Loading…
Reference in New Issue