From 41079866f73b310b797169bd72c5d51ff1fac592 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 29 Mar 2005 13:06:44 +0000 Subject: [PATCH] Serialize NULL pointer interfaces correctly. --- dlls/oleaut32/tmarshal.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index ae6a3d95236..4d08b2ef4e0 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -1,7 +1,7 @@ /* * TYPELIB Marshaler * - * Copyright 2002 Marcus Meissner + * Copyright 2002,2005 Marcus Meissner * * The olerelay debug channel allows you to see calls marshalled by * the typelib marshaller. It is not a generic COM relaying system. @@ -169,12 +169,19 @@ _marshal_interface(marshal_state *buf, REFIID riid, LPUNKNOWN pUnk) { DWORD xsize; HRESULT hres; - hres = E_FAIL; if (!pUnk) { + /* this is valid, if for instance we serialize + * a VT_DISPATCH with NULL ptr which apparently + * can happen. S_OK to make sure we continue + * serializing. + */ ERR("pUnk is NULL?\n"); - goto fail; + xsize = 0; + return xbuf_add(buf,(LPBYTE)&xsize,sizeof(xsize)); } + hres = E_FAIL; + TRACE("...%s...\n",debugstr_guid(riid)); hres = IUnknown_QueryInterface(pUnk,riid,(LPVOID*)&newiface); if (hres) { -- 2.11.4.GIT