Subject: Re: Typelib marshalling BSTRs From: Mike Hearn mike@theoretic.com To: "Gregory M. Turner" gmturner007@ameritech.net Cc: wine-devel@winehq.com Date: 23 Jul 2003 16:28:58 +0100
So, moving on from that problem, I think my woes (currently) are caused by the NDR engine not handling VT_DISPATCH variants.
in wire_size(): case VT_DISPATCH: FIXME("wire-size interfaces\n");
that causes VARIANT_UserMarshal to skip doing anything special for VT_DISPATCH variants, when I think in reality, it should call NdrInterfacePointerMarshall (btw, what's up with two spellings of "marshal"?) to get the IDispatch* into the stream.
I don't know about NdrInterfacePointerMarshall, but I don't think it should get there to start with (see below). BTW, I think the two spellings depends on whether the word is used as a verb or as a noun.
While rather roundabout, I think it seems clear that this is what's needed. The problem then becomes one of NdrInterfacePointerMarshall() needing information that isn't available from inside VARIANT_UserMarshal, like the MIDL_STUB_BUFFER pointer.
Greg, as you are the relevant Guru here and Ove is probably a bit pissed off with all my questions, what should we be doing here? If we are meant to use NdrInterfacePointerMarshall to handle VT_DISPATCH variants, how do we get the args it needs?
Ok, my name's not Greg or Ove, but I'll have a go anyway. I think the code should not try to marshal/unmarshal the data in rpcrt4, but should use the PSOAInterface code in oleaut32 (according to the registry entry for Interfaces[CLSID of IWebBrowser2]\ProxyStubClsid32). It would probably be best to find out why this is not happening (maybe by moving some oleaut32 code to rpcrt4?).
Rob
On Wed, 2003-07-23 at 23:04, Robert Shearman wrote:
I don't know about NdrInterfacePointerMarshall, but I don't think it should get there to start with (see below). BTW, I think the two spellings depends on whether the word is used as a verb or as a noun.
Yeah, I considered that, but MSDN seems to use marshal as a verb as well. *shrug*
I think the code should not try to marshal/unmarshal the data in rpcrt4, but should use the PSOAInterface code in oleaut32 (according to the registry entry for Interfaces[CLSID of IWebBrowser2]\ProxyStubClsid32). It would probably be best to find out why this is not happening (maybe by moving some oleaut32 code to rpcrt4?).
Well, the code doesn't actually marshal IWebBrowser2, it operates entirely in terms of IDispatch interfaces. Once the dispatch interface for the WebBrowser control is marshalled into another thread, the code starts poking it via Invoke, in this case retrieving the Document property which also returns a dispatch interface.
I'm pretty sure just marshalling IWebBrowser2 would work, but unfortunately the nature of the Java-COM bridge we use (neva coroutine) means that it all goes via IDispatch. That, in turn, means we have to support marshalling of VT_DISPATCH variants.
thanks -mike