Sync to Wine-0_9_3:

Robert Shearman <rob@codeweavers.com>
- Make dump functions const.
- OLE: Implement undocumented behaviour in DispCallFunc.
  Fix DispCallFunc to work with MSDN-undocumented behaviour used by
  Office 2003 and document the function.
- OLE: Implement ITypeInfo_AddressOfMember.
- OLE: Update the type of the oVft parameter for DispCallFunc.
- OLE: ITypeInfo_Invoke parameter naming change.
  Rename the dwFlags parameter of ITypeInfo_Invoke since it is not a
  DWORD, but an unsigned short.
- OLE: Support HREFTYPEs For ITypeInfos
  Add support for reading the hreftype of a typeinfo, return it to the
  application in ITypeComp_Bind for the DESKIND_APPOBJECT case and
  support referencing it in ITypeInfo_GetRefTypeInfo.
- OLE: fix function name loading
  Correctly get the name of the second function of a propget/propput
  pair in MSFT typelibs when the name offset is set to -1.
- OLE: fix invoking dispinterface functions
  Fix invoking dispinterface functions by using the internal
  representation of the function, not the one returned to applications.
- OLE: Move the dispinterface return value handling to functions that
  return the FUNCDESC to the user.
- OLE: fix handling of INVOKE_PROPERTYGET flag in ITypeComp_fnBind.
- OLE: Fix brokenness in typelib marshaller caused by dispinterface retval fix.
- Fix more fallout from dispinterface retval patch: make typelib
  marshaler use the internal function description so that it calls
  dispinterface functions with the correct number of parameters again.
- Also fixes some memory leaks caused by the fact that a corresponding
  ReleaseXDesc function has to be called for each GetXDesc.
Michael Stefaniuc <mstefani@redhat.de>
- Fix VarBstrCmp for NULL input BSTRs (MSDN is wrong).

svn path=/trunk/; revision=20136
This commit is contained in:
Gé van Geldorp 2005-12-12 23:54:50 +00:00
parent 2b8ceb888a
commit 7d9ffb5dc6
4 changed files with 636 additions and 193 deletions

View file

