oleaut32: Check pointer in IPicture::get_Handle.

This commit is contained in:
Nikolay Sivov 2009-01-07 09:07:06 +03:00 committed by Alexandre Julliard
parent 65b3393dce
commit a22ca1c2d9
2 changed files with 18 additions and 0 deletions

View File

@ -519,6 +519,10 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface,
{
OLEPictureImpl *This = (OLEPictureImpl *)iface;
TRACE("(%p)->(%p)\n", This, phandle);
if(!phandle)
return E_POINTER;
switch(This->desc.picType) {
case PICTYPE_NONE:
case PICTYPE_UNINITIALIZED:

View File

@ -674,6 +674,19 @@ static void test_get_Attributes(void)
IPicture_Release(pic);
}
static void test_get_Handle(void)
{
IPicture *pic;
HRESULT hres;
OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (VOID**)&pic);
hres = IPicture_get_Handle(pic, NULL);
ole_expect(hres, E_POINTER);
IPicture_Release(pic);
}
START_TEST(olepicture)
{
hOleaut32 = GetModuleHandleA("oleaut32.dll");
@ -702,6 +715,7 @@ START_TEST(olepicture)
test_OleCreatePictureIndirect();
test_Render();
test_get_Attributes();
test_get_Handle();
}