Commit ef05072e authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

oleaut32: Rewrite ITypeInfo_GetDocumentation proxy/stub to return only the…

oleaut32: Rewrite ITypeInfo_GetDocumentation proxy/stub to return only the information that is requested.
parent 779ad051
...@@ -1651,49 +1651,49 @@ HRESULT __RPC_STUB ITypeInfo_Invoke_Stub( ...@@ -1651,49 +1651,49 @@ HRESULT __RPC_STUB ITypeInfo_Invoke_Stub(
return E_FAIL; return E_FAIL;
} }
HRESULT CALLBACK ITypeInfo_GetDocumentation_Proxy( HRESULT CALLBACK ITypeInfo_GetDocumentation_Proxy(ITypeInfo *This, MEMBERID memid,
ITypeInfo* This, BSTR *name, BSTR *doc_string,
MEMBERID memid, DWORD *help_context, BSTR *help_file)
BSTR* pBstrName,
BSTR* pBstrDocString,
DWORD* pdwHelpContext,
BSTR* pBstrHelpFile)
{ {
DWORD help_context; DWORD dummy_help_context, flags = 0;
BSTR name, doc_string, help_file; BSTR dummy_name, dummy_doc_string, dummy_help_file;
HRESULT hr; HRESULT hr;
TRACE("(%p, %08x, %p, %p, %p, %p)\n", This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile); TRACE("(%p, %08x, %p, %p, %p, %p)\n", This, memid, name, doc_string, help_context, help_file);
/* FIXME: presumably refPtrFlags is supposed to be a bitmask of which ptrs we actually want? */ if(!name) name = &dummy_name;
hr = ITypeInfo_RemoteGetDocumentation_Proxy(This, memid, 0, &name, &doc_string, &help_context, &help_file); else flags = 1;
if(SUCCEEDED(hr))
{
if(pBstrName) *pBstrName = name;
else SysFreeString(name);
if(pBstrDocString) *pBstrDocString = doc_string; if(!doc_string) doc_string = &dummy_doc_string;
else SysFreeString(doc_string); else flags |= 2;
if(pBstrHelpFile) *pBstrHelpFile = help_file; if(!help_context) help_context = &dummy_help_context;
else SysFreeString(help_file); else flags |= 4;
if(!help_file) help_file = &dummy_help_file;
else flags |= 8;
hr = ITypeInfo_RemoteGetDocumentation_Proxy(This, memid, flags, name, doc_string, help_context, help_file);
/* We don't need to free the dummy BSTRs since the stub ensures that these will be NULLs. */
if(pdwHelpContext) *pdwHelpContext = help_context;
}
return hr; return hr;
} }
HRESULT __RPC_STUB ITypeInfo_GetDocumentation_Stub( HRESULT __RPC_STUB ITypeInfo_GetDocumentation_Stub(ITypeInfo *This, MEMBERID memid,
ITypeInfo* This, DWORD flags, BSTR *name, BSTR *doc_string,
MEMBERID memid, DWORD *help_context, BSTR *help_file)
DWORD refPtrFlags,
BSTR* pBstrName,
BSTR* pBstrDocString,
DWORD* pdwHelpContext,
BSTR* pBstrHelpFile)
{ {
TRACE("(%p, %08x, %08x, %p, %p, %p, %p)\n", This, memid, refPtrFlags, pBstrName, pBstrDocString, TRACE("(%p, %08x, %08x, %p, %p, %p, %p)\n", This, memid, flags, name, doc_string, help_context, help_file);
pdwHelpContext, pBstrHelpFile);
return ITypeInfo_GetDocumentation(This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile); *name = *doc_string = *help_file = NULL;
*help_context = 0;
if(!(flags & 1)) name = NULL;
if(!(flags & 2)) doc_string = NULL;
if(!(flags & 4)) help_context = NULL;
if(!(flags & 8)) help_file = NULL;
return ITypeInfo_GetDocumentation(This, memid, name, doc_string, help_context, help_file);
} }
HRESULT CALLBACK ITypeInfo_GetDllEntry_Proxy( HRESULT CALLBACK ITypeInfo_GetDllEntry_Proxy(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment