Subject: Re: Typelib marshalling BSTRs From: Mike Hearn mike@theoretic.com To: Kelly Leahy kellyleahy@swbell.net Cc: wine-devel@winehq.com Date: 18 Jul 2003 17:24:07 +0100
On Fri, 2003-07-18 at 17:08, Kelly Leahy wrote:
weird. are the "type" and "flags" correct?
They appear to be. Type 26 is VT_PTR, flags 1 == in param
bstr isn't right, since it's an array of bstr (or more
precisely array of
OLECHAR FAR* - which may also be causing problems) - though I
may be wrong
if it marshals them one by one.
Yeah, I had a thinko. It's supposed to be an array of bstr, but even simply marshalling the first element correctly would be good :)
No, it is supposed to be OLECHAR which is different (in terms of VARIANT types) to BSTR. BSTR implies a size field at the start of the array.
HRESULT GetIDsOfNames( [in] REFIID riid, [in, size_is(cNames)] LPOLESTR *rgszNames, [in] UINT cNames, [in] LCID lcid, [out, size_is(cNames)] DISPID *rgDispId);
Maybe the size_is() field should be noticed somewhere in the marshalling code. I don't know where such information would surface though, it's not in the flags, there is no PARAMFLAG constant for it.
There is no way of expressing size_of once the IDL is in TypeLib form. It is effectively ignored. However, it is used in the proxy and stub functions generated. I'm not sure what interface it is marshalling here, but your error would appear to be elsewhere.
Using a test program which dumps type libraries, I can confirm that LPOLESTR * is compiled to CHAR** on Windows. I can't quite seem why, but it appears that the marshalling that is being done is correct, at least for the information available to it.
Rob
There is no way of expressing size_of once the IDL is in TypeLib form. It is effectively ignored. However, it is used in the proxy and stub functions generated. I'm not sure what interface it is marshalling here, but your error would appear to be elsewhere.
How does typelib marshalling handle arrays? It's marshalling IDispatch, and this parameter is in IDispatch::GetIDsFromNames().
Using a test program which dumps type libraries, I can confirm that LPOLESTR
- is compiled to CHAR** on Windows. I can't quite seem why, but it appears
that the marshalling that is being done is correct, at least for the information available to it.
Well, the invocation returns DISP_E_UNKNOWNNAME, which is a valid return value for the function, but as the call is successful when using native ole dlls the most obvious possibility is that the names array is being incorrectly marshalled (which would lead to no matches being found).
thanks -mike
There is no way of expressing size_of once the IDL is in TypeLib form.
It is
effectively ignored. However, it is used in the proxy and stub functions generated. I'm not sure what interface it is marshalling here, but your error would appear to be elsewhere.
How does typelib marshalling handle arrays? It's marshalling IDispatch, and this parameter is in IDispatch::GetIDsFromNames().
my guess would be that IDispatch has a custom marshaller defined in windows. You should be able to verify this in the registry (though I don't remember how).
Kelly
-----Original Message----- From: Kelly Leahy [mailto:kellyleahy@swbell.net] Sent: 18 July 2003 21:44 To: Mike Hearn; Robert Shearman Cc: wine-devel@winehq.org Subject: Re: Typelib marshalling BSTRs
How does typelib marshalling handle arrays? It's marshalling IDispatch, and this parameter is in IDispatch::GetIDsFromNames().
my guess would be that IDispatch has a custom marshaller defined in windows. You should be able to verify this in the registry (though I don't remember how).
It already has a custom marshaller (in dlls/oleaut32/oaidl_p.c). The question is: should it be called from here? I would guess that the VT_PTR handling is a incomplete at the moment, since it appears to only be marshalling the one byte, whereas it should be marshalling an array of bytes. To be honest, I don't think the VT_PTR case can marshal anything correctly, without calling the associated proxy/stub function (custom marshaller). I probably don't understand enough to answer this question and Ove is probably the best person to answer this, but I thought I'd give it stab anyway and see if this makes sense.
Rob