@ -304,12 +304,12 @@ _get_typeinfo_for_iid(REFIID riid, ITypeInfo**ti) {
*/ */
static int _nroffuncs(ITypeInfo *tinfo) { static int _nroffuncs(ITypeInfo *tinfo) {
int n, max = 0; int n, max = 0;
FUNCDESC *fdesc; const FUNCDESC *fdesc;
HRESULT hres; HRESULT hres;
n=0; n=0;
while (1) { while (1) {
hres = ITypeInfo_GetFuncDesc(tinfo,n,&fdesc); hres = ITypeInfoImpl_GetInternalFuncDesc(tinfo,n,&fdesc);
if (hres) if (hres)
return max+1; return max+1;
if (fdesc->oVft/4 > max) if (fdesc->oVft/4 > max)
@ -1053,6 +1053,7 @@ deserialize_param(
(DWORD*)(((LPBYTE)*arg)+vdesc->u.oInst), (DWORD*)(((LPBYTE)*arg)+vdesc->u.oInst),
buf buf
); );
ITypeInfo2_ReleaseVarDesc(tinfo2, vdesc);
if (debugout && (i<tattr->cVars-1)) TRACE_(olerelay)(","); if (debugout && (i<tattr->cVars-1)) TRACE_(olerelay)(",");
} }
if (debugout) TRACE_(olerelay)("}"); if (debugout) TRACE_(olerelay)("}");
@ -1108,7 +1109,7 @@ deserialize_param(
/* Searches function, also in inherited interfaces */ /* Searches function, also in inherited interfaces */
static HRESULT static HRESULT
_get_funcdesc( _get_funcdesc(
ITypeInfo *tinfo, int iMethod, ITypeInfo **tactual, FUNCDESC **fdesc, BSTR *iname, BSTR *fname) ITypeInfo *tinfo, int iMethod, ITypeInfo **tactual, const FUNCDESC **fdesc, BSTR *iname, BSTR *fname)
{ {
int i = 0, j = 0; int i = 0, j = 0;
HRESULT hres; HRESULT hres;
@ -1120,7 +1121,8 @@ _get_funcdesc(
ITypeInfo_AddRef(*tactual); ITypeInfo_AddRef(*tactual);
while (1) { while (1) {
hres = ITypeInfo_GetFuncDesc(tinfo, i, fdesc); hres = ITypeInfoImpl_GetInternalFuncDesc(tinfo, i, fdesc);
if (hres) { if (hres) {
ITypeInfo *tinfo2; ITypeInfo *tinfo2;
HREFTYPE href; HREFTYPE href;
@ -1164,7 +1166,7 @@ static DWORD
xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */)
{ {
DWORD *args = ((DWORD*)&tpinfo)+1, *xargs; DWORD *args = ((DWORD*)&tpinfo)+1, *xargs;
FUNCDESC *fdesc; const FUNCDESC *fdesc;
HRESULT hres; HRESULT hres;
int i, relaydeb = TRACE_ON(olerelay); int i, relaydeb = TRACE_ON(olerelay);
marshal_state buf; marshal_state buf;
@ -1451,7 +1453,7 @@ PSFacBuf_CreateProxy(
HRESULT hres; HRESULT hres;
ITypeInfo *tinfo; ITypeInfo *tinfo;
int i, nroffuncs; int i, nroffuncs;
FUNCDESC *fdesc; const FUNCDESC *fdesc;
TMProxyImpl *proxy; TMProxyImpl *proxy;
TYPEATTR *typeattr; TYPEATTR *typeattr;
@ -1647,7 +1649,7 @@ TMStubImpl_Invoke(
LPRPCSTUBBUFFER iface, RPCOLEMESSAGE* xmsg,IRpcChannelBuffer*rpcchanbuf) LPRPCSTUBBUFFER iface, RPCOLEMESSAGE* xmsg,IRpcChannelBuffer*rpcchanbuf)
{ {
int i; int i;
FUNCDESC *fdesc; const FUNCDESC *fdesc;
TMStubImpl *This = (TMStubImpl *)iface; TMStubImpl *This = (TMStubImpl *)iface;
HRESULT hres; HRESULT hres;
DWORD *args, res, *xargs, nrofargs; DWORD *args, res, *xargs, nrofargs;

File diff suppressed because it is too large Load diff

View file

@ -600,8 +600,10 @@ WORD typeofarray
#include "poppack.h" #include "poppack.h"
HRESULT ITypeInfoImpl_GetInternalFuncDesc( ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc );
extern DWORD _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args); extern DWORD _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args);
extern void dump_Variant(VARIANT * pvar); extern void dump_Variant(const VARIANT * pvar);
HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv); HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv);

View file

@ -6599,23 +6599,21 @@ HRESULT WINAPI VarBstrCat(BSTR pbstrLeft, BSTR pbstrRight, BSTR *pbstrOut)
* RETURNS * RETURNS
* VARCMP_LT, VARCMP_EQ or VARCMP_GT indicating that pbstrLeft is less * VARCMP_LT, VARCMP_EQ or VARCMP_GT indicating that pbstrLeft is less
* than, equal to or greater than pbstrRight respectively. * than, equal to or greater than pbstrRight respectively.
* VARCMP_NULL is returned if either string is NULL, unless both are NULL *
* in which case VARCMP_EQ is returned. * NOTES
* VARCMP_NULL is NOT returned if either string is NULL unlike MSDN
* states. A NULL BSTR pointer is equivalent to an empty string.
*/ */
HRESULT WINAPI VarBstrCmp(BSTR pbstrLeft, BSTR pbstrRight, LCID lcid, DWORD dwFlags) HRESULT WINAPI VarBstrCmp(BSTR pbstrLeft, BSTR pbstrRight, LCID lcid, DWORD dwFlags)
{ {
if (!pbstrLeft) if (!pbstrLeft || !*pbstrLeft)
{ {
if (!pbstrRight || !*pbstrRight) if (!pbstrRight || !*pbstrRight)
return VARCMP_EQ; return VARCMP_EQ;
return VARCMP_NULL; return VARCMP_LT;
}
else if (!pbstrRight)
{
if (!*pbstrLeft)
return VARCMP_EQ;
return VARCMP_NULL;
} }
else if (!pbstrRight || !*pbstrRight)
return VARCMP_GT;
return CompareStringW(lcid, dwFlags, pbstrLeft, -1, pbstrRight, -1) - 1; return CompareStringW(lcid, dwFlags, pbstrLeft, -1, pbstrRight, -1) - 1;
} }