ole32: Fix OleDraw() with NULL pUnk.

This commit is contained in:
Qian Hong 2012-12-07 01:45:33 +08:00 committed by Alexandre Julliard
parent 533df157f8
commit 9b90ea557b
2 changed files with 9 additions and 0 deletions

View File

@ -2546,6 +2546,8 @@ HRESULT WINAPI OleDraw(
HRESULT hres;
IViewObject *viewobject;
if (!pUnk) return E_INVALIDARG;
hres = IUnknown_QueryInterface(pUnk,
&IID_IViewObject,
(void**)&viewobject);

View File

@ -1934,9 +1934,16 @@ static void test_OleLockRunning(void)
static void test_OleDraw(void)
{
HRESULT hr;
RECT rect;
hr = OleDraw((IUnknown*)&viewobject, 0, (HDC)0x1, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = OleDraw(NULL, 0, (HDC)0x1, NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
hr = OleDraw(NULL, 0, (HDC)0x1, &rect);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
}
START_TEST(ole2)