- Get full OLEAUT32 to compile.

svn path=/trunk/; revision=11893
This commit is contained in:
Filip Navara 2004-12-01 20:06:15 +00:00
parent 18ef45edfe
commit b1ac258a6d
16 changed files with 1379 additions and 459 deletions

View file

@ -813,11 +813,11 @@ DECLARE_INTERFACE_(IRpcStubBuffer,IUnknown)
STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(Connect)(THIS_ LPUNKNOWN) PURE; STDMETHOD(Connect)(THIS_ LPUNKNOWN) PURE;
STDMETHOD_(void,Disconnect)(THIS) PURE; STDMETHOD_(void,Disconnect)(THIS) PURE;
STDMETHOD(Invoke)(THIS_ RPCOLEMESSAGE*,LPRPCSTUBBUFFER) PURE; STDMETHOD(Invoke)(THIS_ RPCOLEMESSAGE*,LPRPCCHANNELBUFFER) PURE;
STDMETHOD_(LPRPCSTUBBUFFER,IsIIDSupported)(THIS_ REFIID) PURE; STDMETHOD_(LPRPCSTUBBUFFER,IsIIDSupported)(THIS_ REFIID) PURE;
STDMETHOD_(ULONG,CountRefs)(THIS) PURE; STDMETHOD_(ULONG,CountRefs)(THIS) PURE;
STDMETHOD(DebugServerQueryInterface)(THIS_ PVOID*) PURE; STDMETHOD(DebugServerQueryInterface)(THIS_ PVOID*) PURE;
STDMETHOD(DebugServerRelease)(THIS_ PVOID) PURE; STDMETHOD_(VOID,DebugServerRelease)(THIS_ PVOID) PURE;
}; };
#undef INTERFACE #undef INTERFACE

View file

@ -15,22 +15,21 @@ C_SRCS = \
connpt.c \ connpt.c \
dispatch.c \ dispatch.c \
hash.c \ hash.c \
oaidl_p.c \
oleaut.c \ oleaut.c \
olefont.c \
olepicture.c \ olepicture.c \
regsvr.c \
safearray.c \ safearray.c \
stubs.c \ stubs.c \
tmarshal.c \
typelib.c \
typelib2.c \
usrmarshal.c \
varformat.c \ varformat.c \
variant.c \ variant.c \
vartype.c vartype.c
# regsvr.c \
# olefont.c \
# tmarshal.c \
# usrmarshal.c \
# oaidl_p.c \
# typelib.c \
# typelib2.c \
C_SRCS16 = \ C_SRCS16 = \
ole2disp.c \ ole2disp.c \
typelib16.c typelib16.c

View file

@ -1,5 +1,14 @@
/* this ALWAYS GENERATED file contains the proxy stub code */ /* This file contains the proxy/stub code for core COM interfaces.
It is usually generated directly by MIDL, however this file has
been tweaked since then to account for slight differences in the way
gcc and MSVC++ compile it. In particular, in some functions REFIIDs
declared on the stack have been converted to plain IID* in order to eliminate
the constness of the REFIID type, ensuring that the zero initializer is not
discarded.
Therefore, please do not regenerate this file.
*/
/* File created by MIDL compiler version 5.01.0164 */ /* File created by MIDL compiler version 5.01.0164 */
/* at Tue Jan 07 22:24:52 2003 /* at Tue Jan 07 22:24:52 2003
@ -436,7 +445,7 @@ void __RPC_STUB IDispatch_GetIDsOfNames_Stub(
LCID lcid; LCID lcid;
DISPID __RPC_FAR *rgDispId; DISPID __RPC_FAR *rgDispId;
LPOLESTR __RPC_FAR *rgszNames; LPOLESTR __RPC_FAR *rgszNames;
REFIID riid = 0; IID* riid = 0;
NdrStubInitialize( NdrStubInitialize(
_pRpcMessage, _pRpcMessage,
@ -726,7 +735,7 @@ void __RPC_STUB IDispatch_RemoteInvoke_Stub(
VARIANT __RPC_FAR *pVarResult; VARIANT __RPC_FAR *pVarResult;
VARIANTARG __RPC_FAR *rgVarRef; VARIANTARG __RPC_FAR *rgVarRef;
UINT __RPC_FAR *rgVarRefIdx; UINT __RPC_FAR *rgVarRefIdx;
REFIID riid = 0; IID* riid = 0;
NdrStubInitialize( NdrStubInitialize(
_pRpcMessage, _pRpcMessage,
@ -4039,7 +4048,7 @@ void __RPC_STUB ITypeInfo_RemoteCreateInstance_Stub(
HRESULT _RetVal; HRESULT _RetVal;
MIDL_STUB_MESSAGE _StubMsg; MIDL_STUB_MESSAGE _StubMsg;
IUnknown __RPC_FAR *__RPC_FAR *ppvObj; IUnknown __RPC_FAR *__RPC_FAR *ppvObj;
REFIID riid = 0; IID* riid = 0;
NdrStubInitialize( NdrStubInitialize(
_pRpcMessage, _pRpcMessage,
@ -10751,7 +10760,7 @@ void __RPC_STUB ISupportErrorInfo_InterfaceSupportsErrorInfo_Stub(
{ {
HRESULT _RetVal; HRESULT _RetVal;
MIDL_STUB_MESSAGE _StubMsg; MIDL_STUB_MESSAGE _StubMsg;
REFIID riid = 0; IID* riid = 0;
NdrStubInitialize( NdrStubInitialize(
_pRpcMessage, _pRpcMessage,
@ -10931,7 +10940,7 @@ void __RPC_STUB ITypeFactory_CreateFromTypeInfo_Stub(
MIDL_STUB_MESSAGE _StubMsg; MIDL_STUB_MESSAGE _StubMsg;
ITypeInfo __RPC_FAR *pTypeInfo; ITypeInfo __RPC_FAR *pTypeInfo;
IUnknown __RPC_FAR *__RPC_FAR *ppv; IUnknown __RPC_FAR *__RPC_FAR *ppv;
REFIID riid = 0; IID* riid = 0;
NdrStubInitialize( NdrStubInitialize(
_pRpcMessage, _pRpcMessage,

View file

@ -24,16 +24,18 @@
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#define COBJMACROS
#define NONAMELESSUNION #define NONAMELESSUNION
#define NONAMELESSSTRUCT #define NONAMELESSSTRUCT
#include "winerror.h" #include "winerror.h"
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "oleauto.h" /* for SysAllocString(....) */
#include "objbase.h" #include "objbase.h"
#include "oleauto.h" /* for SysAllocString(....) */
#include "ole2.h" #include "ole2.h"
#include "olectl.h" #include "olectl.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -61,12 +63,12 @@ struct OLEFontImpl
* The first two are supported by the first vtable, the next two are * The first two are supported by the first vtable, the next two are
* supported by the second table and the last two have their own. * supported by the second table and the last two have their own.
*/ */
ICOM_VTABLE(IFont)* lpvtbl1; IFontVtbl* lpvtbl1;
ICOM_VTABLE(IDispatch)* lpvtbl2; IDispatchVtbl* lpvtbl2;
ICOM_VTABLE(IPersistStream)* lpvtbl3; IPersistStreamVtbl* lpvtbl3;
ICOM_VTABLE(IConnectionPointContainer)* lpvtbl4; IConnectionPointContainerVtbl* lpvtbl4;
ICOM_VTABLE(IPersistPropertyBag)* lpvtbl5; IPersistPropertyBagVtbl* lpvtbl5;
ICOM_VTABLE(IPersistStreamInit)* lpvtbl6; IPersistStreamInitVtbl* lpvtbl6;
/* /*
* Reference count for that instance of the class. * Reference count for that instance of the class.
*/ */
@ -102,7 +104,6 @@ struct OLEFontImpl
* There is a version to accomodate all of the VTables implemented * There is a version to accomodate all of the VTables implemented
* by this object. * by this object.
*/ */
#define _ICOM_THIS(class,name) class* this = (class*)name
#define _ICOM_THIS_From_IDispatch(class, name) class* this = (class*)(((char*)name)-sizeof(void*)) #define _ICOM_THIS_From_IDispatch(class, name) class* this = (class*)(((char*)name)-sizeof(void*))
#define _ICOM_THIS_From_IPersistStream(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*)) #define _ICOM_THIS_From_IPersistStream(class, name) class* this = (class*)(((char*)name)-2*sizeof(void*))
#define _ICOM_THIS_From_IConnectionPointContainer(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*)) #define _ICOM_THIS_From_IConnectionPointContainer(class, name) class* this = (class*)(((char*)name)-3*sizeof(void*))
@ -218,9 +219,8 @@ static HRESULT WINAPI OLEFontImpl_FindConnectionPoint(
/* /*
* Virtual function tables for the OLEFontImpl class. * Virtual function tables for the OLEFontImpl class.
*/ */
static ICOM_VTABLE(IFont) OLEFontImpl_VTable = static IFontVtbl OLEFontImpl_VTable =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
OLEFontImpl_QueryInterface, OLEFontImpl_QueryInterface,
OLEFontImpl_AddRef, OLEFontImpl_AddRef,
OLEFontImpl_Release, OLEFontImpl_Release,
@ -250,9 +250,8 @@ static ICOM_VTABLE(IFont) OLEFontImpl_VTable =
OLEFontImpl_SetHdc OLEFontImpl_SetHdc
}; };
static ICOM_VTABLE(IDispatch) OLEFontImpl_IDispatch_VTable = static IDispatchVtbl OLEFontImpl_IDispatch_VTable =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
OLEFontImpl_IDispatch_QueryInterface, OLEFontImpl_IDispatch_QueryInterface,
OLEFontImpl_IDispatch_AddRef, OLEFontImpl_IDispatch_AddRef,
OLEFontImpl_IDispatch_Release, OLEFontImpl_IDispatch_Release,
@ -262,9 +261,8 @@ static ICOM_VTABLE(IDispatch) OLEFontImpl_IDispatch_VTable =
OLEFontImpl_Invoke OLEFontImpl_Invoke
}; };
static ICOM_VTABLE(IPersistStream) OLEFontImpl_IPersistStream_VTable = static IPersistStreamVtbl OLEFontImpl_IPersistStream_VTable =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
OLEFontImpl_IPersistStream_QueryInterface, OLEFontImpl_IPersistStream_QueryInterface,
OLEFontImpl_IPersistStream_AddRef, OLEFontImpl_IPersistStream_AddRef,
OLEFontImpl_IPersistStream_Release, OLEFontImpl_IPersistStream_Release,
@ -275,10 +273,9 @@ static ICOM_VTABLE(IPersistStream) OLEFontImpl_IPersistStream_VTable =
OLEFontImpl_GetSizeMax OLEFontImpl_GetSizeMax
}; };
static ICOM_VTABLE(IConnectionPointContainer) static IConnectionPointContainerVtbl
OLEFontImpl_IConnectionPointContainer_VTable = OLEFontImpl_IConnectionPointContainer_VTable =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
OLEFontImpl_IConnectionPointContainer_QueryInterface, OLEFontImpl_IConnectionPointContainer_QueryInterface,
OLEFontImpl_IConnectionPointContainer_AddRef, OLEFontImpl_IConnectionPointContainer_AddRef,
OLEFontImpl_IConnectionPointContainer_Release, OLEFontImpl_IConnectionPointContainer_Release,
@ -286,8 +283,8 @@ static ICOM_VTABLE(IConnectionPointContainer)
OLEFontImpl_FindConnectionPoint OLEFontImpl_FindConnectionPoint
}; };
static ICOM_VTABLE(IPersistPropertyBag) OLEFontImpl_IPersistPropertyBag_VTable; static IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable;
static ICOM_VTABLE(IPersistStreamInit) OLEFontImpl_IPersistStreamInit_VTable; static IPersistStreamInitVtbl OLEFontImpl_IPersistStreamInit_VTable;
/****************************************************************************** /******************************************************************************
* OleCreateFontIndirect [OLEAUT32.420] * OleCreateFontIndirect [OLEAUT32.420]
*/ */
@ -311,10 +308,10 @@ HRESULT WINAPI OleCreateFontIndirect(
if (!lpFontDesc) { if (!lpFontDesc) {
FONTDESC fd; FONTDESC fd;
WCHAR fname[] = { 'S','y','s','t','e','m',0 }; static const WCHAR fname[] = { 'S','y','s','t','e','m',0 };
fd.cbSizeofstruct = sizeof(fd); fd.cbSizeofstruct = sizeof(fd);
fd.lpstrName = fname; fd.lpstrName = (WCHAR*)fname;
fd.cySize.s.Lo = 80000; fd.cySize.s.Lo = 80000;
fd.cySize.s.Hi = 0; fd.cySize.s.Hi = 0;
fd.sWeight = 0; fd.sWeight = 0;
@ -476,7 +473,7 @@ HRESULT WINAPI OLEFontImpl_QueryInterface(
REFIID riid, REFIID riid,
void** ppvObject) void** ppvObject)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%s, %p)\n", this, debugstr_guid(riid), ppvObject); TRACE("(%p)->(%s, %p)\n", this, debugstr_guid(riid), ppvObject);
/* /*
@ -530,11 +527,9 @@ HRESULT WINAPI OLEFontImpl_QueryInterface(
ULONG WINAPI OLEFontImpl_AddRef( ULONG WINAPI OLEFontImpl_AddRef(
IFont* iface) IFont* iface)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(ref=%ld)\n", this, this->ref); TRACE("(%p)->(ref=%ld)\n", this, this->ref);
this->ref++; return InterlockedIncrement(&this->ref);
return this->ref;
} }
/************************************************************************ /************************************************************************
@ -545,25 +540,21 @@ ULONG WINAPI OLEFontImpl_AddRef(
ULONG WINAPI OLEFontImpl_Release( ULONG WINAPI OLEFontImpl_Release(
IFont* iface) IFont* iface)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
ULONG ret;
TRACE("(%p)->(ref=%ld)\n", this, this->ref); TRACE("(%p)->(ref=%ld)\n", this, this->ref);
/* /*
* Decrease the reference count on this object. * Decrease the reference count on this object.
*/ */
this->ref--; ret = InterlockedDecrement(&this->ref);
/* /*
* If the reference count goes down to 0, perform suicide. * If the reference count goes down to 0, perform suicide.
*/ */
if (this->ref==0) if (ret==0) OLEFontImpl_Destroy(this);
{
OLEFontImpl_Destroy(this);
return 0; return ret;
}
return this->ref;
} }
/************************************************************************ /************************************************************************
@ -575,7 +566,7 @@ static HRESULT WINAPI OLEFontImpl_get_Name(
IFont* iface, IFont* iface,
BSTR* pname) BSTR* pname)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, pname); TRACE("(%p)->(%p)\n", this, pname);
/* /*
* Sanity check. * Sanity check.
@ -600,7 +591,7 @@ static HRESULT WINAPI OLEFontImpl_put_Name(
IFont* iface, IFont* iface,
BSTR name) BSTR name)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, name); TRACE("(%p)->(%p)\n", this, name);
if (this->description.lpstrName==0) if (this->description.lpstrName==0)
@ -635,7 +626,7 @@ static HRESULT WINAPI OLEFontImpl_get_Size(
IFont* iface, IFont* iface,
CY* psize) CY* psize)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, psize); TRACE("(%p)->(%p)\n", this, psize);
/* /*
@ -659,7 +650,7 @@ static HRESULT WINAPI OLEFontImpl_put_Size(
IFont* iface, IFont* iface,
CY size) CY size)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%ld)\n", this, size.s.Lo); TRACE("(%p)->(%ld)\n", this, size.s.Lo);
this->description.cySize.s.Hi = 0; this->description.cySize.s.Hi = 0;
this->description.cySize.s.Lo = size.s.Lo; this->description.cySize.s.Lo = size.s.Lo;
@ -677,7 +668,7 @@ static HRESULT WINAPI OLEFontImpl_get_Bold(
IFont* iface, IFont* iface,
BOOL* pbold) BOOL* pbold)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, pbold); TRACE("(%p)->(%p)\n", this, pbold);
/* /*
* Sanity check * Sanity check
@ -699,7 +690,7 @@ static HRESULT WINAPI OLEFontImpl_put_Bold(
IFont* iface, IFont* iface,
BOOL bold) BOOL bold)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%d)\n", this, bold); TRACE("(%p)->(%d)\n", this, bold);
this->description.sWeight = bold ? FW_BOLD : FW_NORMAL; this->description.sWeight = bold ? FW_BOLD : FW_NORMAL;
OLEFont_SendNotify(this, DISPID_FONT_BOLD); OLEFont_SendNotify(this, DISPID_FONT_BOLD);
@ -716,7 +707,7 @@ static HRESULT WINAPI OLEFontImpl_get_Italic(
IFont* iface, IFont* iface,
BOOL* pitalic) BOOL* pitalic)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, pitalic); TRACE("(%p)->(%p)\n", this, pitalic);
/* /*
* Sanity check * Sanity check
@ -738,7 +729,7 @@ static HRESULT WINAPI OLEFontImpl_put_Italic(
IFont* iface, IFont* iface,
BOOL italic) BOOL italic)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%d)\n", this, italic); TRACE("(%p)->(%d)\n", this, italic);
this->description.fItalic = italic; this->description.fItalic = italic;
@ -756,7 +747,7 @@ static HRESULT WINAPI OLEFontImpl_get_Underline(
IFont* iface, IFont* iface,
BOOL* punderline) BOOL* punderline)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, punderline); TRACE("(%p)->(%p)\n", this, punderline);
/* /*
@ -779,7 +770,7 @@ static HRESULT WINAPI OLEFontImpl_put_Underline(
IFont* iface, IFont* iface,
BOOL underline) BOOL underline)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%d)\n", this, underline); TRACE("(%p)->(%d)\n", this, underline);
this->description.fUnderline = underline; this->description.fUnderline = underline;
@ -797,7 +788,7 @@ static HRESULT WINAPI OLEFontImpl_get_Strikethrough(
IFont* iface, IFont* iface,
BOOL* pstrikethrough) BOOL* pstrikethrough)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, pstrikethrough); TRACE("(%p)->(%p)\n", this, pstrikethrough);
/* /*
@ -820,7 +811,7 @@ static HRESULT WINAPI OLEFontImpl_put_Strikethrough(
IFont* iface, IFont* iface,
BOOL strikethrough) BOOL strikethrough)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%d)\n", this, strikethrough); TRACE("(%p)->(%d)\n", this, strikethrough);
this->description.fStrikethrough = strikethrough; this->description.fStrikethrough = strikethrough;
@ -838,7 +829,7 @@ static HRESULT WINAPI OLEFontImpl_get_Weight(
IFont* iface, IFont* iface,
short* pweight) short* pweight)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, pweight); TRACE("(%p)->(%p)\n", this, pweight);
/* /*
@ -861,7 +852,7 @@ static HRESULT WINAPI OLEFontImpl_put_Weight(
IFont* iface, IFont* iface,
short weight) short weight)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%d)\n", this, weight); TRACE("(%p)->(%d)\n", this, weight);
this->description.sWeight = weight; this->description.sWeight = weight;
@ -879,7 +870,7 @@ static HRESULT WINAPI OLEFontImpl_get_Charset(
IFont* iface, IFont* iface,
short* pcharset) short* pcharset)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, pcharset); TRACE("(%p)->(%p)\n", this, pcharset);
/* /*
@ -902,7 +893,7 @@ static HRESULT WINAPI OLEFontImpl_put_Charset(
IFont* iface, IFont* iface,
short charset) short charset)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%d)\n", this, charset); TRACE("(%p)->(%d)\n", this, charset);
this->description.sCharset = charset; this->description.sCharset = charset;
@ -920,7 +911,7 @@ static HRESULT WINAPI OLEFontImpl_get_hFont(
IFont* iface, IFont* iface,
HFONT* phfont) HFONT* phfont)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, phfont); TRACE("(%p)->(%p)\n", this, phfont);
if (phfont==NULL) if (phfont==NULL)
return E_POINTER; return E_POINTER;
@ -980,7 +971,7 @@ static HRESULT WINAPI OLEFontImpl_Clone(
LOGFONTW logFont; LOGFONTW logFont;
INT fontHeight; INT fontHeight;
CY cySize; CY cySize;
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p)\n", this, ppfont); TRACE("(%p)->(%p)\n", this, ppfont);
if (ppfont == NULL) if (ppfont == NULL)
@ -1060,7 +1051,7 @@ static HRESULT WINAPI OLEFontImpl_SetRatio(
long cyLogical, long cyLogical,
long cyHimetric) long cyHimetric)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%ld, %ld)\n", this, cyLogical, cyHimetric); TRACE("(%p)->(%ld, %ld)\n", this, cyLogical, cyHimetric);
this->cyLogical = cyLogical; this->cyLogical = cyLogical;
@ -1091,7 +1082,7 @@ static HRESULT WINAPI OLEFontImpl_AddRefHfont(
IFont* iface, IFont* iface,
HFONT hfont) HFONT hfont)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont, this->fontLock); TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont, this->fontLock);
if ( (hfont == 0) || if ( (hfont == 0) ||
@ -1112,7 +1103,7 @@ static HRESULT WINAPI OLEFontImpl_ReleaseHfont(
IFont* iface, IFont* iface,
HFONT hfont) HFONT hfont)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont, this->fontLock); TRACE("(%p)->(%p) (lock=%ld)\n", this, hfont, this->fontLock);
if ( (hfont == 0) || if ( (hfont == 0) ||
@ -1142,7 +1133,7 @@ static HRESULT WINAPI OLEFontImpl_SetHdc(
IFont* iface, IFont* iface,
HDC hdc) HDC hdc)
{ {
_ICOM_THIS(OLEFontImpl, iface); OLEFontImpl *this = (OLEFontImpl *)iface;
FIXME("(%p)->(%p): Stub\n", this, hdc); FIXME("(%p)->(%p): Stub\n", this, hdc);
return E_NOTIMPL; return E_NOTIMPL;
} }
@ -1214,7 +1205,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
LCID lcid, LCID lcid,
ITypeInfo** ppTInfo) ITypeInfo** ppTInfo)
{ {
WCHAR stdole32tlb[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0}; static const WCHAR stdole32tlb[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0};
ITypeLib *tl; ITypeLib *tl;
HRESULT hres; HRESULT hres;
@ -1841,8 +1832,132 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_InitNew(
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load( static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Load(
IPersistPropertyBag *iface, IPropertyBag* pPropBag, IErrorLog* pErrorLog IPersistPropertyBag *iface, IPropertyBag* pPropBag, IErrorLog* pErrorLog
) { ) {
FIXME("(%p,%p,%p), stub!\n", iface, pPropBag, pErrorLog); /* (from Visual Basic 6 property bag)
return E_FAIL; Name = "MS Sans Serif"
Size = 13.8
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
*/
static const WCHAR sAttrName[] = {'N','a','m','e',0};
static const WCHAR sAttrSize[] = {'S','i','z','e',0};
static const WCHAR sAttrCharset[] = {'C','h','a','r','s','e','t',0};
static const WCHAR sAttrWeight[] = {'W','e','i','g','h','t',0};
static const WCHAR sAttrUnderline[] = {'U','n','d','e','r','l','i','n','e',0};
static const WCHAR sAttrItalic[] = {'I','t','a','l','i','c',0};
static const WCHAR sAttrStrikethrough[] = {'S','t','r','i','k','e','t','h','r','o','u','g','h',0};
VARIANT rawAttr;
VARIANT valueAttr;
HRESULT iRes = S_OK;
_ICOM_THIS_From_IPersistPropertyBag(IFont, iface);
VariantInit(&rawAttr);
VariantInit(&valueAttr);
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrName, &rawAttr, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BSTR);
if (iRes == S_OK)
iRes = IFont_put_Name(this, V_BSTR(&valueAttr));
}
else if (iRes == E_INVALIDARG)
iRes = S_OK;
VariantClear(&rawAttr);
VariantClear(&valueAttr);
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrSize, &rawAttr, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_CY);
if (iRes == S_OK)
iRes = IFont_put_Size(this, V_CY(&valueAttr));
}
else if (iRes == E_INVALIDARG)
iRes = S_OK;
VariantClear(&rawAttr);
VariantClear(&valueAttr);
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrCharset, &rawAttr, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_I2);
if (iRes == S_OK)
iRes = IFont_put_Charset(this, V_I2(&valueAttr));
}
else if (iRes == E_INVALIDARG)
iRes = S_OK;
VariantClear(&rawAttr);
VariantClear(&valueAttr);
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrWeight, &rawAttr, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_I2);
if (iRes == S_OK)
iRes = IFont_put_Weight(this, V_I2(&valueAttr));
}
else if (iRes == E_INVALIDARG)
iRes = S_OK;
VariantClear(&rawAttr);
VariantClear(&valueAttr);
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrUnderline, &rawAttr, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL);
if (iRes == S_OK)
iRes = IFont_put_Underline(this, V_BOOL(&valueAttr));
}
else if (iRes == E_INVALIDARG)
iRes = S_OK;
VariantClear(&rawAttr);
VariantClear(&valueAttr);
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrItalic, &rawAttr, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL);
if (iRes == S_OK)
iRes = IFont_put_Italic(this, V_BOOL(&valueAttr));
}
else if (iRes == E_INVALIDARG)
iRes = S_OK;
VariantClear(&rawAttr);
VariantClear(&valueAttr);
}
if (iRes == S_OK) {
iRes = IPropertyBag_Read(pPropBag, sAttrStrikethrough, &rawAttr, pErrorLog);
if (iRes == S_OK)
{
iRes = VariantChangeType(&rawAttr, &valueAttr, 0, VT_BOOL);
if (iRes == S_OK)
IFont_put_Strikethrough(this, V_BOOL(&valueAttr));
}
else if (iRes == E_INVALIDARG)
iRes = S_OK;
VariantClear(&rawAttr);
VariantClear(&valueAttr);
}
if (FAILED(iRes))
WARN("-- 0x%08lx\n", iRes);
return iRes;
} }
static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Save( static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Save(
@ -1853,9 +1968,8 @@ static HRESULT WINAPI OLEFontImpl_IPersistPropertyBag_Save(
return E_FAIL; return E_FAIL;
} }
static ICOM_VTABLE(IPersistPropertyBag) OLEFontImpl_IPersistPropertyBag_VTable = static IPersistPropertyBagVtbl OLEFontImpl_IPersistPropertyBag_VTable =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
OLEFontImpl_IPersistPropertyBag_QueryInterface, OLEFontImpl_IPersistPropertyBag_QueryInterface,
OLEFontImpl_IPersistPropertyBag_AddRef, OLEFontImpl_IPersistPropertyBag_AddRef,
OLEFontImpl_IPersistPropertyBag_Release, OLEFontImpl_IPersistPropertyBag_Release,
@ -1932,9 +2046,8 @@ static HRESULT WINAPI OLEFontImpl_IPersistStreamInit_InitNew(
return S_OK; return S_OK;
} }
static ICOM_VTABLE(IPersistStreamInit) OLEFontImpl_IPersistStreamInit_VTable = static IPersistStreamInitVtbl OLEFontImpl_IPersistStreamInit_VTable =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
OLEFontImpl_IPersistStreamInit_QueryInterface, OLEFontImpl_IPersistStreamInit_QueryInterface,
OLEFontImpl_IPersistStreamInit_AddRef, OLEFontImpl_IPersistStreamInit_AddRef,
OLEFontImpl_IPersistStreamInit_Release, OLEFontImpl_IPersistStreamInit_Release,
@ -1953,13 +2066,13 @@ static ICOM_VTABLE(IPersistStreamInit) OLEFontImpl_IPersistStreamInit_VTable =
typedef struct typedef struct
{ {
/* IUnknown fields */ /* IUnknown fields */
ICOM_VFIELD(IClassFactory); IClassFactoryVtbl *lpVtbl;
DWORD ref; DWORD ref;
} IClassFactoryImpl; } IClassFactoryImpl;
static HRESULT WINAPI static HRESULT WINAPI
SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
ICOM_THIS(IClassFactoryImpl,iface); IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE; return E_NOINTERFACE;
@ -1967,14 +2080,14 @@ SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
static ULONG WINAPI static ULONG WINAPI
SFCF_AddRef(LPCLASSFACTORY iface) { SFCF_AddRef(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface); IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
return ++(This->ref); return InterlockedIncrement(&This->ref);
} }
static ULONG WINAPI SFCF_Release(LPCLASSFACTORY iface) { static ULONG WINAPI SFCF_Release(LPCLASSFACTORY iface) {
ICOM_THIS(IClassFactoryImpl,iface); IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
/* static class, won't be freed */ /* static class, won't be freed */
return --(This->ref); return InterlockedDecrement(&This->ref);
} }
static HRESULT WINAPI SFCF_CreateInstance( static HRESULT WINAPI SFCF_CreateInstance(
@ -1985,13 +2098,12 @@ static HRESULT WINAPI SFCF_CreateInstance(
} }
static HRESULT WINAPI SFCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { static HRESULT WINAPI SFCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) {
ICOM_THIS(IClassFactoryImpl,iface); IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
FIXME("(%p)->(%d),stub!\n",This,dolock); FIXME("(%p)->(%d),stub!\n",This,dolock);
return S_OK; return S_OK;
} }
static ICOM_VTABLE(IClassFactory) SFCF_Vtbl = { static IClassFactoryVtbl SFCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
SFCF_QueryInterface, SFCF_QueryInterface,
SFCF_AddRef, SFCF_AddRef,
SFCF_Release, SFCF_Release,

View file

@ -3,6 +3,9 @@
* *
* Copyright 2002 Marcus Meissner * Copyright 2002 Marcus Meissner
* *
* The olerelay debug channel allows you to see calls marshalled by
* the typelib marshaller. It is not a generic COM relaying system.
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -50,6 +53,8 @@ static const WCHAR ppvObjectW[] = {'p','p','v','O','b','j','e','c','t',0};
WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(olerelay); WINE_DECLARE_DEBUG_CHANNEL(olerelay);
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
typedef struct _marshal_state { typedef struct _marshal_state {
LPBYTE base; LPBYTE base;
int size; int size;
@ -59,6 +64,14 @@ typedef struct _marshal_state {
IID iid; /* HACK: for VT_VOID */ IID iid; /* HACK: for VT_VOID */
} marshal_state; } marshal_state;
/* used in the olerelay code to avoid having the L"" stuff added by debugstr_w */
static char *relaystr(WCHAR *in) {
char *tmp = (char *)debugstr_w(in);
tmp += 2;
tmp[strlen(tmp)-1] = '\0';
return tmp;
}
static HRESULT static HRESULT
xbuf_add(marshal_state *buf, LPBYTE stuff, DWORD size) { xbuf_add(marshal_state *buf, LPBYTE stuff, DWORD size) {
while (buf->size - buf->curoff < size) { while (buf->size - buf->curoff < size) {
@ -274,6 +287,8 @@ static int _nroffuncs(ITypeInfo *tinfo) {
/*NOTREACHED*/ /*NOTREACHED*/
} }
#ifdef __i386__
#include "pshpack1.h" #include "pshpack1.h"
typedef struct _TMAsmProxy { typedef struct _TMAsmProxy {
@ -289,74 +304,99 @@ typedef struct _TMAsmProxy {
#include "poppack.h" #include "poppack.h"
#else /* __i386__ */
# error You need to implement stubless proxies for your architecture
#endif
typedef struct _TMProxyImpl { typedef struct _TMProxyImpl {
DWORD *lpvtbl; LPVOID *lpvtbl;
IRpcProxyBufferVtbl *lpvtbl2; IRpcProxyBufferVtbl *lpvtbl2;
DWORD ref; ULONG ref;
TMAsmProxy *asmstubs; TMAsmProxy *asmstubs;
ITypeInfo* tinfo; ITypeInfo* tinfo;
IRpcChannelBuffer* chanbuf; IRpcChannelBuffer* chanbuf;
IID iid; IID iid;
CRITICAL_SECTION crit;
} TMProxyImpl; } TMProxyImpl;
static HRESULT WINAPI static HRESULT WINAPI
TMProxyImpl_QueryInterface(LPRPCPROXYBUFFER iface, REFIID riid, LPVOID *ppv) { TMProxyImpl_QueryInterface(LPRPCPROXYBUFFER iface, REFIID riid, LPVOID *ppv)
{
TRACE("()\n"); TRACE("()\n");
if (IsEqualIID(riid,&IID_IUnknown)||IsEqualIID(riid,&IID_IRpcProxyBuffer)) { if (IsEqualIID(riid,&IID_IUnknown)||IsEqualIID(riid,&IID_IRpcProxyBuffer)) {
*ppv = (LPVOID)iface; *ppv = (LPVOID)iface;
IRpcProxyBuffer_AddRef(iface); IRpcProxyBuffer_AddRef(iface);
return S_OK; return S_OK;
} }
FIXME("no interface for %s\n",debugstr_guid(riid)); FIXME("no interface for %s\n",debugstr_guid(riid));
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static ULONG WINAPI static ULONG WINAPI
TMProxyImpl_AddRef(LPRPCPROXYBUFFER iface) { TMProxyImpl_AddRef(LPRPCPROXYBUFFER iface)
{
ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface); ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface);
TRACE("()\n"); TRACE("()\n");
This->ref++;
return This->ref; return InterlockedIncrement(&This->ref);
} }
static ULONG WINAPI static ULONG WINAPI
TMProxyImpl_Release(LPRPCPROXYBUFFER iface) { TMProxyImpl_Release(LPRPCPROXYBUFFER iface)
{
ULONG refs;
ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface); ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface);
TRACE("()\n"); TRACE("()\n");
This->ref--;
if (This->ref) return This->ref; refs = InterlockedDecrement(&This->ref);
if (This->chanbuf) IRpcChannelBuffer_Release(This->chanbuf); if (!refs)
HeapFree(GetProcessHeap(),0,This); {
return 0; DeleteCriticalSection(&This->crit);
if (This->chanbuf) IRpcChannelBuffer_Release(This->chanbuf);
VirtualFree(This->asmstubs, 0, MEM_RELEASE);
CoTaskMemFree(This);
}
return refs;
} }
static HRESULT WINAPI static HRESULT WINAPI
TMProxyImpl_Connect( TMProxyImpl_Connect(
LPRPCPROXYBUFFER iface,IRpcChannelBuffer* pRpcChannelBuffer LPRPCPROXYBUFFER iface,IRpcChannelBuffer* pRpcChannelBuffer)
) { {
ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface); ICOM_THIS_MULTI(TMProxyImpl, lpvtbl2, iface);
TRACE("(%p)\n",pRpcChannelBuffer); TRACE("(%p)\n", pRpcChannelBuffer);
EnterCriticalSection(&This->crit);
IRpcChannelBuffer_AddRef(pRpcChannelBuffer);
This->chanbuf = pRpcChannelBuffer; This->chanbuf = pRpcChannelBuffer;
IRpcChannelBuffer_AddRef(This->chanbuf);
LeaveCriticalSection(&This->crit);
return S_OK; return S_OK;
} }
static void WINAPI static void WINAPI
TMProxyImpl_Disconnect(LPRPCPROXYBUFFER iface) { TMProxyImpl_Disconnect(LPRPCPROXYBUFFER iface)
ICOM_THIS_MULTI(TMProxyImpl,lpvtbl2,iface); {
ICOM_THIS_MULTI(TMProxyImpl, lpvtbl2, iface);
TRACE("()\n");
EnterCriticalSection(&This->crit);
FIXME("()\n");
IRpcChannelBuffer_Release(This->chanbuf); IRpcChannelBuffer_Release(This->chanbuf);
This->chanbuf = NULL; This->chanbuf = NULL;
LeaveCriticalSection(&This->crit);
} }
static ICOM_VTABLE(IRpcProxyBuffer) tmproxyvtable = { static IRpcProxyBufferVtbl tmproxyvtable = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
TMProxyImpl_QueryInterface, TMProxyImpl_QueryInterface,
TMProxyImpl_AddRef, TMProxyImpl_AddRef,
TMProxyImpl_Release, TMProxyImpl_Release,
@ -365,7 +405,7 @@ static ICOM_VTABLE(IRpcProxyBuffer) tmproxyvtable = {
}; };
/* how much space do we use on stack in DWORD steps. */ /* how much space do we use on stack in DWORD steps. */
int const int
_argsize(DWORD vt) { _argsize(DWORD vt) {
switch (vt) { switch (vt) {
case VT_DATE: case VT_DATE:
@ -411,8 +451,8 @@ serialize_param(
BOOL dealloc, BOOL dealloc,
TYPEDESC *tdesc, TYPEDESC *tdesc,
DWORD *arg, DWORD *arg,
marshal_state *buf marshal_state *buf)
) { {
HRESULT hres = S_OK; HRESULT hres = S_OK;
TRACE("(tdesc.vt %d)\n",tdesc->vt); TRACE("(tdesc.vt %d)\n",tdesc->vt);
@ -429,7 +469,7 @@ serialize_param(
case VT_UI2: case VT_UI2:
case VT_UI1: case VT_UI1:
hres = S_OK; hres = S_OK;
if (debugout) MESSAGE("%lx",*arg); if (debugout) TRACE_(olerelay)("%lx",*arg);
if (writeit) if (writeit)
hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD)); hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD));
return hres; return hres;
@ -438,7 +478,7 @@ serialize_param(
VARIANT *vt = (VARIANT*)arg; VARIANT *vt = (VARIANT*)arg;
DWORD vttype = V_VT(vt); DWORD vttype = V_VT(vt);
if (debugout) MESSAGE("Vt(%ld)(",vttype); if (debugout) TRACE_(olerelay)("Vt(%ld)(",vttype);
tdesc2.vt = vttype; tdesc2.vt = vttype;
if (writeit) { if (writeit) {
hres = xbuf_add(buf,(LPBYTE)&vttype,sizeof(vttype)); hres = xbuf_add(buf,(LPBYTE)&vttype,sizeof(vttype));
@ -446,15 +486,15 @@ serialize_param(
} }
/* need to recurse since we need to free the stuff */ /* need to recurse since we need to free the stuff */
hres = serialize_param(tinfo,writeit,debugout,dealloc,&tdesc2,&(V_I4(vt)),buf); hres = serialize_param(tinfo,writeit,debugout,dealloc,&tdesc2,&(V_I4(vt)),buf);
if (debugout) MESSAGE(")"); if (debugout) TRACE_(olerelay)(")");
return hres; return hres;
} }
case VT_BSTR: { case VT_BSTR: {
if (debugout) { if (debugout) {
if (arg) if (arg)
MESSAGE("%s",debugstr_w((BSTR)*arg)); TRACE_(olerelay)("%s",relaystr((BSTR)*arg));
else else
MESSAGE("<bstr NULL>"); TRACE_(olerelay)("<bstr NULL>");
} }
if (writeit) { if (writeit) {
if (!*arg) { if (!*arg) {
@ -478,7 +518,7 @@ serialize_param(
case VT_PTR: { case VT_PTR: {
DWORD cookie; DWORD cookie;
if (debugout) MESSAGE("*"); if (debugout) TRACE_(olerelay)("*");
if (writeit) { if (writeit) {
cookie = *arg ? 0x42424242 : 0; cookie = *arg ? 0x42424242 : 0;
hres = xbuf_add(buf,(LPBYTE)&cookie,sizeof(cookie)); hres = xbuf_add(buf,(LPBYTE)&cookie,sizeof(cookie));
@ -486,7 +526,7 @@ serialize_param(
return hres; return hres;
} }
if (!*arg) { if (!*arg) {
if (debugout) MESSAGE("NULL"); if (debugout) TRACE_(olerelay)("NULL");
return S_OK; return S_OK;
} }
hres = serialize_param(tinfo,writeit,debugout,dealloc,tdesc->u.lptdesc,(DWORD*)*arg,buf); hres = serialize_param(tinfo,writeit,debugout,dealloc,tdesc->u.lptdesc,(DWORD*)*arg,buf);
@ -494,17 +534,17 @@ serialize_param(
return hres; return hres;
} }
case VT_UNKNOWN: case VT_UNKNOWN:
if (debugout) MESSAGE("unk(0x%lx)",*arg); if (debugout) TRACE_(olerelay)("unk(0x%lx)",*arg);
if (writeit) if (writeit)
hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg); hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg);
return hres; return hres;
case VT_DISPATCH: case VT_DISPATCH:
if (debugout) MESSAGE("idisp(0x%lx)",*arg); if (debugout) TRACE_(olerelay)("idisp(0x%lx)",*arg);
if (writeit) if (writeit)
hres = _marshal_interface(buf,&IID_IDispatch,(LPUNKNOWN)*arg); hres = _marshal_interface(buf,&IID_IDispatch,(LPUNKNOWN)*arg);
return hres; return hres;
case VT_VOID: case VT_VOID:
if (debugout) MESSAGE("<void>"); if (debugout) TRACE_(olerelay)("<void>");
return S_OK; return S_OK;
case VT_USERDEFINED: { case VT_USERDEFINED: {
ITypeInfo *tinfo2; ITypeInfo *tinfo2;
@ -524,7 +564,7 @@ serialize_param(
break; break;
case TKIND_RECORD: { case TKIND_RECORD: {
int i; int i;
if (debugout) MESSAGE("{"); if (debugout) TRACE_(olerelay)("{");
for (i=0;i<tattr->cVars;i++) { for (i=0;i<tattr->cVars;i++) {
VARDESC *vdesc; VARDESC *vdesc;
ELEMDESC *elem2; ELEMDESC *elem2;
@ -543,7 +583,7 @@ serialize_param(
ERR("Need more names!\n"); ERR("Need more names!\n");
} }
if (!hres && debugout) if (!hres && debugout)
MESSAGE("%s=",debugstr_w(names[0])); TRACE_(olerelay)("%s=",relaystr(names[0]));
*/ */
elem2 = &vdesc->elemdescVar; elem2 = &vdesc->elemdescVar;
tdesc2 = &elem2->tdesc; tdesc2 = &elem2->tdesc;
@ -559,11 +599,11 @@ serialize_param(
if (hres!=S_OK) if (hres!=S_OK)
return hres; return hres;
if (debugout && (i<(tattr->cVars-1))) if (debugout && (i<(tattr->cVars-1)))
MESSAGE(","); TRACE_(olerelay)(",");
} }
if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID))) if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID)))
memcpy(&(buf->iid),arg,sizeof(buf->iid)); memcpy(&(buf->iid),arg,sizeof(buf->iid));
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
break; break;
} }
default: default:
@ -578,19 +618,19 @@ serialize_param(
ARRAYDESC *adesc = tdesc->u.lpadesc; ARRAYDESC *adesc = tdesc->u.lpadesc;
int i, arrsize = 1; int i, arrsize = 1;
if (debugout) MESSAGE("carr"); if (debugout) TRACE_(olerelay)("carr");
for (i=0;i<adesc->cDims;i++) { for (i=0;i<adesc->cDims;i++) {
if (debugout) MESSAGE("[%ld]",adesc->rgbounds[i].cElements); if (debugout) TRACE_(olerelay)("[%ld]",adesc->rgbounds[i].cElements);
arrsize *= adesc->rgbounds[i].cElements; arrsize *= adesc->rgbounds[i].cElements;
} }
if (debugout) MESSAGE("["); if (debugout) TRACE_(olerelay)("[");
for (i=0;i<arrsize;i++) { for (i=0;i<arrsize;i++) {
hres = serialize_param(tinfo, writeit, debugout, dealloc, &adesc->tdescElem, (DWORD*)((LPBYTE)arg+i*_xsize(&adesc->tdescElem)), buf); hres = serialize_param(tinfo, writeit, debugout, dealloc, &adesc->tdescElem, (DWORD*)((LPBYTE)arg+i*_xsize(&adesc->tdescElem)), buf);
if (hres) if (hres)
return hres; return hres;
if (debugout && (i<arrsize-1)) MESSAGE(","); if (debugout && (i<arrsize-1)) TRACE_(olerelay)(",");
} }
if (debugout) MESSAGE("]"); if (debugout) TRACE_(olerelay)("]");
return S_OK; return S_OK;
} }
default: default:
@ -607,8 +647,8 @@ serialize_LPVOID_ptr(
BOOL dealloc, BOOL dealloc,
TYPEDESC *tdesc, TYPEDESC *tdesc,
DWORD *arg, DWORD *arg,
marshal_state *buf marshal_state *buf)
) { {
HRESULT hres; HRESULT hres;
DWORD cookie; DWORD cookie;
@ -626,11 +666,11 @@ serialize_LPVOID_ptr(
return hres; return hres;
} }
if (!*arg) { if (!*arg) {
if (debugout) MESSAGE("<lpvoid NULL>"); if (debugout) TRACE_(olerelay)("<lpvoid NULL>");
return S_OK; return S_OK;
} }
if (debugout) if (debugout)
MESSAGE("ppv(%p)",*(LPUNKNOWN*)*arg); TRACE_(olerelay)("ppv(%p)",*(LPUNKNOWN*)*arg);
if (writeit) { if (writeit) {
hres = _marshal_interface(buf,&(buf->iid),*(LPUNKNOWN*)*arg); hres = _marshal_interface(buf,&(buf->iid),*(LPUNKNOWN*)*arg);
if (hres) if (hres)
@ -649,8 +689,8 @@ serialize_DISPPARAM_ptr(
BOOL dealloc, BOOL dealloc,
TYPEDESC *tdesc, TYPEDESC *tdesc,
DWORD *arg, DWORD *arg,
marshal_state *buf marshal_state *buf)
) { {
DWORD cookie; DWORD cookie;
HRESULT hres; HRESULT hres;
DISPPARAMS *disp; DISPPARAMS *disp;
@ -668,7 +708,7 @@ serialize_DISPPARAM_ptr(
return hres; return hres;
} }
if (!*arg) { if (!*arg) {
if (debugout) MESSAGE("<DISPPARAMS NULL>"); if (debugout) TRACE_(olerelay)("<DISPPARAMS NULL>");
return S_OK; return S_OK;
} }
disp = (DISPPARAMS*)*arg; disp = (DISPPARAMS*)*arg;
@ -677,7 +717,7 @@ serialize_DISPPARAM_ptr(
if (hres) if (hres)
return hres; return hres;
} }
if (debugout) MESSAGE("D{"); if (debugout) TRACE_(olerelay)("D{");
for (i=0;i<disp->cArgs;i++) { for (i=0;i<disp->cArgs;i++) {
TYPEDESC vtdesc; TYPEDESC vtdesc;
@ -692,7 +732,7 @@ serialize_DISPPARAM_ptr(
buf buf
); );
if (debugout && (i<disp->cArgs-1)) if (debugout && (i<disp->cArgs-1))
MESSAGE(","); TRACE_(olerelay)(",");
} }
if (dealloc) if (dealloc)
HeapFree(GetProcessHeap(),0,disp->rgvarg); HeapFree(GetProcessHeap(),0,disp->rgvarg);
@ -701,7 +741,7 @@ serialize_DISPPARAM_ptr(
if (hres) if (hres)
return hres; return hres;
} }
if (debugout) MESSAGE("}{"); if (debugout) TRACE_(olerelay)("}{");
for (i=0;i<disp->cNamedArgs;i++) { for (i=0;i<disp->cNamedArgs;i++) {
TYPEDESC vtdesc; TYPEDESC vtdesc;
@ -716,9 +756,9 @@ serialize_DISPPARAM_ptr(
buf buf
); );
if (debugout && (i<disp->cNamedArgs-1)) if (debugout && (i<disp->cNamedArgs-1))
MESSAGE(","); TRACE_(olerelay)(",");
} }
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
if (dealloc) { if (dealloc) {
HeapFree(GetProcessHeap(),0,disp->rgdispidNamedArgs); HeapFree(GetProcessHeap(),0,disp->rgdispidNamedArgs);
HeapFree(GetProcessHeap(),0,disp); HeapFree(GetProcessHeap(),0,disp);
@ -734,8 +774,8 @@ deserialize_param(
BOOL alloc, BOOL alloc,
TYPEDESC *tdesc, TYPEDESC *tdesc,
DWORD *arg, DWORD *arg,
marshal_state *buf marshal_state *buf)
) { {
HRESULT hres = S_OK; HRESULT hres = S_OK;
TRACE("vt %d at %p\n",tdesc->vt,arg); TRACE("vt %d at %p\n",tdesc->vt,arg);
@ -743,10 +783,10 @@ deserialize_param(
while (1) { while (1) {
switch (tdesc->vt) { switch (tdesc->vt) {
case VT_EMPTY: case VT_EMPTY:
if (debugout) MESSAGE("<empty>"); if (debugout) TRACE_(olerelay)("<empty>");
return S_OK; return S_OK;
case VT_NULL: case VT_NULL:
if (debugout) MESSAGE("<null>"); if (debugout) TRACE_(olerelay)("<null>");
return S_OK; return S_OK;
case VT_VARIANT: { case VT_VARIANT: {
VARIANT *vt = (VARIANT*)arg; VARIANT *vt = (VARIANT*)arg;
@ -762,9 +802,9 @@ deserialize_param(
memset(&tdesc2,0,sizeof(tdesc2)); memset(&tdesc2,0,sizeof(tdesc2));
tdesc2.vt = vttype; tdesc2.vt = vttype;
V_VT(vt) = vttype; V_VT(vt) = vttype;
if (debugout) MESSAGE("Vt(%ld)(",vttype); if (debugout) TRACE_(olerelay)("Vt(%ld)(",vttype);
hres = deserialize_param(tinfo, readit, debugout, alloc, &tdesc2, &(V_I4(vt)), buf); hres = deserialize_param(tinfo, readit, debugout, alloc, &tdesc2, &(V_I4(vt)), buf);
MESSAGE(")"); TRACE_(olerelay)(")");
return hres; return hres;
} else { } else {
VariantInit(vt); VariantInit(vt);
@ -779,7 +819,7 @@ deserialize_param(
hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD)); hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
if (hres) FIXME("Failed to read integer 4 byte\n"); if (hres) FIXME("Failed to read integer 4 byte\n");
} }
if (debugout) MESSAGE("%lx",*arg); if (debugout) TRACE_(olerelay)("%lx",*arg);
return hres; return hres;
case VT_BSTR: { case VT_BSTR: {
WCHAR *str; WCHAR *str;
@ -793,7 +833,7 @@ deserialize_param(
} }
if (len == -1) { if (len == -1) {
*arg = 0; *arg = 0;
if (debugout) MESSAGE("<bstr NULL>"); if (debugout) TRACE_(olerelay)("<bstr NULL>");
} else { } else {
str = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,len+sizeof(WCHAR)); str = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,len+sizeof(WCHAR));
hres = xbuf_get(buf,(LPBYTE)str,len); hres = xbuf_get(buf,(LPBYTE)str,len);
@ -802,7 +842,7 @@ deserialize_param(
return hres; return hres;
} }
*arg = (DWORD)SysAllocStringLen(str,len); *arg = (DWORD)SysAllocStringLen(str,len);
if (debugout) MESSAGE("%s",debugstr_w(str)); if (debugout) TRACE_(olerelay)("%s",relaystr(str));
HeapFree(GetProcessHeap(),0,str); HeapFree(GetProcessHeap(),0,str);
} }
} else { } else {
@ -823,11 +863,11 @@ deserialize_param(
return hres; return hres;
} }
if (cookie != 0x42424242) { if (cookie != 0x42424242) {
if (debugout) MESSAGE("NULL"); if (debugout) TRACE_(olerelay)("NULL");
*arg = 0; *arg = 0;
return S_OK; return S_OK;
} }
if (debugout) MESSAGE("*"); if (debugout) TRACE_(olerelay)("*");
} }
if (alloc) { if (alloc) {
if (derefhere) if (derefhere)
@ -846,17 +886,17 @@ deserialize_param(
if (readit) if (readit)
hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg); hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg);
if (debugout) if (debugout)
MESSAGE("unk(%p)",arg); TRACE_(olerelay)("unk(%p)",arg);
return hres; return hres;
case VT_DISPATCH: case VT_DISPATCH:
hres = S_OK; hres = S_OK;
if (readit) if (readit)
hres = _unmarshal_interface(buf,&IID_IDispatch,(LPUNKNOWN*)arg); hres = _unmarshal_interface(buf,&IID_IDispatch,(LPUNKNOWN*)arg);
if (debugout) if (debugout)
MESSAGE("idisp(%p)",arg); TRACE_(olerelay)("idisp(%p)",arg);
return hres; return hres;
case VT_VOID: case VT_VOID:
if (debugout) MESSAGE("<void>"); if (debugout) TRACE_(olerelay)("<void>");
return S_OK; return S_OK;
case VT_USERDEFINED: { case VT_USERDEFINED: {
ITypeInfo *tinfo2; ITypeInfo *tinfo2;
@ -882,7 +922,7 @@ deserialize_param(
case TKIND_RECORD: { case TKIND_RECORD: {
int i; int i;
if (debugout) MESSAGE("{"); if (debugout) TRACE_(olerelay)("{");
for (i=0;i<tattr->cVars;i++) { for (i=0;i<tattr->cVars;i++) {
VARDESC *vdesc; VARDESC *vdesc;
@ -900,11 +940,11 @@ deserialize_param(
(DWORD*)(((LPBYTE)*arg)+vdesc->u.oInst), (DWORD*)(((LPBYTE)*arg)+vdesc->u.oInst),
buf buf
); );
if (debugout && (i<tattr->cVars-1)) MESSAGE(","); if (debugout && (i<tattr->cVars-1)) TRACE_(olerelay)(",");
} }
if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID))) if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID)))
memcpy(&(buf->iid),(LPBYTE)*arg,sizeof(buf->iid)); memcpy(&(buf->iid),(LPBYTE)*arg,sizeof(buf->iid));
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
break; break;
} }
default: default:
@ -973,7 +1013,7 @@ deserialize_LPVOID_ptr(
return hres; return hres;
if (cookie != 0x42424242) { if (cookie != 0x42424242) {
*(DWORD*)*arg = 0; *(DWORD*)*arg = 0;
if (debugout) MESSAGE("<lpvoid NULL>"); if (debugout) TRACE_(olerelay)("<lpvoid NULL>");
return S_OK; return S_OK;
} }
} }
@ -982,7 +1022,7 @@ deserialize_LPVOID_ptr(
if (hres) if (hres)
return hres; return hres;
} }
if (debugout) MESSAGE("ppv(%p)",(LPVOID)*arg); if (debugout) TRACE_(olerelay)("ppv(%p)",(LPVOID)*arg);
return S_OK; return S_OK;
} }
@ -994,8 +1034,8 @@ deserialize_DISPPARAM_ptr(
BOOL alloc, BOOL alloc,
TYPEDESC *tdesc, TYPEDESC *tdesc,
DWORD *arg, DWORD *arg,
marshal_state *buf marshal_state *buf)
) { {
DWORD cookie; DWORD cookie;
DISPPARAMS *disps; DISPPARAMS *disps;
HRESULT hres; HRESULT hres;
@ -1011,7 +1051,7 @@ deserialize_DISPPARAM_ptr(
return hres; return hres;
if (cookie == 0) { if (cookie == 0) {
*arg = 0; *arg = 0;
if (debugout) MESSAGE("<DISPPARAMS NULL>"); if (debugout) TRACE_(olerelay)("<DISPPARAMS NULL>");
return S_OK; return S_OK;
} }
} }
@ -1025,7 +1065,7 @@ deserialize_DISPPARAM_ptr(
return hres; return hres;
if (alloc) if (alloc)
disps->rgvarg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(VARIANT)*disps->cArgs); disps->rgvarg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(VARIANT)*disps->cArgs);
if (debugout) MESSAGE("D{"); if (debugout) TRACE_(olerelay)("D{");
for (i=0; i< disps->cArgs; i++) { for (i=0; i< disps->cArgs; i++) {
TYPEDESC vdesc; TYPEDESC vdesc;
@ -1040,7 +1080,7 @@ deserialize_DISPPARAM_ptr(
buf buf
); );
} }
if (debugout) MESSAGE("}{"); if (debugout) TRACE_(olerelay)("}{");
hres = xbuf_get(buf, (LPBYTE)&disps->cNamedArgs, sizeof(disps->cNamedArgs)); hres = xbuf_get(buf, (LPBYTE)&disps->cNamedArgs, sizeof(disps->cNamedArgs));
if (hres) if (hres)
return hres; return hres;
@ -1060,18 +1100,18 @@ deserialize_DISPPARAM_ptr(
(DWORD*)(disps->rgdispidNamedArgs+i), (DWORD*)(disps->rgdispidNamedArgs+i),
buf buf
); );
if (debugout && i<(disps->cNamedArgs-1)) MESSAGE(","); if (debugout && i<(disps->cNamedArgs-1)) TRACE_(olerelay)(",");
} }
} }
if (debugout) MESSAGE("}"); if (debugout) TRACE_(olerelay)("}");
return S_OK; return S_OK;
} }
/* Searches function, also in inherited interfaces */ /* Searches function, also in inherited interfaces */
static HRESULT static HRESULT
_get_funcdesc( _get_funcdesc(
ITypeInfo *tinfo, int iMethod, FUNCDESC **fdesc, BSTR *iname, BSTR *fname ITypeInfo *tinfo, int iMethod, FUNCDESC **fdesc, BSTR *iname, BSTR *fname)
) { {
int i = 0, j = 0; int i = 0, j = 0;
HRESULT hres; HRESULT hres;
@ -1121,7 +1161,8 @@ _get_funcdesc(
} }
static DWORD 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; FUNCDESC *fdesc;
HRESULT hres; HRESULT hres;
@ -1133,22 +1174,24 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
BSTR names[10]; BSTR names[10];
int nrofnames; int nrofnames;
EnterCriticalSection(&tpinfo->crit);
hres = _get_funcdesc(tpinfo->tinfo,method,&fdesc,&iname,&fname); hres = _get_funcdesc(tpinfo->tinfo,method,&fdesc,&iname,&fname);
if (hres) { if (hres) {
ERR("Did not find typeinfo/funcdesc entry for method %d!\n",method); ERR("Did not find typeinfo/funcdesc entry for method %d!\n",method);
return 0; LeaveCriticalSection(&tpinfo->crit);
return E_FAIL;
} }
/*dump_FUNCDESC(fdesc);*/
if (relaydeb) { if (relaydeb) {
TRACE_(olerelay)("->"); TRACE_(olerelay)("->");
if (iname) if (iname)
MESSAGE("%s:",debugstr_w(iname)); TRACE_(olerelay)("%s:",relaystr(iname));
if (fname) if (fname)
MESSAGE("%s(%d)",debugstr_w(fname),method); TRACE_(olerelay)("%s(%d)",relaystr(fname),method);
else else
MESSAGE("%d",method); TRACE_(olerelay)("%d",method);
MESSAGE("("); TRACE_(olerelay)("(");
if (iname) SysFreeString(iname); if (iname) SysFreeString(iname);
if (fname) SysFreeString(fname); if (fname) SysFreeString(fname);
} }
@ -1163,21 +1206,21 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
buf.iid = IID_IUnknown; buf.iid = IID_IUnknown;
if (method == 0) { if (method == 0) {
xbuf_add(&buf,(LPBYTE)args[0],sizeof(IID)); xbuf_add(&buf,(LPBYTE)args[0],sizeof(IID));
if (relaydeb) MESSAGE("riid=%s,[out]",debugstr_guid((REFIID)args[0])); if (relaydeb) TRACE_(olerelay)("riid=%s,[out]",debugstr_guid((REFIID)args[0]));
} else { } else {
xargs = args; xargs = args;
for (i=0;i<fdesc->cParams;i++) { for (i=0;i<fdesc->cParams;i++) {
ELEMDESC *elem = fdesc->lprgelemdescParam+i; ELEMDESC *elem = fdesc->lprgelemdescParam+i;
BOOL isserialized = FALSE; BOOL isserialized = FALSE;
if (relaydeb) { if (relaydeb) {
if (i) MESSAGE(","); if (i) TRACE_(olerelay)(",");
if (i+1<nrofnames && names[i+1]) if (i+1<nrofnames && names[i+1])
MESSAGE("%s=",debugstr_w(names[i+1])); TRACE_(olerelay)("%s=",relaystr(names[i+1]));
} }
/* No need to marshal other data than FIN */ /* No need to marshal other data than FIN */
if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN)) { if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN)) {
xargs+=_argsize(elem->tdesc.vt); xargs+=_argsize(elem->tdesc.vt);
if (relaydeb) MESSAGE("[out]"); if (relaydeb) TRACE_(olerelay)("[out]");
continue; continue;
} }
if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) { if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) {
@ -1231,24 +1274,26 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
xargs+=_argsize(elem->tdesc.vt); xargs+=_argsize(elem->tdesc.vt);
} }
} }
if (relaydeb) MESSAGE(")"); if (relaydeb) TRACE_(olerelay)(")");
memset(&msg,0,sizeof(msg)); memset(&msg,0,sizeof(msg));
msg.cbBuffer = buf.curoff; msg.cbBuffer = buf.curoff;
msg.iMethod = method; msg.iMethod = method;
hres = IRpcChannelBuffer_GetBuffer(tpinfo->chanbuf,&msg,&(tpinfo->iid)); hres = IRpcChannelBuffer_GetBuffer(tpinfo->chanbuf,&msg,&(tpinfo->iid));
if (hres) { if (hres) {
FIXME("RpcChannelBuffer GetBuffer failed, %lx\n",hres); FIXME("RpcChannelBuffer GetBuffer failed, %lx\n",hres);
LeaveCriticalSection(&tpinfo->crit);
return hres; return hres;
} }
memcpy(msg.Buffer,buf.base,buf.curoff); memcpy(msg.Buffer,buf.base,buf.curoff);
if (relaydeb) MESSAGE("\n"); if (relaydeb) TRACE_(olerelay)("\n");
hres = IRpcChannelBuffer_SendReceive(tpinfo->chanbuf,&msg,&status); hres = IRpcChannelBuffer_SendReceive(tpinfo->chanbuf,&msg,&status);
if (hres) { if (hres) {
FIXME("RpcChannelBuffer SendReceive failed, %lx\n",hres); FIXME("RpcChannelBuffer SendReceive failed, %lx\n",hres);
LeaveCriticalSection(&tpinfo->crit);
return hres; return hres;
} }
relaydeb = TRACE_ON(olerelay);
if (relaydeb) MESSAGE(" = %08lx (",status); if (relaydeb) TRACE_(olerelay)(" = %08lx (",status);
if (buf.base) if (buf.base)
buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer); buf.base = HeapReAlloc(GetProcessHeap(),0,buf.base,msg.cbBuffer);
else else
@ -1258,7 +1303,7 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
buf.curoff = 0; buf.curoff = 0;
if (method == 0) { if (method == 0) {
_unmarshal_interface(&buf,(REFIID)args[0],(LPUNKNOWN*)args[1]); _unmarshal_interface(&buf,(REFIID)args[0],(LPUNKNOWN*)args[1]);
if (relaydeb) MESSAGE("[in],%p",*((DWORD**)args[1])); if (relaydeb) TRACE_(olerelay)("[in],%p",*((DWORD**)args[1]));
} else { } else {
xargs = args; xargs = args;
for (i=0;i<fdesc->cParams;i++) { for (i=0;i<fdesc->cParams;i++) {
@ -1266,13 +1311,13 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
BOOL isdeserialized = FALSE; BOOL isdeserialized = FALSE;
if (relaydeb) { if (relaydeb) {
if (i) MESSAGE(","); if (i) TRACE_(olerelay)(",");
if (i+1<nrofnames && names[i+1]) MESSAGE("%s=",debugstr_w(names[i+1])); if (i+1<nrofnames && names[i+1]) TRACE_(olerelay)("%s=",relaystr(names[i+1]));
} }
/* No need to marshal other data than FOUT I think */ /* No need to marshal other data than FOUT I think */
if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT)) { if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FOUT)) {
xargs += _argsize(elem->tdesc.vt); xargs += _argsize(elem->tdesc.vt);
if (relaydeb) MESSAGE("[in]"); if (relaydeb) TRACE_(olerelay)("[in]");
continue; continue;
} }
if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) { if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) {
@ -1329,16 +1374,19 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) {
xargs += _argsize(elem->tdesc.vt); xargs += _argsize(elem->tdesc.vt);
} }
} }
if (relaydeb) MESSAGE(")\n\n"); if (relaydeb) TRACE_(olerelay)(")\n");
HeapFree(GetProcessHeap(),0,buf.base); HeapFree(GetProcessHeap(),0,buf.base);
LeaveCriticalSection(&tpinfo->crit);
return status; return status;
} }
static HRESULT WINAPI static HRESULT WINAPI
PSFacBuf_CreateProxy( PSFacBuf_CreateProxy(
LPPSFACTORYBUFFER iface, IUnknown* pUnkOuter, REFIID riid, LPPSFACTORYBUFFER iface, IUnknown* pUnkOuter, REFIID riid,
IRpcProxyBuffer **ppProxy, LPVOID *ppv IRpcProxyBuffer **ppProxy, LPVOID *ppv)
) { {
HRESULT hres; HRESULT hres;
ITypeInfo *tinfo; ITypeInfo *tinfo;
int i, nroffuncs; int i, nroffuncs;
@ -1352,12 +1400,20 @@ PSFacBuf_CreateProxy(
return hres; return hres;
} }
nroffuncs = _nroffuncs(tinfo); nroffuncs = _nroffuncs(tinfo);
proxy = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(TMProxyImpl)); proxy = CoTaskMemAlloc(sizeof(TMProxyImpl));
if (!proxy) return E_OUTOFMEMORY; if (!proxy) return E_OUTOFMEMORY;
proxy->asmstubs=HeapAlloc(GetProcessHeap(),0,sizeof(TMAsmProxy)*nroffuncs);
assert(sizeof(TMAsmProxy) == 12); assert(sizeof(TMAsmProxy) == 12);
proxy->asmstubs = VirtualAlloc(NULL, sizeof(TMAsmProxy) * nroffuncs, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
if (!proxy->asmstubs) {
ERR("Could not commit pages for proxy thunks\n");
CoTaskMemFree(proxy);
return E_OUTOFMEMORY;
}
InitializeCriticalSection(&proxy->crit);
proxy->lpvtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPBYTE)*nroffuncs); proxy->lpvtbl = HeapAlloc(GetProcessHeap(),0,sizeof(LPBYTE)*nroffuncs);
for (i=0;i<nroffuncs;i++) { for (i=0;i<nroffuncs;i++) {
int nrofargs; int nrofargs;
@ -1406,9 +1462,10 @@ PSFacBuf_CreateProxy(
xasm->xcall -= (DWORD)&(xasm->lret); xasm->xcall -= (DWORD)&(xasm->lret);
xasm->lret = 0xc2; xasm->lret = 0xc2;
xasm->bytestopop= (nrofargs+2)*4; /* pop args, This, iMethod */ xasm->bytestopop= (nrofargs+2)*4; /* pop args, This, iMethod */
proxy->lpvtbl[i] = (DWORD)xasm; proxy->lpvtbl[i] = xasm;
} }
proxy->lpvtbl2 = &tmproxyvtable; proxy->lpvtbl2 = &tmproxyvtable;
/* 1 reference for the proxy and 1 for the object */
proxy->ref = 2; proxy->ref = 2;
proxy->tinfo = tinfo; proxy->tinfo = tinfo;
memcpy(&proxy->iid,riid,sizeof(*riid)); memcpy(&proxy->iid,riid,sizeof(*riid));
@ -1418,8 +1475,8 @@ PSFacBuf_CreateProxy(
} }
typedef struct _TMStubImpl { typedef struct _TMStubImpl {
ICOM_VTABLE(IRpcStubBuffer) *lpvtbl; IRpcStubBufferVtbl *lpvtbl;
DWORD ref; ULONG ref;
LPUNKNOWN pUnk; LPUNKNOWN pUnk;
ITypeInfo *tinfo; ITypeInfo *tinfo;
@ -1427,7 +1484,8 @@ typedef struct _TMStubImpl {
} TMStubImpl; } TMStubImpl;
static HRESULT WINAPI static HRESULT WINAPI
TMStubImpl_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *ppv) { TMStubImpl_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *ppv)
{
if (IsEqualIID(riid,&IID_IRpcStubBuffer)||IsEqualIID(riid,&IID_IUnknown)){ if (IsEqualIID(riid,&IID_IRpcStubBuffer)||IsEqualIID(riid,&IID_IUnknown)){
*ppv = (LPVOID)iface; *ppv = (LPVOID)iface;
IRpcStubBuffer_AddRef(iface); IRpcStubBuffer_AddRef(iface);
@ -1438,27 +1496,38 @@ TMStubImpl_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *ppv) {
} }
static ULONG WINAPI static ULONG WINAPI
TMStubImpl_AddRef(LPRPCSTUBBUFFER iface) { TMStubImpl_AddRef(LPRPCSTUBBUFFER iface)
ICOM_THIS(TMStubImpl,iface); {
TMStubImpl *This = (TMStubImpl *)iface;
TRACE("(%p) before %lu\n", This, This->ref);
This->ref++; return InterlockedIncrement(&This->ref);
return This->ref;
} }
static ULONG WINAPI static ULONG WINAPI
TMStubImpl_Release(LPRPCSTUBBUFFER iface) { TMStubImpl_Release(LPRPCSTUBBUFFER iface)
ICOM_THIS(TMStubImpl,iface); {
ULONG refs;
TMStubImpl *This = (TMStubImpl *)iface;
This->ref--; TRACE("(%p) after %lu\n", This, This->ref-1);
if (This->ref)
return This->ref; refs = InterlockedDecrement(&This->ref);
HeapFree(GetProcessHeap(),0,This); if (!refs)
return 0; {
IRpcStubBuffer_Disconnect(iface);
CoTaskMemFree(This);
}
return refs;
} }
static HRESULT WINAPI static HRESULT WINAPI
TMStubImpl_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN pUnkServer) { TMStubImpl_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN pUnkServer)
ICOM_THIS(TMStubImpl,iface); {
TMStubImpl *This = (TMStubImpl *)iface;
TRACE("(%p)->(%p)\n", This, pUnkServer);
IUnknown_AddRef(pUnkServer); IUnknown_AddRef(pUnkServer);
This->pUnk = pUnkServer; This->pUnk = pUnkServer;
@ -1466,8 +1535,11 @@ TMStubImpl_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN pUnkServer) {
} }
static void WINAPI static void WINAPI
TMStubImpl_Disconnect(LPRPCSTUBBUFFER iface) { TMStubImpl_Disconnect(LPRPCSTUBBUFFER iface)
ICOM_THIS(TMStubImpl,iface); {
TMStubImpl *This = (TMStubImpl *)iface;
TRACE("(%p)->()\n", This);
IUnknown_Release(This->pUnk); IUnknown_Release(This->pUnk);
This->pUnk = NULL; This->pUnk = NULL;
@ -1476,11 +1548,11 @@ TMStubImpl_Disconnect(LPRPCSTUBBUFFER iface) {
static HRESULT WINAPI static HRESULT WINAPI
TMStubImpl_Invoke( TMStubImpl_Invoke(
LPRPCSTUBBUFFER iface, RPCOLEMESSAGE* xmsg,IRpcChannelBuffer*rpcchanbuf LPRPCSTUBBUFFER iface, RPCOLEMESSAGE* xmsg,IRpcChannelBuffer*rpcchanbuf)
) { {
int i; int i;
FUNCDESC *fdesc; FUNCDESC *fdesc;
ICOM_THIS(TMStubImpl,iface); TMStubImpl *This = (TMStubImpl *)iface;
HRESULT hres; HRESULT hres;
DWORD *args, res, *xargs, nrofargs; DWORD *args, res, *xargs, nrofargs;
marshal_state buf; marshal_state buf;
@ -1579,7 +1651,7 @@ TMStubImpl_Invoke(
); );
xargs += _argsize(elem->tdesc.vt); xargs += _argsize(elem->tdesc.vt);
if (hres) { if (hres) {
FIXME("Failed to deserialize param %s, hres %lx\n",debugstr_w(names[i+1]),hres); FIXME("Failed to deserialize param %s, hres %lx\n",relaystr(names[i+1]),hres);
break; break;
} }
} }
@ -1665,7 +1737,7 @@ TMStubImpl_IsIIDSupported(LPRPCSTUBBUFFER iface, REFIID riid) {
static ULONG WINAPI static ULONG WINAPI
TMStubImpl_CountRefs(LPRPCSTUBBUFFER iface) { TMStubImpl_CountRefs(LPRPCSTUBBUFFER iface) {
ICOM_THIS(TMStubImpl,iface); TMStubImpl *This = (TMStubImpl *)iface;
return This->ref; /*FIXME? */ return This->ref; /*FIXME? */
} }
@ -1680,8 +1752,7 @@ TMStubImpl_DebugServerRelease(LPRPCSTUBBUFFER iface, LPVOID ppv) {
return; return;
} }
ICOM_VTABLE(IRpcStubBuffer) tmstubvtbl = { IRpcStubBufferVtbl tmstubvtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
TMStubImpl_QueryInterface, TMStubImpl_QueryInterface,
TMStubImpl_AddRef, TMStubImpl_AddRef,
TMStubImpl_Release, TMStubImpl_Release,
@ -1709,7 +1780,7 @@ PSFacBuf_CreateStub(
FIXME("No typeinfo for %s?\n",debugstr_guid(riid)); FIXME("No typeinfo for %s?\n",debugstr_guid(riid));
return hres; return hres;
} }
stub = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(TMStubImpl)); stub = CoTaskMemAlloc(sizeof(TMStubImpl));
if (!stub) if (!stub)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
stub->lpvtbl = &tmstubvtbl; stub->lpvtbl = &tmstubvtbl;
@ -1718,13 +1789,13 @@ PSFacBuf_CreateStub(
memcpy(&(stub->iid),riid,sizeof(*riid)); memcpy(&(stub->iid),riid,sizeof(*riid));
hres = IRpcStubBuffer_Connect((LPRPCSTUBBUFFER)stub,pUnkServer); hres = IRpcStubBuffer_Connect((LPRPCSTUBBUFFER)stub,pUnkServer);
*ppStub = (LPRPCSTUBBUFFER)stub; *ppStub = (LPRPCSTUBBUFFER)stub;
TRACE("IRpcStubBuffer: %p\n", stub);
if (hres) if (hres)
FIXME("Connect to pUnkServer failed?\n"); FIXME("Connect to pUnkServer failed?\n");
return hres; return hres;
} }
static ICOM_VTABLE(IPSFactoryBuffer) psfacbufvtbl = { static IPSFactoryBufferVtbl psfacbufvtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
PSFacBuf_QueryInterface, PSFacBuf_QueryInterface,
PSFacBuf_AddRef, PSFacBuf_AddRef,
PSFacBuf_Release, PSFacBuf_Release,
@ -1733,7 +1804,7 @@ static ICOM_VTABLE(IPSFactoryBuffer) psfacbufvtbl = {
}; };
/* This is the whole PSFactoryBuffer object, just the vtableptr */ /* This is the whole PSFactoryBuffer object, just the vtableptr */
static ICOM_VTABLE(IPSFactoryBuffer) *lppsfac = &psfacbufvtbl; static IPSFactoryBufferVtbl *lppsfac = &psfacbufvtbl;
/*********************************************************************** /***********************************************************************
* DllGetClassObject [OLE32.63] * DllGetClassObject [OLE32.63]

View file

@ -308,7 +308,7 @@ HRESULT WINAPI LoadTypeLibEx(
return TYPE_E_CANTLOADLIBRARY; return TYPE_E_CANTLOADLIBRARY;
} else { } else {
WCHAR tstpath[260]; WCHAR tstpath[260];
WCHAR stdole32tlb[] = { 's','t','d','o','l','e','3','2','.','t','l','b',0 }; static const WCHAR stdole32tlb[] = { 's','t','d','o','l','e','3','2','.','t','l','b',0 };
int i; int i;
lstrcpyW(tstpath,szFile); lstrcpyW(tstpath,szFile);
@ -321,7 +321,6 @@ HRESULT WINAPI LoadTypeLibEx(
MESSAGE("You must copy a 'stdole32.tlb' file to your Windows\\System directory!\n"); MESSAGE("You must copy a 'stdole32.tlb' file to your Windows\\System directory!\n");
MESSAGE("You can get one from a Windows installation, or look for the DCOM95 package\n"); MESSAGE("You can get one from a Windows installation, or look for the DCOM95 package\n");
MESSAGE("on the Microsoft Download Pages.\n"); MESSAGE("on the Microsoft Download Pages.\n");
MESSAGE("A free download link is on http://sourceforge.net/projects/wine/, look for dcom95.exe.\n");
MESSAGE("**************************************************************************\n"); MESSAGE("**************************************************************************\n");
break; break;
} }
@ -854,8 +853,8 @@ typedef struct tagTLBImpLib
/* internal ITypeLib data */ /* internal ITypeLib data */
typedef struct tagITypeLibImpl typedef struct tagITypeLibImpl
{ {
ICOM_VFIELD(ITypeLib2); ITypeLib2Vtbl *lpVtbl;
ICOM_VTABLE(ITypeComp) * lpVtblTypeComp; ITypeCompVtbl *lpVtblTypeComp;
UINT ref; UINT ref;
TLIBATTR LibAttr; /* guid,lcid,syskind,version,flags */ TLIBATTR LibAttr; /* guid,lcid,syskind,version,flags */
@ -881,8 +880,8 @@ typedef struct tagITypeLibImpl
WCHAR *path; WCHAR *path;
} ITypeLibImpl; } ITypeLibImpl;
static struct ICOM_VTABLE(ITypeLib2) tlbvt; static struct ITypeLib2Vtbl tlbvt;
static struct ICOM_VTABLE(ITypeComp) tlbtcvt; static struct ITypeCompVtbl tlbtcvt;
#define _ITypeComp_Offset(impl) ((int)(&(((impl*)0)->lpVtblTypeComp))) #define _ITypeComp_Offset(impl) ((int)(&(((impl*)0)->lpVtblTypeComp)))
#define ICOM_THIS_From_ITypeComp(impl, iface) impl* This = (impl*)(((char*)iface)-_ITypeComp_Offset(impl)) #define ICOM_THIS_From_ITypeComp(impl, iface) impl* This = (impl*)(((char*)iface)-_ITypeComp_Offset(impl))
@ -965,8 +964,8 @@ typedef struct tagTLBImplType
/* internal TypeInfo data */ /* internal TypeInfo data */
typedef struct tagITypeInfoImpl typedef struct tagITypeInfoImpl
{ {
ICOM_VFIELD(ITypeInfo2); ITypeInfo2Vtbl *lpVtbl;
ICOM_VTABLE(ITypeComp) * lpVtblTypeComp; ITypeCompVtbl *lpVtblTypeComp;
UINT ref; UINT ref;
TYPEATTR TypeAttr ; /* _lots_ of type information. */ TYPEATTR TypeAttr ; /* _lots_ of type information. */
ITypeLibImpl * pTypeLib; /* back pointer to typelib */ ITypeLibImpl * pTypeLib; /* back pointer to typelib */
@ -994,8 +993,8 @@ typedef struct tagITypeInfoImpl
struct tagITypeInfoImpl * next; struct tagITypeInfoImpl * next;
} ITypeInfoImpl; } ITypeInfoImpl;
static struct ICOM_VTABLE(ITypeInfo2) tinfvt; static struct ITypeInfo2Vtbl tinfvt;
static struct ICOM_VTABLE(ITypeComp) tcompvt; static struct ITypeCompVtbl tcompvt;
static ITypeInfo2 * WINAPI ITypeInfo_Constructor(); static ITypeInfo2 * WINAPI ITypeInfo_Constructor();
@ -1044,6 +1043,7 @@ static void dump_TypeDesc(TYPEDESC *pTD,char *szVarType) {
case VT_UINT: sprintf(szVarType, "VT_UINT"); break; case VT_UINT: sprintf(szVarType, "VT_UINT"); break;
case VT_VARIANT: sprintf(szVarType, "VT_VARIANT"); break; case VT_VARIANT: sprintf(szVarType, "VT_VARIANT"); break;
case VT_VOID: sprintf(szVarType, "VT_VOID"); break; case VT_VOID: sprintf(szVarType, "VT_VOID"); break;
case VT_HRESULT: sprintf(szVarType, "VT_HRESULT"); break;
case VT_USERDEFINED: sprintf(szVarType, "VT_USERDEFINED ref = %lx", case VT_USERDEFINED: sprintf(szVarType, "VT_USERDEFINED ref = %lx",
pTD->u.hreftype); break; pTD->u.hreftype); break;
case VT_PTR: sprintf(szVarType, "ptr to "); case VT_PTR: sprintf(szVarType, "ptr to ");
@ -1102,6 +1102,9 @@ void dump_FUNCDESC(FUNCDESC *funcdesc) {
MESSAGE(")\n\toVft: %d\n", funcdesc->oVft); MESSAGE(")\n\toVft: %d\n", funcdesc->oVft);
MESSAGE("\tcParamsOpt: %d\n", funcdesc->cParamsOpt); MESSAGE("\tcParamsOpt: %d\n", funcdesc->cParamsOpt);
MESSAGE("\twFlags: %x\n", funcdesc->wFuncFlags); MESSAGE("\twFlags: %x\n", funcdesc->wFuncFlags);
MESSAGE("\telemdescFunc (return value type):\n");
dump_ELEMDESC(&funcdesc->elemdescFunc);
} }
void dump_IDLDESC(IDLDESC *idl) { void dump_IDLDESC(IDLDESC *idl) {
@ -1512,7 +1515,7 @@ static void MSFT_ReadValue( VARIANT * pVar, int offset, TLBContext *pcx )
case VT_BSTR :{ case VT_BSTR :{
char * ptr; char * ptr;
MSFT_ReadLEDWords(&size, sizeof(INT), pcx, DO_NOT_SEEK ); MSFT_ReadLEDWords(&size, sizeof(INT), pcx, DO_NOT_SEEK );
if(size <= 0) { if(size < 0) {
FIXME("BSTR length = %d?\n", size); FIXME("BSTR length = %d?\n", size);
} else { } else {
ptr=TLB_Alloc(size);/* allocate temp buffer */ ptr=TLB_Alloc(size);/* allocate temp buffer */
@ -2457,7 +2460,6 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
{ {
*ppTI = MSFT_DoTypeInfo(&cx, i, pTypeLibImpl); *ppTI = MSFT_DoTypeInfo(&cx, i, pTypeLibImpl);
ITypeInfo_AddRef((ITypeInfo*) *ppTI);
ppTI = &((*ppTI)->next); ppTI = &((*ppTI)->next);
(pTypeLibImpl->TypeInfoCount)++; (pTypeLibImpl->TypeInfoCount)++;
} }
@ -3369,7 +3371,7 @@ static HRESULT WINAPI ITypeLib2_fnQueryInterface(
REFIID riid, REFIID riid,
VOID **ppvObject) VOID **ppvObject)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid)); TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
@ -3395,7 +3397,7 @@ static HRESULT WINAPI ITypeLib2_fnQueryInterface(
*/ */
static ULONG WINAPI ITypeLib2_fnAddRef( ITypeLib2 *iface) static ULONG WINAPI ITypeLib2_fnAddRef( ITypeLib2 *iface)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TRACE("(%p)->ref was %u\n",This, This->ref); TRACE("(%p)->ref was %u\n",This, This->ref);
@ -3406,7 +3408,7 @@ static ULONG WINAPI ITypeLib2_fnAddRef( ITypeLib2 *iface)
*/ */
static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
--(This->ref); --(This->ref);
@ -3464,7 +3466,7 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface)
*/ */
static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( ITypeLib2 *iface) static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( ITypeLib2 *iface)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TRACE("(%p)->count is %d\n",This, This->TypeInfoCount); TRACE("(%p)->count is %d\n",This, This->TypeInfoCount);
return This->TypeInfoCount; return This->TypeInfoCount;
} }
@ -3480,7 +3482,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
{ {
int i; int i;
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
ITypeInfoImpl *pTypeInfo = This->pTypeInfo; ITypeInfoImpl *pTypeInfo = This->pTypeInfo;
TRACE("(%p)->(index=%d) \n", This, index); TRACE("(%p)->(index=%d) \n", This, index);
@ -3515,7 +3517,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType(
UINT index, UINT index,
TYPEKIND *pTKind) TYPEKIND *pTKind)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
int i; int i;
ITypeInfoImpl *pTInfo = This->pTypeInfo; ITypeInfoImpl *pTInfo = This->pTypeInfo;
@ -3549,7 +3551,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid(
REFGUID guid, REFGUID guid,
ITypeInfo **ppTInfo) ITypeInfo **ppTInfo)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
ITypeInfoImpl *pTypeInfo = This->pTypeInfo; /* head of list */ ITypeInfoImpl *pTypeInfo = This->pTypeInfo; /* head of list */
TRACE("(%p)\n\tguid:\t%s)\n",This,debugstr_guid(guid)); TRACE("(%p)\n\tguid:\t%s)\n",This,debugstr_guid(guid));
@ -3587,7 +3589,7 @@ static HRESULT WINAPI ITypeLib2_fnGetLibAttr(
ITypeLib2 *iface, ITypeLib2 *iface,
LPTLIBATTR *ppTLibAttr) LPTLIBATTR *ppTLibAttr)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
*ppTLibAttr = HeapAlloc(GetProcessHeap(), 0, sizeof(**ppTLibAttr)); *ppTLibAttr = HeapAlloc(GetProcessHeap(), 0, sizeof(**ppTLibAttr));
memcpy(*ppTLibAttr, &This->LibAttr, sizeof(**ppTLibAttr)); memcpy(*ppTLibAttr, &This->LibAttr, sizeof(**ppTLibAttr));
@ -3604,7 +3606,7 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeComp(
ITypeLib2 *iface, ITypeLib2 *iface,
ITypeComp **ppTComp) ITypeComp **ppTComp)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TRACE("(%p)->(%p)\n",This,ppTComp); TRACE("(%p)->(%p)\n",This,ppTComp);
*ppTComp = (ITypeComp *)&This->lpVtblTypeComp; *ppTComp = (ITypeComp *)&This->lpVtblTypeComp;
@ -3630,7 +3632,7 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation(
DWORD *pdwHelpContext, DWORD *pdwHelpContext,
BSTR *pBstrHelpFile) BSTR *pBstrHelpFile)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
HRESULT result = E_INVALIDARG; HRESULT result = E_INVALIDARG;
@ -3712,7 +3714,7 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
ULONG lHashVal, ULONG lHashVal,
BOOL *pfName) BOOL *pfName)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
ITypeInfoImpl *pTInfo; ITypeInfoImpl *pTInfo;
TLBFuncDesc *pFInfo; TLBFuncDesc *pFInfo;
TLBVarDesc *pVInfo; TLBVarDesc *pVInfo;
@ -3758,7 +3760,7 @@ static HRESULT WINAPI ITypeLib2_fnFindName(
MEMBERID *rgMemId, MEMBERID *rgMemId,
UINT16 *pcFound) UINT16 *pcFound)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
ITypeInfoImpl *pTInfo; ITypeInfoImpl *pTInfo;
TLBFuncDesc *pFInfo; TLBFuncDesc *pFInfo;
TLBVarDesc *pVInfo; TLBVarDesc *pVInfo;
@ -3799,7 +3801,7 @@ static VOID WINAPI ITypeLib2_fnReleaseTLibAttr(
ITypeLib2 *iface, ITypeLib2 *iface,
TLIBATTR *pTLibAttr) TLIBATTR *pTLibAttr)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TRACE("freeing (%p)\n",This); TRACE("freeing (%p)\n",This);
HeapFree(GetProcessHeap(),0,pTLibAttr); HeapFree(GetProcessHeap(),0,pTLibAttr);
@ -3814,7 +3816,7 @@ static HRESULT WINAPI ITypeLib2_fnGetCustData(
REFGUID guid, REFGUID guid,
VARIANT *pVarVal) VARIANT *pVarVal)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TLBCustData *pCData; TLBCustData *pCData;
for(pCData=This->pCustData; pCData; pCData = pCData->next) for(pCData=This->pCustData; pCData; pCData = pCData->next)
@ -3844,7 +3846,7 @@ static HRESULT WINAPI ITypeLib2_fnGetLibStatistics(
ULONG *pcUniqueNames, ULONG *pcUniqueNames,
ULONG *pcchUniqueNames) ULONG *pcchUniqueNames)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
FIXME("(%p): stub!\n", This); FIXME("(%p): stub!\n", This);
@ -3868,7 +3870,7 @@ static HRESULT WINAPI ITypeLib2_fnGetDocumentation2(
DWORD *pdwHelpStringContext, DWORD *pdwHelpStringContext,
BSTR *pbstrHelpStringDll) BSTR *pbstrHelpStringDll)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
HRESULT result; HRESULT result;
ITypeInfo *pTInfo; ITypeInfo *pTInfo;
@ -3929,7 +3931,7 @@ static HRESULT WINAPI ITypeLib2_fnGetAllCustData(
ITypeLib2 * iface, ITypeLib2 * iface,
CUSTDATA *pCustData) CUSTDATA *pCustData)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TLBCustData *pCData; TLBCustData *pCData;
int i; int i;
TRACE("(%p) returning %d items\n", This, This->ctCustData); TRACE("(%p) returning %d items\n", This, This->ctCustData);
@ -3947,8 +3949,7 @@ static HRESULT WINAPI ITypeLib2_fnGetAllCustData(
return S_OK; return S_OK;
} }
static ICOM_VTABLE(ITypeLib2) tlbvt = { static ITypeLib2Vtbl tlbvt = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ITypeLib2_fnQueryInterface, ITypeLib2_fnQueryInterface,
ITypeLib2_fnAddRef, ITypeLib2_fnAddRef,
ITypeLib2_fnRelease, ITypeLib2_fnRelease,
@ -4015,9 +4016,8 @@ static HRESULT WINAPI ITypeLibComp_fnBindType(
return E_NOTIMPL; return E_NOTIMPL;
} }
static ICOM_VTABLE(ITypeComp) tlbtcvt = static ITypeCompVtbl tlbtcvt =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ITypeLibComp_fnQueryInterface, ITypeLibComp_fnQueryInterface,
ITypeLibComp_fnAddRef, ITypeLibComp_fnAddRef,
@ -4050,7 +4050,7 @@ static HRESULT WINAPI ITypeInfo_fnQueryInterface(
REFIID riid, REFIID riid,
VOID **ppvObject) VOID **ppvObject)
{ {
ICOM_THIS( ITypeLibImpl, iface); ITypeLibImpl *This = (ITypeLibImpl *)iface;
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid)); TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
@ -4073,9 +4073,10 @@ static HRESULT WINAPI ITypeInfo_fnQueryInterface(
*/ */
static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface) static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
++(This->ref); ++(This->ref);
ITypeLib2_AddRef((ITypeLib2*)This->pTypeLib);
TRACE("(%p)->ref is %u\n",This, This->ref); TRACE("(%p)->ref is %u\n",This, This->ref);
return This->ref; return This->ref;
@ -4083,16 +4084,19 @@ static ULONG WINAPI ITypeInfo_fnAddRef( ITypeInfo2 *iface)
/* ITypeInfo::Release /* ITypeInfo::Release
*/ */
static ULONG WINAPI ITypeInfo_fnRelease( ITypeInfo2 *iface) static ULONG WINAPI ITypeInfo_fnRelease(ITypeInfo2 *iface)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
--(This->ref); --(This->ref);
TRACE("(%p)->(%u)\n",This, This->ref); TRACE("(%p)->(%u)\n",This, This->ref);
if (!This->ref) if (This->ref) {
{ /* We don't release ITypeLib when ref=0 becouse
it means that funtion is called by ITypeLi2_Release */
ITypeLib2_Release((ITypeLib2*)This->pTypeLib);
} else {
FIXME("destroy child objects\n"); FIXME("destroy child objects\n");
TRACE("destroying ITypeInfo(%p)\n",This); TRACE("destroying ITypeInfo(%p)\n",This);
@ -4128,7 +4132,7 @@ static ULONG WINAPI ITypeInfo_fnRelease( ITypeInfo2 *iface)
static HRESULT WINAPI ITypeInfo_fnGetTypeAttr( ITypeInfo2 *iface, static HRESULT WINAPI ITypeInfo_fnGetTypeAttr( ITypeInfo2 *iface,
LPTYPEATTR *ppTypeAttr) LPTYPEATTR *ppTypeAttr)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TRACE("(%p)\n",This); TRACE("(%p)\n",This);
/* FIXME: must do a copy here */ /* FIXME: must do a copy here */
*ppTypeAttr=&This->TypeAttr; *ppTypeAttr=&This->TypeAttr;
@ -4144,7 +4148,7 @@ static HRESULT WINAPI ITypeInfo_fnGetTypeAttr( ITypeInfo2 *iface,
static HRESULT WINAPI ITypeInfo_fnGetTypeComp( ITypeInfo2 *iface, static HRESULT WINAPI ITypeInfo_fnGetTypeComp( ITypeInfo2 *iface,
ITypeComp * *ppTComp) ITypeComp * *ppTComp)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TRACE("(%p)->(%p) stub!\n", This, ppTComp); TRACE("(%p)->(%p) stub!\n", This, ppTComp);
@ -4162,7 +4166,7 @@ static HRESULT WINAPI ITypeInfo_fnGetTypeComp( ITypeInfo2 *iface,
static HRESULT WINAPI ITypeInfo_fnGetFuncDesc( ITypeInfo2 *iface, UINT index, static HRESULT WINAPI ITypeInfo_fnGetFuncDesc( ITypeInfo2 *iface, UINT index,
LPFUNCDESC *ppFuncDesc) LPFUNCDESC *ppFuncDesc)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
int i; int i;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
TRACE("(%p) index %d\n", This, index); TRACE("(%p) index %d\n", This, index);
@ -4184,7 +4188,7 @@ static HRESULT WINAPI ITypeInfo_fnGetFuncDesc( ITypeInfo2 *iface, UINT index,
static HRESULT WINAPI ITypeInfo_fnGetVarDesc( ITypeInfo2 *iface, UINT index, static HRESULT WINAPI ITypeInfo_fnGetVarDesc( ITypeInfo2 *iface, UINT index,
LPVARDESC *ppVarDesc) LPVARDESC *ppVarDesc)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
int i; int i;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
TRACE("(%p) index %d\n", This, index); TRACE("(%p) index %d\n", This, index);
@ -4207,7 +4211,7 @@ static HRESULT WINAPI ITypeInfo_fnGetVarDesc( ITypeInfo2 *iface, UINT index,
static HRESULT WINAPI ITypeInfo_fnGetNames( ITypeInfo2 *iface, MEMBERID memid, static HRESULT WINAPI ITypeInfo_fnGetNames( ITypeInfo2 *iface, MEMBERID memid,
BSTR *rgBstrNames, UINT cMaxNames, UINT *pcNames) BSTR *rgBstrNames, UINT cMaxNames, UINT *pcNames)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
int i; int i;
@ -4275,7 +4279,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType(
UINT index, UINT index,
HREFTYPE *pRefType) HREFTYPE *pRefType)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
int(i); int(i);
TLBImplType *pImpl = This->impltypelist; TLBImplType *pImpl = This->impltypelist;
@ -4327,7 +4331,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType(
static HRESULT WINAPI ITypeInfo_fnGetImplTypeFlags( ITypeInfo2 *iface, static HRESULT WINAPI ITypeInfo_fnGetImplTypeFlags( ITypeInfo2 *iface,
UINT index, INT *pImplTypeFlags) UINT index, INT *pImplTypeFlags)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
int i; int i;
TLBImplType *pImpl; TLBImplType *pImpl;
@ -4350,7 +4354,7 @@ static HRESULT WINAPI ITypeInfo_fnGetImplTypeFlags( ITypeInfo2 *iface,
static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface, static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface,
LPOLESTR *rgszNames, UINT cNames, MEMBERID *pMemId) LPOLESTR *rgszNames, UINT cNames, MEMBERID *pMemId)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
HRESULT ret=S_OK; HRESULT ret=S_OK;
@ -4468,7 +4472,7 @@ _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) {
return res; return res;
} }
extern int const _argsize(DWORD vt); extern int _argsize(DWORD vt);
/**************************************************************************** /****************************************************************************
* Helper functions for Dispcall / Invoke, which copies one variant * Helper functions for Dispcall / Invoke, which copies one variant
@ -4507,7 +4511,8 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
return S_OK; return S_OK;
} }
if (vt==VT_UNKNOWN && V_VT(arg)==VT_DISPATCH) { if (vt==VT_UNKNOWN && V_VT(arg)==VT_DISPATCH) {
/* in this context, if the type lib specifies IUnknown*, giving an IDispatch* is correct; so, don't invoke VariantChangeType */ /* in this context, if the type lib specifies IUnknown*, giving an
IDispatch* is correct; so, don't invoke VariantChangeType */
memcpy(argpos,&V_UNION(arg,lVal), arglen); memcpy(argpos,&V_UNION(arg,lVal), arglen);
return S_OK; return S_OK;
} }
@ -4515,82 +4520,110 @@ _copy_arg( ITypeInfo2 *tinfo, TYPEDESC *tdesc,
return _copy_arg(tinfo, tdesc->u.lptdesc, argpos, arg, tdesc->u.lptdesc->vt); return _copy_arg(tinfo, tdesc->u.lptdesc, argpos, arg, tdesc->u.lptdesc->vt);
if ((vt == VT_USERDEFINED) && tdesc && tinfo) { if ((vt == VT_USERDEFINED) && tdesc && tinfo) {
ITypeInfo *tinfo2; ITypeInfo *tinfo2 = NULL;
TYPEATTR *tattr; TYPEATTR *tattr = NULL;
HRESULT hres; HRESULT hres;
hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.hreftype,&tinfo2); hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.hreftype,&tinfo2);
if (hres) { if (hres) {
FIXME("Could not get typeinfo of hreftype %lx for VT_USERDEFINED, while coercing from vt 0x%x. Copying 4 byte.\n",tdesc->u.hreftype,V_VT(arg)); FIXME("Could not get typeinfo of hreftype %lx for VT_USERDEFINED, "
"while coercing from vt 0x%x. Copying 4 byte.\n",
tdesc->u.hreftype,V_VT(arg));
memcpy(argpos, &V_UNION(arg,lVal), 4); memcpy(argpos, &V_UNION(arg,lVal), 4);
return S_OK; return S_OK;
} }
ITypeInfo_GetTypeAttr(tinfo2,&tattr); hres = ITypeInfo_GetTypeAttr(tinfo2,&tattr);
if( hres )
{
ERR("GetTypeAttr failed\n");
ITypeInfo_Release(tinfo2);
return hres;
}
switch (tattr->typekind) { switch (tattr->typekind) {
case TKIND_ENUM: case TKIND_ENUM:
switch ( V_VT( arg ) ) { switch ( V_VT( arg ) ) {
case VT_I2: case VT_I2:
*argpos = V_UNION(arg,iVal); *argpos = V_UNION(arg,iVal);
return S_OK; hres = S_OK;
break;
case VT_I4: case VT_I4:
memcpy(argpos, &V_UNION(arg,lVal), 4); memcpy(argpos, &V_UNION(arg,lVal), 4);
return S_OK; hres = S_OK;
break;
default: default:
FIXME("vt 0x%x -> TKIND_ENUM unhandled.\n",V_VT(arg)); FIXME("vt 0x%x -> TKIND_ENUM unhandled.\n",V_VT(arg));
hres = E_FAIL;
break; break;
} }
break;
case TKIND_ALIAS: case TKIND_ALIAS:
tdesc = &(tattr->tdescAlias); tdesc = &(tattr->tdescAlias);
hres = _copy_arg((ITypeInfo2*)tinfo2, tdesc, argpos, arg, tdesc->vt); hres = _copy_arg((ITypeInfo2*)tinfo2, tdesc, argpos, arg, tdesc->vt);
ITypeInfo_Release(tinfo2); break;
return hres;
case TKIND_INTERFACE: case TKIND_INTERFACE:
if (V_VT(arg) == VT_DISPATCH) { if (V_VT(arg) == VT_DISPATCH) {
IDispatch *disp; IDispatch *disp;
if (IsEqualIID(&IID_IDispatch,&(tattr->guid))) { if (IsEqualIID(&IID_IDispatch,&(tattr->guid))) {
memcpy(argpos, &V_UNION(arg,pdispVal), 4); memcpy(argpos, &V_UNION(arg,pdispVal), 4);
return S_OK; hres = S_OK;
break;
} }
hres=IUnknown_QueryInterface(V_UNION(arg,pdispVal),&IID_IDispatch,(LPVOID*)&disp); hres=IUnknown_QueryInterface(V_UNION(arg,pdispVal),
&IID_IDispatch,(LPVOID*)&disp);
if (SUCCEEDED(hres)) { if (SUCCEEDED(hres)) {
memcpy(argpos,&disp,4); memcpy(argpos,&disp,4);
IUnknown_Release(V_UNION(arg,pdispVal)); IUnknown_Release(V_UNION(arg,pdispVal));
return S_OK; hres = S_OK;
break;
} }
FIXME("Failed to query IDispatch interface from %s while converting to VT_DISPATCH!\n",debugstr_guid(&(tattr->guid))); FIXME("Failed to query IDispatch interface from %s while "
return E_FAIL; "converting to VT_DISPATCH!\n",debugstr_guid(&(tattr->guid)));
hres = E_FAIL;
break;
} }
if (V_VT(arg) == VT_UNKNOWN) { if (V_VT(arg) == VT_UNKNOWN) {
memcpy(argpos, &V_UNION(arg,punkVal), 4); memcpy(argpos, &V_UNION(arg,punkVal), 4);
return S_OK; hres = S_OK;
break;
} }
FIXME("vt 0x%x -> TKIND_INTERFACE(%s) unhandled\n",V_VT(arg),debugstr_guid(&(tattr->guid))); FIXME("vt 0x%x -> TKIND_INTERFACE(%s) unhandled\n",
V_VT(arg),debugstr_guid(&(tattr->guid)));
hres = E_FAIL;
break; break;
case TKIND_DISPATCH: case TKIND_DISPATCH:
if (V_VT(arg) == VT_DISPATCH) { if (V_VT(arg) == VT_DISPATCH) {
memcpy(argpos, &V_UNION(arg,pdispVal), 4); memcpy(argpos, &V_UNION(arg,pdispVal), 4);
return S_OK; hres = S_OK;
} }
FIXME("TKIND_DISPATCH unhandled for target vt 0x%x.\n",V_VT(arg)); else {
hres = E_FAIL;
FIXME("TKIND_DISPATCH unhandled for target vt 0x%x.\n",V_VT(arg));
}
break; break;
case TKIND_RECORD: case TKIND_RECORD:
FIXME("TKIND_RECORD unhandled.\n"); FIXME("TKIND_RECORD unhandled.\n");
hres = E_FAIL;
break; break;
default: default:
FIXME("TKIND %d unhandled.\n",tattr->typekind); FIXME("TKIND %d unhandled.\n",tattr->typekind);
hres = E_FAIL;
break; break;
} }
return E_FAIL; ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
ITypeInfo_Release(tinfo2);
return hres;
} }
oldvt = V_VT(arg); oldvt = V_VT(arg);
VariantInit(&va); VariantInit(&va);
if (VariantChangeType(&va,arg,0,vt)==S_OK) { if (VariantChangeType(&va,arg,0,vt)==S_OK) {
memcpy(argpos,&V_UNION(&va,lVal), arglen); memcpy(argpos,&V_UNION(&va,lVal), arglen);
FIXME("Should not use VariantChangeType here. (conversion from 0x%x -> 0x%x)\n", FIXME("Should not use VariantChangeType here."
V_VT(arg), vt " (conversion from 0x%x -> 0x%x) %08lx\n",
V_VT(arg), vt, *argpos
); );
return S_OK; return S_OK;
} }
@ -4656,7 +4689,7 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
EXCEPINFO *pExcepInfo, EXCEPINFO *pExcepInfo,
UINT *pArgErr) UINT *pArgErr)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
int i; int i;
@ -4682,7 +4715,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
DWORD res; DWORD res;
int numargs, numargs2, argspos, args2pos; int numargs, numargs2, argspos, args2pos;
DWORD *args , *args2; DWORD *args , *args2;
VARIANT *rgvarg = HeapAlloc(GetProcessHeap(),0,sizeof(VARIANT)*pFDesc->funcdesc.cParams);
memcpy(rgvarg,pDispParams->rgvarg,sizeof(VARIANT)*pDispParams->cArgs);
numargs = 1; numargs2 = 0; numargs = 1; numargs2 = 0;
for (i=0;i<pFDesc->funcdesc.cParams;i++) { for (i=0;i<pFDesc->funcdesc.cParams;i++) {
@ -4702,11 +4736,40 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
for (i=0;i<pFDesc->funcdesc.cParams;i++) { for (i=0;i<pFDesc->funcdesc.cParams;i++) {
int arglen = _argsize(pFDesc->funcdesc.lprgelemdescParam[i].tdesc.vt); int arglen = _argsize(pFDesc->funcdesc.lprgelemdescParam[i].tdesc.vt);
if (i<pDispParams->cArgs) { if (i<pDispParams->cArgs) {
VARIANT *arg = &pDispParams->rgvarg[pDispParams->cArgs-i-1]; VARIANT *arg = &rgvarg[pDispParams->cArgs-i-1];
TYPEDESC *tdesc = &pFDesc->funcdesc.lprgelemdescParam[i].tdesc; TYPEDESC *tdesc = &pFDesc->funcdesc.lprgelemdescParam[i].tdesc;
hres = _copy_arg(iface, tdesc, &args[argspos], arg, tdesc->vt); USHORT paramFlags = pFDesc->funcdesc.lprgelemdescParam[i].u.paramdesc.wParamFlags;
if (FAILED(hres)) return hres; if (paramFlags & PARAMFLAG_FOPT) {
argspos += arglen; if(i < pFDesc->funcdesc.cParams-pFDesc->funcdesc.cParamsOpt)
ERR("Parameter has PARAMFLAG_FOPT flag but is not one of last cParamOpt parameters\n");
if(V_VT(arg) == VT_EMPTY
|| ((V_VT(arg) & VT_BYREF) && !V_BYREF(arg))) {
/* FIXME: Documentation says that we do this when parameter is left unspecified.
How to determine it? */
if(paramFlags & PARAMFLAG_FHASDEFAULT)
FIXME("PARAMFLAG_FHASDEFAULT flag not supported\n");
V_VT(arg) = VT_ERROR;
V_ERROR(arg) = DISP_E_PARAMNOTFOUND;
arglen = _argsize(VT_ERROR);
}
}
hres = _copy_arg(iface, tdesc, &args[argspos], arg, tdesc->vt);
if (FAILED(hres)) return hres;
argspos += arglen;
} else if(pFDesc->funcdesc.lprgelemdescParam[i].u.paramdesc.wParamFlags & PARAMFLAG_FOPT) {
VARIANT *arg = &rgvarg[i];
TYPEDESC *tdesc = &pFDesc->funcdesc.lprgelemdescParam[i].tdesc;
if(i < pFDesc->funcdesc.cParams-pFDesc->funcdesc.cParamsOpt)
ERR("Parameter has PARAMFLAG_FOPT flag but is not one of last cParamOpt parameters\n");
if(pFDesc->funcdesc.lprgelemdescParam[i].u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
FIXME("PARAMFLAG_FHASDEFAULT flag not supported\n");
V_VT(arg) = VT_ERROR;
V_ERROR(arg) = DISP_E_PARAMNOTFOUND;
arglen = _argsize(VT_ERROR);
hres = _copy_arg(iface, tdesc, &args[argspos], arg, tdesc->vt);
if (FAILED(hres)) return hres;
argspos += arglen;
} else { } else {
TYPEDESC *tdesc = &(pFDesc->funcdesc.lprgelemdescParam[i].tdesc); TYPEDESC *tdesc = &(pFDesc->funcdesc.lprgelemdescParam[i].tdesc);
if (tdesc->vt != VT_PTR) if (tdesc->vt != VT_PTR)
@ -4724,16 +4787,19 @@ static HRESULT WINAPI ITypeInfo_fnInvoke(
args2pos += arglen; args2pos += arglen;
} }
} }
if (pFDesc->funcdesc.cParamsOpt) if (pFDesc->funcdesc.cParamsOpt < 0)
FIXME("Does not support optional parameters (%d)\n", FIXME("Does not support optional parameters (%d)\n",
pFDesc->funcdesc.cParamsOpt pFDesc->funcdesc.cParamsOpt
); );
res = _invoke((*(FARPROC**)pIUnk)[pFDesc->funcdesc.oVft/4], res = _invoke((*(FARPROC**)pIUnk)[pFDesc->funcdesc.oVft/4],
pFDesc->funcdesc.callconv, pFDesc->funcdesc.callconv,
numargs, numargs,
args args
); );
HeapFree(GetProcessHeap(), 0, rgvarg);
if (pVarResult && (dwFlags & (DISPATCH_PROPERTYGET))) { if (pVarResult && (dwFlags & (DISPATCH_PROPERTYGET))) {
args2pos = 0; args2pos = 0;
for (i=0;i<pFDesc->funcdesc.cParams-pDispParams->cArgs;i++) { for (i=0;i<pFDesc->funcdesc.cParams-pDispParams->cArgs;i++) {
@ -4865,7 +4931,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDocumentation( ITypeInfo2 *iface,
MEMBERID memid, BSTR *pBstrName, BSTR *pBstrDocString, MEMBERID memid, BSTR *pBstrName, BSTR *pBstrDocString,
DWORD *pdwHelpContext, BSTR *pBstrHelpFile) DWORD *pdwHelpContext, BSTR *pBstrHelpFile)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
TRACE("(%p) memid %ld Name(%p) DocString(%p)" TRACE("(%p) memid %ld Name(%p) DocString(%p)"
@ -4915,7 +4981,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDllEntry( ITypeInfo2 *iface, MEMBERID memid
INVOKEKIND invKind, BSTR *pBstrDllName, BSTR *pBstrName, INVOKEKIND invKind, BSTR *pBstrDllName, BSTR *pBstrName,
WORD *pwOrdinal) WORD *pwOrdinal)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBFuncDesc *pFDesc; TLBFuncDesc *pFDesc;
FIXME("(%p, memid %lx, %d, %p, %p, %p), partial stub!\n", This, memid, invKind, pBstrDllName, pBstrName, pwOrdinal); FIXME("(%p, memid %lx, %d, %p, %p, %p), partial stub!\n", This, memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
@ -4927,7 +4993,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDllEntry( ITypeInfo2 *iface, MEMBERID memid
/* FIXME: This is wrong, but how do you find that out? */ /* FIXME: This is wrong, but how do you find that out? */
if (pBstrDllName) { if (pBstrDllName) {
const WCHAR oleaut32W[] = {'O','L','E','A','U','T','3','2','.','D','L','L',0}; static const WCHAR oleaut32W[] = {'O','L','E','A','U','T','3','2','.','D','L','L',0};
*pBstrDllName = SysAllocString(oleaut32W); *pBstrDllName = SysAllocString(oleaut32W);
} }
@ -4957,7 +5023,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
HREFTYPE hRefType, HREFTYPE hRefType,
ITypeInfo **ppTInfo) ITypeInfo **ppTInfo)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
HRESULT result = E_FAIL; HRESULT result = E_FAIL;
@ -5052,7 +5118,7 @@ static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(
static HRESULT WINAPI ITypeInfo_fnAddressOfMember( ITypeInfo2 *iface, static HRESULT WINAPI ITypeInfo_fnAddressOfMember( ITypeInfo2 *iface,
MEMBERID memid, INVOKEKIND invKind, PVOID *ppv) MEMBERID memid, INVOKEKIND invKind, PVOID *ppv)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
FIXME("(%p) stub!\n", This); FIXME("(%p) stub!\n", This);
return S_OK; return S_OK;
} }
@ -5065,7 +5131,7 @@ static HRESULT WINAPI ITypeInfo_fnAddressOfMember( ITypeInfo2 *iface,
static HRESULT WINAPI ITypeInfo_fnCreateInstance( ITypeInfo2 *iface, static HRESULT WINAPI ITypeInfo_fnCreateInstance( ITypeInfo2 *iface,
IUnknown *pUnk, REFIID riid, VOID **ppvObj) IUnknown *pUnk, REFIID riid, VOID **ppvObj)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
FIXME("(%p) stub!\n", This); FIXME("(%p) stub!\n", This);
return S_OK; return S_OK;
} }
@ -5077,7 +5143,7 @@ static HRESULT WINAPI ITypeInfo_fnCreateInstance( ITypeInfo2 *iface,
static HRESULT WINAPI ITypeInfo_fnGetMops( ITypeInfo2 *iface, MEMBERID memid, static HRESULT WINAPI ITypeInfo_fnGetMops( ITypeInfo2 *iface, MEMBERID memid,
BSTR *pBstrMops) BSTR *pBstrMops)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
FIXME("(%p) stub!\n", This); FIXME("(%p) stub!\n", This);
return S_OK; return S_OK;
} }
@ -5090,7 +5156,7 @@ static HRESULT WINAPI ITypeInfo_fnGetMops( ITypeInfo2 *iface, MEMBERID memid,
static HRESULT WINAPI ITypeInfo_fnGetContainingTypeLib( ITypeInfo2 *iface, static HRESULT WINAPI ITypeInfo_fnGetContainingTypeLib( ITypeInfo2 *iface,
ITypeLib * *ppTLib, UINT *pIndex) ITypeLib * *ppTLib, UINT *pIndex)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
/* If a pointer is null, we simply ignore it, the ATL in particular passes pIndex as 0 */ /* If a pointer is null, we simply ignore it, the ATL in particular passes pIndex as 0 */
if (pIndex) { if (pIndex) {
@ -5115,7 +5181,7 @@ static HRESULT WINAPI ITypeInfo_fnGetContainingTypeLib( ITypeInfo2 *iface,
static void WINAPI ITypeInfo_fnReleaseTypeAttr( ITypeInfo2 *iface, static void WINAPI ITypeInfo_fnReleaseTypeAttr( ITypeInfo2 *iface,
TYPEATTR* pTypeAttr) TYPEATTR* pTypeAttr)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TRACE("(%p)->(%p)\n", This, pTypeAttr); TRACE("(%p)->(%p)\n", This, pTypeAttr);
} }
@ -5127,7 +5193,7 @@ static void WINAPI ITypeInfo_fnReleaseFuncDesc(
ITypeInfo2 *iface, ITypeInfo2 *iface,
FUNCDESC *pFuncDesc) FUNCDESC *pFuncDesc)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TRACE("(%p)->(%p)\n", This, pFuncDesc); TRACE("(%p)->(%p)\n", This, pFuncDesc);
} }
@ -5138,7 +5204,7 @@ static void WINAPI ITypeInfo_fnReleaseFuncDesc(
static void WINAPI ITypeInfo_fnReleaseVarDesc( ITypeInfo2 *iface, static void WINAPI ITypeInfo_fnReleaseVarDesc( ITypeInfo2 *iface,
VARDESC *pVarDesc) VARDESC *pVarDesc)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TRACE("(%p)->(%p)\n", This, pVarDesc); TRACE("(%p)->(%p)\n", This, pVarDesc);
} }
@ -5150,7 +5216,7 @@ static void WINAPI ITypeInfo_fnReleaseVarDesc( ITypeInfo2 *iface,
static HRESULT WINAPI ITypeInfo2_fnGetTypeKind( ITypeInfo2 * iface, static HRESULT WINAPI ITypeInfo2_fnGetTypeKind( ITypeInfo2 * iface,
TYPEKIND *pTypeKind) TYPEKIND *pTypeKind)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
*pTypeKind=This->TypeAttr.typekind; *pTypeKind=This->TypeAttr.typekind;
TRACE("(%p) type 0x%0x\n", This,*pTypeKind); TRACE("(%p) type 0x%0x\n", This,*pTypeKind);
return S_OK; return S_OK;
@ -5165,7 +5231,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetTypeKind( ITypeInfo2 * iface,
*/ */
static HRESULT WINAPI ITypeInfo2_fnGetTypeFlags( ITypeInfo2 *iface, ULONG *pTypeFlags) static HRESULT WINAPI ITypeInfo2_fnGetTypeFlags( ITypeInfo2 *iface, ULONG *pTypeFlags)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
*pTypeFlags=This->TypeAttr.wTypeFlags; *pTypeFlags=This->TypeAttr.wTypeFlags;
TRACE("(%p) flags 0x%lx\n", This,*pTypeFlags); TRACE("(%p) flags 0x%lx\n", This,*pTypeFlags);
return S_OK; return S_OK;
@ -5179,7 +5245,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetTypeFlags( ITypeInfo2 *iface, ULONG *pType
static HRESULT WINAPI ITypeInfo2_fnGetFuncIndexOfMemId( ITypeInfo2 * iface, static HRESULT WINAPI ITypeInfo2_fnGetFuncIndexOfMemId( ITypeInfo2 * iface,
MEMBERID memid, INVOKEKIND invKind, UINT *pFuncIndex) MEMBERID memid, INVOKEKIND invKind, UINT *pFuncIndex)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBFuncDesc *pFuncInfo; TLBFuncDesc *pFuncInfo;
int i; int i;
HRESULT result; HRESULT result;
@ -5207,7 +5273,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncIndexOfMemId( ITypeInfo2 * iface,
static HRESULT WINAPI ITypeInfo2_fnGetVarIndexOfMemId( ITypeInfo2 * iface, static HRESULT WINAPI ITypeInfo2_fnGetVarIndexOfMemId( ITypeInfo2 * iface,
MEMBERID memid, UINT *pVarIndex) MEMBERID memid, UINT *pVarIndex)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBVarDesc *pVarInfo; TLBVarDesc *pVarInfo;
int i; int i;
HRESULT result; HRESULT result;
@ -5235,7 +5301,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetCustData(
REFGUID guid, REFGUID guid,
VARIANT *pVarVal) VARIANT *pVarVal)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData; TLBCustData *pCData;
for(pCData=This->pCustData; pCData; pCData = pCData->next) for(pCData=This->pCustData; pCData; pCData = pCData->next)
@ -5262,7 +5328,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData(
REFGUID guid, REFGUID guid,
VARIANT *pVarVal) VARIANT *pVarVal)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData=NULL; TLBCustData *pCData=NULL;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
int i; int i;
@ -5294,7 +5360,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetParamCustData(
REFGUID guid, REFGUID guid,
VARIANT *pVarVal) VARIANT *pVarVal)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData=NULL; TLBCustData *pCData=NULL;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
int i; int i;
@ -5327,7 +5393,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetVarCustData(
REFGUID guid, REFGUID guid,
VARIANT *pVarVal) VARIANT *pVarVal)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData=NULL; TLBCustData *pCData=NULL;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
int i; int i;
@ -5363,7 +5429,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData(
REFGUID guid, REFGUID guid,
VARIANT *pVarVal) VARIANT *pVarVal)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData=NULL; TLBCustData *pCData=NULL;
TLBImplType * pRDesc; TLBImplType * pRDesc;
int i; int i;
@ -5404,7 +5470,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetDocumentation2(
DWORD *pdwHelpStringContext, DWORD *pdwHelpStringContext,
BSTR *pbstrHelpStringDll) BSTR *pbstrHelpStringDll)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
TRACE("(%p) memid %ld lcid(0x%lx) HelpString(%p) " TRACE("(%p) memid %ld lcid(0x%lx) HelpString(%p) "
@ -5460,7 +5526,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllCustData(
ITypeInfo2 * iface, ITypeInfo2 * iface,
CUSTDATA *pCustData) CUSTDATA *pCustData)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData; TLBCustData *pCData;
int i; int i;
@ -5490,7 +5556,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllFuncCustData(
UINT index, UINT index,
CUSTDATA *pCustData) CUSTDATA *pCustData)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData; TLBCustData *pCData;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
int i; int i;
@ -5526,7 +5592,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllFuncCustData(
static HRESULT WINAPI ITypeInfo2_fnGetAllParamCustData( ITypeInfo2 * iface, static HRESULT WINAPI ITypeInfo2_fnGetAllParamCustData( ITypeInfo2 * iface,
UINT indexFunc, UINT indexParam, CUSTDATA *pCustData) UINT indexFunc, UINT indexParam, CUSTDATA *pCustData)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData=NULL; TLBCustData *pCData=NULL;
TLBFuncDesc * pFDesc; TLBFuncDesc * pFDesc;
int i; int i;
@ -5563,7 +5629,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllParamCustData( ITypeInfo2 * iface,
static HRESULT WINAPI ITypeInfo2_fnGetAllVarCustData( ITypeInfo2 * iface, static HRESULT WINAPI ITypeInfo2_fnGetAllVarCustData( ITypeInfo2 * iface,
UINT index, CUSTDATA *pCustData) UINT index, CUSTDATA *pCustData)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData; TLBCustData *pCData;
TLBVarDesc * pVDesc; TLBVarDesc * pVDesc;
int i; int i;
@ -5601,7 +5667,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllImplTypeCustData(
UINT index, UINT index,
CUSTDATA *pCustData) CUSTDATA *pCustData)
{ {
ICOM_THIS( ITypeInfoImpl, iface); ITypeInfoImpl *This = (ITypeInfoImpl *)iface;
TLBCustData *pCData; TLBCustData *pCData;
TLBImplType * pRDesc; TLBImplType * pRDesc;
int i; int i;
@ -5629,9 +5695,8 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllImplTypeCustData(
return TYPE_E_ELEMENTNOTFOUND; return TYPE_E_ELEMENTNOTFOUND;
} }
static ICOM_VTABLE(ITypeInfo2) tinfvt = static ITypeInfo2Vtbl tinfvt =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ITypeInfo_fnQueryInterface, ITypeInfo_fnQueryInterface,
ITypeInfo_fnAddRef, ITypeInfo_fnAddRef,
@ -5784,9 +5849,8 @@ static HRESULT WINAPI ITypeComp_fnBindType(
return S_OK; return S_OK;
} }
static ICOM_VTABLE(ITypeComp) tcompvt = static ITypeCompVtbl tcompvt =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ITypeComp_fnQueryInterface, ITypeComp_fnQueryInterface,
ITypeComp_fnAddRef, ITypeComp_fnAddRef,

View file

@ -76,9 +76,9 @@ typedef struct tagMSFT_Header {
INT helpfile; /* position of helpfile in stringtable */ INT helpfile; /* position of helpfile in stringtable */
/*0x40*/INT CustomDataOffset; /* if -1 no custom data, else it is offset */ /*0x40*/INT CustomDataOffset; /* if -1 no custom data, else it is offset */
/* in customer data/guid offset table */ /* in customer data/guid offset table */
INT res44; /* unknown always: 0x20 */ INT res44; /* unknown always: 0x20 (guid hash size?) */
INT res48; /* unknown always: 0x80 */ INT res48; /* unknown always: 0x80 (name hash size?) */
INT dispatchpos; /* gets a value (1+n*0x0c) with Idispatch interfaces */ INT dispatchpos; /* HREFTYPE to IDispatch, or -1 if no IDispatch */
/*0x50*/INT res50; /* is zero becomes one when an interface is derived */ /*0x50*/INT res50; /* is zero becomes one when an interface is derived */
} MSFT_Header; } MSFT_Header;
@ -172,11 +172,11 @@ typedef struct {
INT DataType; /* data type of the memeber, eg return of function */ INT DataType; /* data type of the memeber, eg return of function */
INT Flags; /* something to do with attribute flags (LOWORD) */ INT Flags; /* something to do with attribute flags (LOWORD) */
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
INT16 res3; /* some offset into dunno what */ INT16 funcdescsize; /* size of reconstituted FUNCDESC and related structs */
INT16 VtableOffset; /* offset in vtable */ INT16 VtableOffset; /* offset in vtable */
#else #else
INT16 VtableOffset; /* offset in vtable */ INT16 VtableOffset; /* offset in vtable */
INT16 res3; /* some offset into dunno what */ INT16 funcdescsize; /* size of reconstituted FUNCDESC and related structs */
#endif #endif
INT FKCCIC; /* bit string with the following */ INT FKCCIC; /* bit string with the following */
/* meaning (bit 0 is the msb): */ /* meaning (bit 0 is the msb): */
@ -226,11 +226,11 @@ typedef struct {
INT DataType; /* data type of the variable */ INT DataType; /* data type of the variable */
INT Flags; /* VarFlags (LOWORD) */ INT Flags; /* VarFlags (LOWORD) */
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
INT16 res3; /* some offset into dunno what */ INT16 vardescsize; /* size of reconstituted VARDESC and related structs */
INT16 VarKind; /* VarKind */ INT16 VarKind; /* VarKind */
#else #else
INT16 VarKind; /* VarKind */ INT16 VarKind; /* VarKind */
INT16 res3; /* some offset into dunno what */ INT16 vardescsize; /* size of reconstituted VARDESC and related structs */
#endif #endif
INT OffsValue; /* value of the variable or the offset */ INT OffsValue; /* value of the variable or the offset */
/* in the data structure */ /* in the data structure */
@ -258,17 +258,23 @@ typedef struct {
/* this is how a guid is stored */ /* this is how a guid is stored */
typedef struct { typedef struct {
GUID guid; GUID guid;
INT unk10; /* differntiate with libid, classid etc? */ INT hreftype; /* -2 for the typelib guid, typeinfo offset
/* it's -2 for a libary */ for typeinfo guid, low two bits are 01 if
/* it's 0 for an interface */ this is an imported typeinfo, low two bits
INT unk14; /* always? -1 */ are 10 if this is an imported typelib (used
by imported typeinfos) */
INT next_hash; /* offset to next guid in the hash bucket */
} MSFT_GuidEntry; } MSFT_GuidEntry;
/* some data preceding entries in the name table */ /* some data preceding entries in the name table */
typedef struct { typedef struct {
INT unk00; /* sometimes -1 (lib, parameter) , INT hreftype; /* is -1 if name is for neither a typeinfo,
sometimes 0 (interface, func) */ a variable, or a function (that is, name
INT unk10; /* sometimes -1 (lib) , sometimes 0 (interface, func), is for a typelib or a function parameter).
sometimes 0x10 (par) */ otherwise is the offset of the first
typeinfo that this name refers to (either
to the typeinfo itself or to a member of
the typeinfo */
INT next_hash; /* offset to next name in the hash bucket */
INT namelen; /* only lower 8 bits are valid, INT namelen; /* only lower 8 bits are valid,
lower-middle 8 bits are unknown (flags?), lower-middle 8 bits are unknown (flags?),
upper 16 bits are hash code */ upper 16 bits are hash code */

View file

@ -146,8 +146,8 @@ typedef struct tagMSFT_ImpFile {
typedef struct tagICreateTypeLib2Impl typedef struct tagICreateTypeLib2Impl
{ {
ICOM_VFIELD(ICreateTypeLib2); ICreateTypeLib2Vtbl *lpVtbl;
ICOM_VTABLE(ITypeLib2) *lpVtblTypeLib2; ITypeLib2Vtbl *lpVtblTypeLib2;
UINT ref; UINT ref;
@ -172,8 +172,8 @@ typedef struct tagICreateTypeLib2Impl
typedef struct tagICreateTypeInfo2Impl typedef struct tagICreateTypeInfo2Impl
{ {
ICOM_VFIELD(ICreateTypeInfo2); ICreateTypeInfo2Vtbl *lpVtbl;
ICOM_VTABLE(ITypeInfo2) *lpVtblTypeInfo2; ITypeInfo2Vtbl *lpVtblTypeInfo2;
UINT ref; UINT ref;
@ -253,6 +253,58 @@ static void ctl2_init_segdir(
} }
} }
/****************************************************************************
* ctl2_hash_guid
*
* Generates a hash key from a GUID.
*
* RETURNS
*
* The hash key for the GUID.
*/
static int ctl2_hash_guid(
REFGUID guid) /* [I] The guid to find. */
{
int hash;
int i;
hash = 0;
for (i = 0; i < 8; i ++) {
hash ^= ((short *)guid)[i];
}
return (hash & 0xf) | ((hash & 0x10) & (0 - !!(hash & 0xe0)));
}
/****************************************************************************
* ctl2_find_guid
*
* Locates a guid in a type library.
*
* RETURNS
*
* The offset into the GUID segment of the guid, or -1 if not found.
*/
static int ctl2_find_guid(
ICreateTypeLib2Impl *This, /* [I] The typelib to operate against. */
int hash_key, /* [I] The hash key for the guid. */
REFGUID guid) /* [I] The guid to find. */
{
int offset;
MSFT_GuidEntry *guidentry;
offset = This->typelib_guidhash_segment[hash_key];
while (offset != -1) {
guidentry = (MSFT_GuidEntry *)&This->typelib_segment_data[MSFT_SEG_GUID][offset];
if (!memcmp(guidentry, guid, sizeof(GUID))) return offset;
offset = guidentry->next_hash;
}
return offset;
}
/**************************************************************************** /****************************************************************************
* ctl2_find_name * ctl2_find_name
* *
@ -306,7 +358,7 @@ static int ctl2_find_name(
*/ */
static int ctl2_encode_name( static int ctl2_encode_name(
ICreateTypeLib2Impl *This, /* [I] The typelib to operate against (used for LCID only). */ ICreateTypeLib2Impl *This, /* [I] The typelib to operate against (used for LCID only). */
WCHAR *name, /* [I] The name string to encode. */ const WCHAR *name, /* [I] The name string to encode. */
char **result) /* [O] A pointer to a pointer to receive the encoded name. */ char **result) /* [O] A pointer to a pointer to receive the encoded name. */
{ {
int length; int length;
@ -350,7 +402,7 @@ static int ctl2_encode_name(
*/ */
static int ctl2_encode_string( static int ctl2_encode_string(
ICreateTypeLib2Impl *This, /* [I] The typelib to operate against (not used?). */ ICreateTypeLib2Impl *This, /* [I] The typelib to operate against (not used?). */
WCHAR *string, /* [I] The string to encode. */ const WCHAR *string, /* [I] The string to encode. */
char **result) /* [O] A pointer to a pointer to receive the encoded string. */ char **result) /* [O] A pointer to a pointer to receive the encoded string. */
{ {
int length; int length;
@ -497,17 +549,12 @@ static int ctl2_alloc_guid(
{ {
int offset; int offset;
MSFT_GuidEntry *guid_space; MSFT_GuidEntry *guid_space;
int hash;
int hash_key; int hash_key;
int i;
for (offset = 0; offset < This->typelib_segdir[MSFT_SEG_GUID].length; hash_key = ctl2_hash_guid(&guid->guid);
offset += sizeof(MSFT_GuidEntry)) {
if (!memcmp(&(This->typelib_segment_data[MSFT_SEG_GUID][offset]), offset = ctl2_find_guid(This, hash_key, &guid->guid);
guid, sizeof(GUID))) { if (offset != -1) return offset;
return offset;
}
}
offset = ctl2_alloc_segment(This, MSFT_SEG_GUID, sizeof(MSFT_GuidEntry), 0); offset = ctl2_alloc_segment(This, MSFT_SEG_GUID, sizeof(MSFT_GuidEntry), 0);
if (offset == -1) return -1; if (offset == -1) return -1;
@ -515,17 +562,9 @@ static int ctl2_alloc_guid(
guid_space = (void *)(This->typelib_segment_data[MSFT_SEG_GUID] + offset); guid_space = (void *)(This->typelib_segment_data[MSFT_SEG_GUID] + offset);
*guid_space = *guid; *guid_space = *guid;
hash = 0; guid_space->next_hash = This->typelib_guidhash_segment[hash_key];
for (i = 0; i < 16; i += 2) {
hash ^= *((short *)&This->typelib_segment_data[MSFT_SEG_GUID][offset + i]);
}
hash_key = (hash & 0xf) | ((hash & 0x10) & (0 - !!(hash & 0xe0)));
guid_space->unk14 = This->typelib_guidhash_segment[hash_key];
This->typelib_guidhash_segment[hash_key] = offset; This->typelib_guidhash_segment[hash_key] = offset;
TRACE("Updating GUID hash table (%s,0x%x).\n", debugstr_guid(&guid->guid), hash);
return offset; return offset;
} }
@ -542,7 +581,7 @@ static int ctl2_alloc_guid(
*/ */
static int ctl2_alloc_name( static int ctl2_alloc_name(
ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */ ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */
WCHAR *name) /* [I] The name to store. */ const WCHAR *name) /* [I] The name to store. */
{ {
int length; int length;
int offset; int offset;
@ -558,12 +597,12 @@ static int ctl2_alloc_name(
if (offset == -1) return -1; if (offset == -1) return -1;
name_space = (void *)(This->typelib_segment_data[MSFT_SEG_NAME] + offset); name_space = (void *)(This->typelib_segment_data[MSFT_SEG_NAME] + offset);
name_space->unk00 = -1; name_space->hreftype = -1;
name_space->unk10 = -1; name_space->next_hash = -1;
memcpy(&name_space->namelen, encoded_name, length); memcpy(&name_space->namelen, encoded_name, length);
if (This->typelib_namehash_segment[encoded_name[2] & 0x7f] != -1) if (This->typelib_namehash_segment[encoded_name[2] & 0x7f] != -1)
name_space->unk10 = This->typelib_namehash_segment[encoded_name[2] & 0x7f]; name_space->next_hash = This->typelib_namehash_segment[encoded_name[2] & 0x7f];
This->typelib_namehash_segment[encoded_name[2] & 0x7f] = offset; This->typelib_namehash_segment[encoded_name[2] & 0x7f] = offset;
@ -585,7 +624,7 @@ static int ctl2_alloc_name(
*/ */
static int ctl2_alloc_string( static int ctl2_alloc_string(
ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */ ICreateTypeLib2Impl *This, /* [I] The type library to allocate in. */
WCHAR *string) /* [I] The string to store. */ const WCHAR *string) /* [I] The string to store. */
{ {
int length; int length;
int offset; int offset;
@ -659,7 +698,7 @@ static int ctl2_alloc_importfile(
int guidoffset, /* [I] The offset to the GUID for the imported library. */ int guidoffset, /* [I] The offset to the GUID for the imported library. */
int major_version, /* [I] The major version number of the imported library. */ int major_version, /* [I] The major version number of the imported library. */
int minor_version, /* [I] The minor version number of the imported library. */ int minor_version, /* [I] The minor version number of the imported library. */
WCHAR *filename) /* [I] The filename of the imported library. */ const WCHAR *filename) /* [I] The filename of the imported library. */
{ {
int length; int length;
int offset; int offset;
@ -751,8 +790,8 @@ static HRESULT ctl2_set_custdata(
guidentry.guid = *guid; guidentry.guid = *guid;
guidentry.unk10 = -1; guidentry.hreftype = -1;
guidentry.unk14 = -1; guidentry.next_hash = -1;
guidoffset = ctl2_alloc_guid(This, &guidentry); guidoffset = ctl2_alloc_guid(This, &guidentry);
if (guidoffset == -1) return E_OUTOFMEMORY; if (guidoffset == -1) return E_OUTOFMEMORY;
@ -1020,6 +1059,39 @@ static int ctl2_find_nth_reference(
return offset; return offset;
} }
/****************************************************************************
* ctl2_find_typeinfo_from_offset
*
* Finds an ITypeInfo given an offset into the TYPEINFO segment.
*
* RETURNS
*
* Success: S_OK.
* Failure: TYPE_E_ELEMENTNOTFOUND.
*/
static HRESULT ctl2_find_typeinfo_from_offset(
ICreateTypeLib2Impl *This, /* [I] The typelib to find the typeinfo in. */
int offset, /* [I] The offset of the desired typeinfo. */
ITypeInfo **ppTinfo) /* [I] The typeinfo found. */
{
void *typeinfodata;
ICreateTypeInfo2Impl *typeinfo;
typeinfodata = &This->typelib_segment_data[MSFT_SEG_TYPEINFO][offset];
for (typeinfo = This->typeinfos; typeinfo; typeinfo = typeinfo->next_typeinfo) {
if (typeinfo->typeinfo == typeinfodata) {
*ppTinfo = (ITypeInfo *)&typeinfo->lpVtblTypeInfo2;
ITypeInfo2_AddRef(*ppTinfo);
return S_OK;
}
}
ERR("Failed to find typeinfo, invariant varied.\n");
return TYPE_E_ELEMENTNOTFOUND;
}
/*================== ICreateTypeInfo2 Implementation ===================================*/ /*================== ICreateTypeInfo2 Implementation ===================================*/
/****************************************************************************** /******************************************************************************
@ -1032,7 +1104,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnQueryInterface(
REFIID riid, REFIID riid,
VOID **ppvObject) VOID **ppvObject)
{ {
ICOM_THIS( ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid)); TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
@ -1064,7 +1136,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnQueryInterface(
*/ */
static ULONG WINAPI ICreateTypeInfo2_fnAddRef(ICreateTypeInfo2 *iface) static ULONG WINAPI ICreateTypeInfo2_fnAddRef(ICreateTypeInfo2 *iface)
{ {
ICOM_THIS( ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
TRACE("(%p)->ref was %u\n",This, This->ref); TRACE("(%p)->ref was %u\n",This, This->ref);
@ -1078,7 +1150,7 @@ static ULONG WINAPI ICreateTypeInfo2_fnAddRef(ICreateTypeInfo2 *iface)
*/ */
static ULONG WINAPI ICreateTypeInfo2_fnRelease(ICreateTypeInfo2 *iface) static ULONG WINAPI ICreateTypeInfo2_fnRelease(ICreateTypeInfo2 *iface)
{ {
ICOM_THIS( ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
--(This->ref); --(This->ref);
@ -1106,7 +1178,7 @@ static ULONG WINAPI ICreateTypeInfo2_fnRelease(ICreateTypeInfo2 *iface)
*/ */
static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface, REFGUID guid) static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface, REFGUID guid)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
MSFT_GuidEntry guidentry; MSFT_GuidEntry guidentry;
int offset; int offset;
@ -1114,8 +1186,8 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface, REFGUI
TRACE("(%p,%s)\n", iface, debugstr_guid(guid)); TRACE("(%p,%s)\n", iface, debugstr_guid(guid));
guidentry.guid = *guid; guidentry.guid = *guid;
guidentry.unk10 = 0; guidentry.hreftype = This->typelib->typelib_typeinfo_offsets[This->typeinfo->typekind >> 16];
guidentry.unk14 = 0x18; guidentry.next_hash = -1;
offset = ctl2_alloc_guid(This->typelib, &guidentry); offset = ctl2_alloc_guid(This->typelib, &guidentry);
@ -1123,6 +1195,10 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface, REFGUI
This->typeinfo->posguid = offset; This->typeinfo->posguid = offset;
if (IsEqualIID(guid, &IID_IDispatch)) {
This->typelib->typelib_header.dispatchpos = This->typelib->typelib_typeinfo_offsets[This->typeinfo->typekind >> 16];
}
return S_OK; return S_OK;
} }
@ -1133,7 +1209,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface, REFGUI
*/ */
static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, UINT uTypeFlags) static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, UINT uTypeFlags)
{ {
ICOM_THIS( ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
TRACE("(%p,0x%x)\n", iface, uTypeFlags); TRACE("(%p,0x%x)\n", iface, uTypeFlags);
@ -1144,11 +1220,11 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, U
int guidoffset; int guidoffset;
int fileoffset; int fileoffset;
MSFT_ImpInfo impinfo; MSFT_ImpInfo impinfo;
WCHAR stdole2tlb[] = { 's','t','d','o','l','e','2','.','t','l','b',0 }; static const WCHAR stdole2tlb[] = { 's','t','d','o','l','e','2','.','t','l','b',0 };
foo.guid = IID_StdOle; foo.guid = IID_StdOle;
foo.unk10 = 2; foo.hreftype = 2;
foo.unk14 = -1; foo.next_hash = -1;
guidoffset = ctl2_alloc_guid(This->typelib, &foo); guidoffset = ctl2_alloc_guid(This->typelib, &foo);
if (guidoffset == -1) return E_OUTOFMEMORY; if (guidoffset == -1) return E_OUTOFMEMORY;
@ -1156,8 +1232,8 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, U
if (fileoffset == -1) return E_OUTOFMEMORY; if (fileoffset == -1) return E_OUTOFMEMORY;
foo.guid = IID_IDispatch; foo.guid = IID_IDispatch;
foo.unk10 = 1; foo.hreftype = 1;
foo.unk14 = -1; foo.next_hash = -1;
guidoffset = ctl2_alloc_guid(This->typelib, &foo); guidoffset = ctl2_alloc_guid(This->typelib, &foo);
if (guidoffset == -1) return E_OUTOFMEMORY; if (guidoffset == -1) return E_OUTOFMEMORY;
@ -1186,7 +1262,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetDocString(
ICreateTypeInfo2* iface, ICreateTypeInfo2* iface,
LPOLESTR pStrDoc) LPOLESTR pStrDoc)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
int offset; int offset;
@ -1207,8 +1283,13 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetHelpContext(
ICreateTypeInfo2* iface, ICreateTypeInfo2* iface,
DWORD dwHelpContext) DWORD dwHelpContext)
{ {
FIXME("(%p,%ld), stub!\n", iface, dwHelpContext); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
return E_OUTOFMEMORY;
TRACE("(%p,%ld)\n", iface, dwHelpContext);
This->typeinfo->helpcontext = dwHelpContext;
return S_OK;
} }
/****************************************************************************** /******************************************************************************
@ -1221,7 +1302,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetVersion(
WORD wMajorVerNum, WORD wMajorVerNum,
WORD wMinorVerNum) WORD wMinorVerNum)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
TRACE("(%p,%d,%d)\n", iface, wMajorVerNum, wMinorVerNum); TRACE("(%p,%d,%d)\n", iface, wMajorVerNum, wMinorVerNum);
@ -1239,7 +1320,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddRefTypeInfo(
ITypeInfo* pTInfo, ITypeInfo* pTInfo,
HREFTYPE* phRefType) HREFTYPE* phRefType)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
ITypeLib *container; ITypeLib *container;
int index; int index;
@ -1281,7 +1362,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc(
UINT index, UINT index,
FUNCDESC* pFuncDesc) FUNCDESC* pFuncDesc)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
int offset; int offset;
int *typedata; int *typedata;
@ -1365,7 +1446,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddImplType(
UINT index, UINT index,
HREFTYPE hRefType) HREFTYPE hRefType)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
TRACE("(%p,%d,%ld)\n", iface, index, hRefType); TRACE("(%p,%d,%ld)\n", iface, index, hRefType);
@ -1434,7 +1515,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeFlags(
UINT index, UINT index,
INT implTypeFlags) INT implTypeFlags)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
int offset; int offset;
MSFT_RefRecord *ref; MSFT_RefRecord *ref;
@ -1462,7 +1543,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetAlignment(
ICreateTypeInfo2* iface, ICreateTypeInfo2* iface,
WORD cbAlignment) WORD cbAlignment)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
TRACE("(%p,%d)\n", iface, cbAlignment); TRACE("(%p,%d)\n", iface, cbAlignment);
@ -1520,7 +1601,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(
UINT index, UINT index,
VARDESC* pVarDesc) VARDESC* pVarDesc)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
int offset; int offset;
INT *typedata; INT *typedata;
int var_datawidth; int var_datawidth;
@ -1613,7 +1694,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames(
LPOLESTR* rgszNames, LPOLESTR* rgszNames,
UINT cNames) UINT cNames)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
int i; int i;
int offset; int offset;
@ -1651,7 +1732,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetVarName(
UINT index, UINT index,
LPOLESTR szName) LPOLESTR szName)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
int offset; int offset;
char *namedata; char *namedata;
@ -1666,8 +1747,10 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetVarName(
if (offset == -1) return E_OUTOFMEMORY; if (offset == -1) return E_OUTOFMEMORY;
namedata = This->typelib->typelib_segment_data[MSFT_SEG_NAME] + offset; namedata = This->typelib->typelib_segment_data[MSFT_SEG_NAME] + offset;
*((INT *)namedata) = This->typelib->typelib_typeinfo_offsets[This->typeinfo->typekind >> 16]; if (*((INT *)namedata) == -1) {
namedata[9] = 0x10; *((INT *)namedata) = This->typelib->typelib_typeinfo_offsets[This->typeinfo->typekind >> 16];
namedata[9] |= 0x10;
}
if ((This->typeinfo->typekind & 15) == TKIND_ENUM) { if ((This->typeinfo->typekind & 15) == TKIND_ENUM) {
namedata[9] |= 0x20; namedata[9] |= 0x20;
} }
@ -1685,8 +1768,25 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeDescAlias(
ICreateTypeInfo2* iface, ICreateTypeInfo2* iface,
TYPEDESC* pTDescAlias) TYPEDESC* pTDescAlias)
{ {
FIXME("(%p,%p), stub!\n", iface, pTDescAlias); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
return E_OUTOFMEMORY;
int encoded_typedesc;
int width;
if ((This->typeinfo->typekind & 15) != TKIND_ALIAS) {
return TYPE_E_WRONGTYPEKIND;
}
FIXME("(%p,%p), hack!\n", iface, pTDescAlias);
if (ctl2_encode_typedesc(This->typelib, pTDescAlias, &encoded_typedesc, &width, NULL, NULL) == -1) {
return E_OUTOFMEMORY;
}
This->typeinfo->size = width;
This->typeinfo->datatype1 = encoded_typedesc;
return S_OK;
} }
/****************************************************************************** /******************************************************************************
@ -1728,7 +1828,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetVarDocString(
UINT index, UINT index,
LPOLESTR szDocString) LPOLESTR szDocString)
{ {
ICOM_THIS(ICreateTypeInfo2Impl, iface); ICreateTypeInfo2Impl *This = (ICreateTypeInfo2Impl *)iface;
FIXME("(%p,%d,%s), stub!\n", iface, index, debugstr_w(szDocString)); FIXME("(%p,%d,%s), stub!\n", iface, index, debugstr_w(szDocString));
@ -2698,9 +2798,8 @@ static HRESULT WINAPI ITypeInfo2_fnGetAllImplTypeCustData(
/*================== ICreateTypeInfo2 & ITypeInfo2 VTABLEs And Creation ===================================*/ /*================== ICreateTypeInfo2 & ITypeInfo2 VTABLEs And Creation ===================================*/
static ICOM_VTABLE(ICreateTypeInfo2) ctypeinfo2vt = static ICreateTypeInfo2Vtbl ctypeinfo2vt =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ICreateTypeInfo2_fnQueryInterface, ICreateTypeInfo2_fnQueryInterface,
ICreateTypeInfo2_fnAddRef, ICreateTypeInfo2_fnAddRef,
@ -2747,9 +2846,8 @@ static ICOM_VTABLE(ICreateTypeInfo2) ctypeinfo2vt =
ICreateTypeInfo2_fnSetName ICreateTypeInfo2_fnSetName
}; };
static ICOM_VTABLE(ITypeInfo2) typeinfo2vt = static ITypeInfo2Vtbl typeinfo2vt =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ITypeInfo2_fnQueryInterface, ITypeInfo2_fnQueryInterface,
ITypeInfo2_fnAddRef, ITypeInfo2_fnAddRef,
@ -2873,7 +2971,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface(
REFIID riid, REFIID riid,
VOID **ppvObject) VOID **ppvObject)
{ {
ICOM_THIS( ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid)); TRACE("(%p)->(IID: %s)\n",This,debugstr_guid(riid));
@ -2905,7 +3003,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface(
*/ */
static ULONG WINAPI ICreateTypeLib2_fnAddRef(ICreateTypeLib2 *iface) static ULONG WINAPI ICreateTypeLib2_fnAddRef(ICreateTypeLib2 *iface)
{ {
ICOM_THIS( ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
TRACE("(%p)->ref was %u\n",This, This->ref); TRACE("(%p)->ref was %u\n",This, This->ref);
@ -2919,7 +3017,7 @@ static ULONG WINAPI ICreateTypeLib2_fnAddRef(ICreateTypeLib2 *iface)
*/ */
static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface) static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface)
{ {
ICOM_THIS( ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
--(This->ref); --(This->ref);
@ -2966,7 +3064,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnCreateTypeInfo(
TYPEKIND tkind, TYPEKIND tkind,
ICreateTypeInfo **ppCTInfo) ICreateTypeInfo **ppCTInfo)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
TRACE("(%p,%s,%d,%p)\n", iface, debugstr_w(szName), tkind, ppCTInfo); TRACE("(%p,%s,%d,%p)\n", iface, debugstr_w(szName), tkind, ppCTInfo);
@ -2986,7 +3084,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetName(
ICreateTypeLib2 * iface, ICreateTypeLib2 * iface,
LPOLESTR szName) LPOLESTR szName)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
int offset; int offset;
@ -3005,7 +3103,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetName(
*/ */
static HRESULT WINAPI ICreateTypeLib2_fnSetVersion(ICreateTypeLib2 * iface, WORD wMajorVerNum, WORD wMinorVerNum) static HRESULT WINAPI ICreateTypeLib2_fnSetVersion(ICreateTypeLib2 * iface, WORD wMajorVerNum, WORD wMinorVerNum)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
TRACE("(%p,%d,%d)\n", iface, wMajorVerNum, wMinorVerNum); TRACE("(%p,%d,%d)\n", iface, wMajorVerNum, wMinorVerNum);
@ -3020,7 +3118,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetVersion(ICreateTypeLib2 * iface, WORD
*/ */
static HRESULT WINAPI ICreateTypeLib2_fnSetGuid(ICreateTypeLib2 * iface, REFGUID guid) static HRESULT WINAPI ICreateTypeLib2_fnSetGuid(ICreateTypeLib2 * iface, REFGUID guid)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
MSFT_GuidEntry guidentry; MSFT_GuidEntry guidentry;
int offset; int offset;
@ -3028,8 +3126,8 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetGuid(ICreateTypeLib2 * iface, REFGUID
TRACE("(%p,%s)\n", iface, debugstr_guid(guid)); TRACE("(%p,%s)\n", iface, debugstr_guid(guid));
guidentry.guid = *guid; guidentry.guid = *guid;
guidentry.unk10 = -2; guidentry.hreftype = -2;
guidentry.unk14 = -1; guidentry.next_hash = -1;
offset = ctl2_alloc_guid(This, &guidentry); offset = ctl2_alloc_guid(This, &guidentry);
@ -3047,7 +3145,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetGuid(ICreateTypeLib2 * iface, REFGUID
*/ */
static HRESULT WINAPI ICreateTypeLib2_fnSetDocString(ICreateTypeLib2 * iface, LPOLESTR szDoc) static HRESULT WINAPI ICreateTypeLib2_fnSetDocString(ICreateTypeLib2 * iface, LPOLESTR szDoc)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
int offset; int offset;
@ -3066,7 +3164,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetDocString(ICreateTypeLib2 * iface, LP
*/ */
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpFileName(ICreateTypeLib2 * iface, LPOLESTR szHelpFileName) static HRESULT WINAPI ICreateTypeLib2_fnSetHelpFileName(ICreateTypeLib2 * iface, LPOLESTR szHelpFileName)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
int offset; int offset;
@ -3097,7 +3195,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetHelpContext(ICreateTypeLib2 * iface,
*/ */
static HRESULT WINAPI ICreateTypeLib2_fnSetLcid(ICreateTypeLib2 * iface, LCID lcid) static HRESULT WINAPI ICreateTypeLib2_fnSetLcid(ICreateTypeLib2 * iface, LCID lcid)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
TRACE("(%p,%ld)\n", iface, lcid); TRACE("(%p,%ld)\n", iface, lcid);
@ -3113,7 +3211,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetLcid(ICreateTypeLib2 * iface, LCID lc
*/ */
static HRESULT WINAPI ICreateTypeLib2_fnSetLibFlags(ICreateTypeLib2 * iface, UINT uLibFlags) static HRESULT WINAPI ICreateTypeLib2_fnSetLibFlags(ICreateTypeLib2 * iface, UINT uLibFlags)
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
TRACE("(%p,0x%x)\n", iface, uLibFlags); TRACE("(%p,0x%x)\n", iface, uLibFlags);
@ -3124,14 +3222,19 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetLibFlags(ICreateTypeLib2 * iface, UIN
static int ctl2_write_chunk(HANDLE hFile, void *segment, int length) static int ctl2_write_chunk(HANDLE hFile, void *segment, int length)
{ {
if (!WriteFile(hFile, segment, length, NULL, 0)) {CloseHandle(hFile); return 0;} DWORD dwWritten;
if (!WriteFile(hFile, segment, length, &dwWritten, 0)) {
CloseHandle(hFile);
return 0;
}
return -1; return -1;
} }
static int ctl2_write_segment(ICreateTypeLib2Impl *This, HANDLE hFile, int segment) static int ctl2_write_segment(ICreateTypeLib2Impl *This, HANDLE hFile, int segment)
{ {
DWORD dwWritten;
if (!WriteFile(hFile, This->typelib_segment_data[segment], if (!WriteFile(hFile, This->typelib_segment_data[segment],
This->typelib_segdir[segment].length, NULL, 0)) { This->typelib_segdir[segment].length, &dwWritten, 0)) {
CloseHandle(hFile); CloseHandle(hFile);
return 0; return 0;
} }
@ -3184,7 +3287,7 @@ static void ctl2_write_typeinfos(ICreateTypeLib2Impl *This, HANDLE hFile)
*/ */
static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 * iface) static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 * iface)
{ {
ICOM_THIS( ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
int retval; int retval;
int filepos; int filepos;
@ -3275,7 +3378,7 @@ static HRESULT WINAPI ICreateTypeLib2_fnSetCustData(
REFGUID guid, /* [I] The GUID used as a key to retrieve the custom data. */ REFGUID guid, /* [I] The GUID used as a key to retrieve the custom data. */
VARIANT *pVarVal) /* [I] The custom data itself. */ VARIANT *pVarVal) /* [I] The custom data itself. */
{ {
ICOM_THIS(ICreateTypeLib2Impl, iface); ICreateTypeLib2Impl *This = (ICreateTypeLib2Impl *)iface;
TRACE("(%p,%s,%p)\n", iface, debugstr_guid(guid), pVarVal); TRACE("(%p,%s,%p)\n", iface, debugstr_guid(guid), pVarVal);
@ -3364,11 +3467,11 @@ static ULONG WINAPI ITypeLib2_fnRelease(ITypeLib2 * iface)
static UINT WINAPI ITypeLib2_fnGetTypeInfoCount( static UINT WINAPI ITypeLib2_fnGetTypeInfoCount(
ITypeLib2 * iface) ITypeLib2 * iface)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface);
FIXME("(%p), stub!\n", iface); TRACE("(%p)\n", iface);
return 0; return This->typelib_header.nrtypeinfos;
} }
/****************************************************************************** /******************************************************************************
@ -3381,11 +3484,15 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(
UINT index, UINT index,
ITypeInfo** ppTInfo) ITypeInfo** ppTInfo)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface);
FIXME("(%p,%d,%p), stub!\n", iface, index, ppTInfo); TRACE("(%p,%d,%p)\n", iface, index, ppTInfo);
return E_OUTOFMEMORY; if ((index < 0) || (index >= This->typelib_header.nrtypeinfos)) {
return TYPE_E_ELEMENTNOTFOUND;
}
return ctl2_find_typeinfo_from_offset(This, This->typelib_typeinfo_offsets[index], ppTInfo);
} }
/****************************************************************************** /******************************************************************************
@ -3398,11 +3505,17 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType(
UINT index, UINT index,
TYPEKIND* pTKind) TYPEKIND* pTKind)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface);
FIXME("(%p,%d,%p), stub!\n", iface, index, pTKind); TRACE("(%p,%d,%p)\n", iface, index, pTKind);
return E_OUTOFMEMORY; if ((index < 0) || (index >= This->typelib_header.nrtypeinfos)) {
return TYPE_E_ELEMENTNOTFOUND;
}
*pTKind = (This->typelib_segment_data[MSFT_SEG_TYPEINFO][This->typelib_typeinfo_offsets[index]]) & 15;
return S_OK;
} }
/****************************************************************************** /******************************************************************************
@ -3415,11 +3528,20 @@ static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid(
REFGUID guid, REFGUID guid,
ITypeInfo** ppTinfo) ITypeInfo** ppTinfo)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface);
FIXME("(%p,%s,%p), stub!\n", iface, debugstr_guid(guid), ppTinfo); int guidoffset;
int typeinfo;
return E_OUTOFMEMORY; TRACE("(%p,%s,%p)\n", iface, debugstr_guid(guid), ppTinfo);
guidoffset = ctl2_find_guid(This, ctl2_hash_guid(guid), guid);
if (guidoffset == -1) return TYPE_E_ELEMENTNOTFOUND;
typeinfo = ((MSFT_GuidEntry *)&This->typelib_segment_data[MSFT_SEG_GUID][guidoffset])->hreftype;
if (typeinfo < 0) return TYPE_E_ELEMENTNOTFOUND;
return ctl2_find_typeinfo_from_offset(This, typeinfo, ppTinfo);
} }
/****************************************************************************** /******************************************************************************
@ -3485,11 +3607,29 @@ static HRESULT WINAPI ITypeLib2_fnIsName(
ULONG lHashVal, ULONG lHashVal,
BOOL* pfName) BOOL* pfName)
{ {
/* ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface); */ ICOM_THIS_From_ITypeLib2(ICreateTypeLib2Impl, iface);
FIXME("(%p,%s,%lx,%p), stub!\n", iface, debugstr_w(szNameBuf), lHashVal, pfName); char *encoded_name;
int nameoffset;
MSFT_NameIntro *nameintro;
return E_OUTOFMEMORY; TRACE("(%p,%s,%lx,%p)\n", iface, debugstr_w(szNameBuf), lHashVal, pfName);
ctl2_encode_name(This, szNameBuf, &encoded_name);
nameoffset = ctl2_find_name(This, encoded_name);
*pfName = 0;
if (nameoffset == -1) return S_OK;
nameintro = (MSFT_NameIntro *)(&This->typelib_segment_data[MSFT_SEG_NAME][nameoffset]);
if (nameintro->hreftype == -1) return S_OK;
*pfName = 1;
FIXME("Should be decoding our copy of the name over szNameBuf.\n");
return S_OK;
} }
/****************************************************************************** /******************************************************************************
@ -3620,9 +3760,8 @@ static HRESULT WINAPI ITypeLib2_fnGetAllCustData(
/*================== ICreateTypeLib2 & ITypeLib2 VTABLEs And Creation ===================================*/ /*================== ICreateTypeLib2 & ITypeLib2 VTABLEs And Creation ===================================*/
static ICOM_VTABLE(ICreateTypeLib2) ctypelib2vt = static ICreateTypeLib2Vtbl ctypelib2vt =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ICreateTypeLib2_fnQueryInterface, ICreateTypeLib2_fnQueryInterface,
ICreateTypeLib2_fnAddRef, ICreateTypeLib2_fnAddRef,
@ -3645,9 +3784,8 @@ static ICOM_VTABLE(ICreateTypeLib2) ctypelib2vt =
ICreateTypeLib2_fnSetHelpStringDll ICreateTypeLib2_fnSetHelpStringDll
}; };
static ICOM_VTABLE(ITypeLib2) typelib2vt = static ITypeLib2Vtbl typelib2vt =
{ {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ITypeLib2_fnQueryInterface, ITypeLib2_fnQueryInterface,
ITypeLib2_fnAddRef, ITypeLib2_fnAddRef,
@ -3742,3 +3880,33 @@ HRESULT WINAPI CreateTypeLib2(
*ppctlib = ICreateTypeLib2_Constructor(syskind, szFile); *ppctlib = ICreateTypeLib2_Constructor(syskind, szFile);
return (*ppctlib)? S_OK: E_OUTOFMEMORY; return (*ppctlib)? S_OK: E_OUTOFMEMORY;
} }
/******************************************************************************
* ClearCustData (OLEAUT32.171)
*
* Clear a custom data types' data.
*
* PARAMS
* lpCust [I] The custom data type instance
*
* RETURNS
* Nothing.
*/
void WINAPI ClearCustData(LPCUSTDATA lpCust)
{
if (lpCust && lpCust->cCustData)
{
if (lpCust->prgCustData)
{
DWORD i;
for (i = 0; i < lpCust->cCustData; i++)
VariantClear(&lpCust->prgCustData[i].varValue);
/* FIXME - Should be using a per-thread IMalloc */
HeapFree(GetProcessHeap(), 0, lpCust->prgCustData);
lpCust->prgCustData = NULL;
}
lpCust->cCustData = 0;
}
}

View file

@ -82,3 +82,8 @@ DEFINE_GUID(IID_IDPLobbySP,0x5a4e5a20,0x2ced,0x11d0,0xa8,0x89,0x00,0xa0,0xc9,0x0
DEFINE_GUID(FMTID_SummaryInformation,0xF29F85E0,0x4FF9,0x1068,0xAB,0x91,0x08,0x00,0x2B,0x27,0xB3,0xD9); DEFINE_GUID(FMTID_SummaryInformation,0xF29F85E0,0x4FF9,0x1068,0xAB,0x91,0x08,0x00,0x2B,0x27,0xB3,0xD9);
DEFINE_GUID(FMTID_DocSummaryInformation,0xD5CDD502,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE); DEFINE_GUID(FMTID_DocSummaryInformation,0xD5CDD502,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE);
DEFINE_GUID(FMTID_UserDefinedProperties,0xD5CDD505,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE); DEFINE_GUID(FMTID_UserDefinedProperties,0xD5CDD505,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE);
DEFINE_OLEGUID(IID_StdOle,0x00020430,0,0);
DEFINE_GUID(CLSID_StdFont,0x0be35203,0x8f91,0x11ce,0x9d,0xe3,0x00,0xaa,0x00,0x4b,0xb8,0x51);
DEFINE_GUID(CLSID_StdPicture,0x0be35204,0x8f91,0x11ce,0x9d,0xe3,0x00,0xaa,0x00,0x4b,0xb8,0x51);

View file

@ -424,7 +424,8 @@ typedef enum tagTYPEFLAGS {
TYPEFLAG_FDUAL=64,TYPEFLAG_FNONEXTENSIBLE=128, TYPEFLAG_FDUAL=64,TYPEFLAG_FNONEXTENSIBLE=128,
TYPEFLAG_FOLEAUTOMATION=256,TYPEFLAG_FRESTRICTED=512, TYPEFLAG_FOLEAUTOMATION=256,TYPEFLAG_FRESTRICTED=512,
TYPEFLAG_FAGGREGATABLE=1024,TYPEFLAG_FREPLACEABLE=2048, TYPEFLAG_FAGGREGATABLE=1024,TYPEFLAG_FREPLACEABLE=2048,
TYPEFLAG_FDISPATCHABLE=4096,TYPEFLAG_FREVERSEBIND=8192 TYPEFLAG_FDISPATCHABLE=4096,TYPEFLAG_FREVERSEBIND=8192,
TYPEFLAG_FPROXY=16384
} TYPEFLAGS; } TYPEFLAGS;
typedef enum tagFUNCFLAGS { typedef enum tagFUNCFLAGS {
FUNCFLAG_FRESTRICTED=1,FUNCFLAG_FSOURCE=2,FUNCFLAG_FBINDABLE=4, FUNCFLAG_FRESTRICTED=1,FUNCFLAG_FSOURCE=2,FUNCFLAG_FBINDABLE=4,
@ -502,6 +503,16 @@ DECLARE_INTERFACE_(IEnumVARIANT,IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define IEnumVARIANT_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IEnumVARIANT_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IEnumVARIANT_Release(p) (p)->lpVtbl->Release(p)
#define IEnumVARIANT_Next(p,a,b,c) (p)->lpVtbl->Next(p,a,b,c)
#define IEnumVARIANT_Skip(p,a) (p)->lpVtbl->Skip(p,a)
#define IEnumVARIANT_Reset(p) (p)->lpVtbl->Reset(p)
#define IEnumVARIANT_Clone(p,a) (p)->lpVtbl->Clone(p,a)
#endif
#define INTERFACE ITypeComp #define INTERFACE ITypeComp
DECLARE_INTERFACE_(ITypeComp,IUnknown) DECLARE_INTERFACE_(ITypeComp,IUnknown)
{ {
@ -513,6 +524,14 @@ DECLARE_INTERFACE_(ITypeComp,IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define ITypeComp_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITypeComp_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITypeComp_Release(p) (p)->lpVtbl->Release(p)
#define ITypeComp_Bind(p,a,b,c,d,e,f) (p)->lpVtbl->Bind(p,a,b,c,d,e,f)
#define ITypeComp_BindType(p,a,b,c,d) (p)->lpVtbl->BindType(p,a,b,c,d)
#endif
#define INTERFACE ITypeInfo #define INTERFACE ITypeInfo
DECLARE_INTERFACE_(ITypeInfo,IUnknown) DECLARE_INTERFACE_(ITypeInfo,IUnknown)
{ {
@ -609,6 +628,46 @@ DECLARE_INTERFACE_(ITypeInfo2,ITypeInfo)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define ITypeInfo2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITypeInfo2_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITypeInfo2_Release(p) (p)->lpVtbl->Release(p)
#define ITypeInfo2_GetTypeAttr(p,a) (p)->lpVtbl->GetTypeAttr(p,a)
#define ITypeInfo2_GetTypeComp(p,a) (p)->lpVtbl->GetTypeComp(p,a)
#define ITypeInfo2_GetFuncDesc(p,a,b) (p)->lpVtbl->GetFuncDesc(p,a,b)
#define ITypeInfo2_GetVarDesc(p,a,b) (p)->lpVtbl->GetVarDesc(p,a,b)
#define ITypeInfo2_GetNames(p,a,b,c,d) (p)->lpVtbl->GetNames(p,a,b,c,d)
#define ITypeInfo2_GetRefTypeOfImplType(p,a,b) (p)->lpVtbl->GetRefTypeOfImplType(p,a,b)
#define ITypeInfo2_GetImplTypeFlags(p,a,b) (p)->lpVtbl->GetImplTypeFlags(p,a,b)
#define ITypeInfo2_GetIDsOfNames(p,a,b,c) (p)->lpVtbl->GetIDsOfNames(p,a,b,c)
#define ITypeInfo2_Invoke(p,a,b,c,d,e,f,g) (p)->lpVtbl->Invoke(p,a,b,c,d,e,f,g)
#define ITypeInfo2_GetDocumentation(p,a,b,c,d,e) (p)->lpVtbl->GetDocumentation(p,a,b,c,d,e)
#define ITypeInfo2_GetDllEntry(p,a,b,c,d,e) (p)->lpVtbl->GetDllEntry(p,a,b,c,d,e)
#define ITypeInfo2_GetRefTypeInfo(p,a,b) (p)->lpVtbl->GetRefTypeInfo(p,a,b)
#define ITypeInfo2_AddressOfMember(p,a,b,c) (p)->lpVtbl->AddressOfMember(p,a,b,c)
#define ITypeInfo2_CreateInstance(p,a,b,c) (p)->lpVtbl->CreateInstance(p,a,b,c)
#define ITypeInfo2_GetMops(p,a,b) (p)->lpVtbl->GetMops(p,a,b)
#define ITypeInfo2_GetContainingTypeLib(p,a,b) (p)->lpVtbl->GetContainingTypeLib(p,a,b)
#define ITypeInfo2_ReleaseTypeAttr(p,a) (p)->lpVtbl->ReleaseTypeAttr(p,a)
#define ITypeInfo2_ReleaseFuncDesc(p,a) (p)->lpVtbl->ReleaseFuncDesc(p,a)
#define ITypeInfo2_ReleaseVarDesc(p,a) (p)->lpVtbl->ReleaseVarDesc(p,a)
#define ITypeInfo2_GetTypeKind(p,a) (p)->lpVtbl->GetTypeKind(p,a)
#define ITypeInfo2_GetTypeFlags(p,a) (p)->lpVtbl->GetTypeFlags(p,a)
#define ITypeInfo2_GetFuncIndexOfMemId(p,a,b,c) (p)->lpVtbl->GetFuncIndexOfMemId(p,a,b,c)
#define ITypeInfo2_GetVarIndexOfMemId(p,a,b) (p)->lpVtbl->GetVarIndexOfMemId(p,a,b)
#define ITypeInfo2_GetCustData(p,a,b) (p)->lpVtbl->GetCustData(p,a,b)
#define ITypeInfo2_GetFuncCustData(p,a,b,c) (p)->lpVtbl->GetFuncCustData(p,a,b,c)
#define ITypeInfo2_GetParamCustData(p,a,b,c,d) (p)->lpVtbl->GetParamCustData(p,a,b,c,d)
#define ITypeInfo2_GetVarCustData(p,a,b,c) (p)->lpVtbl->GetVarCustData(p,a,b,c)
#define ITypeInfo2_GetImplTypeCustData(p,a,b,c) (p)->lpVtbl->GetImplTypeCustData(p,a,b,c)
#define ITypeInfo2_GetDocumentation2(p,a,b,c,d,e) (p)->lpVtbl->GetDocumentation2(p,a,b,c,d,e)
#define ITypeInfo2_GetAllCustData(p,a) (p)->lpVtbl->GetAllCustData(p,a)
#define ITypeInfo2_GetAllFuncCustData(p,a,b) (p)->lpVtbl->GetAllFuncCustData(p,a,b)
#define ITypeInfo2_GetAllParamCustData(p,a,b,c) (p)->lpVtbl->GetAllParamCustData(p,a,b,c)
#define ITypeInfo2_GetAllVarCustData(p,a,b) (p)->lpVtbl->GetAllVarCustData(p,a,b)
#define ITypeInfo2_GetAllImplTypeCustData(p,a,b) (p)->lpVtbl->GetAllImplTypeCustData(p,a,b)
#endif
#define INTERFACE ITypeLib #define INTERFACE ITypeLib
DECLARE_INTERFACE_(ITypeLib,IUnknown) DECLARE_INTERFACE_(ITypeLib,IUnknown)
{ {
@ -620,7 +679,7 @@ DECLARE_INTERFACE_(ITypeLib,IUnknown)
STDMETHOD(GetTypeInfoType)(THIS_ UINT,TYPEKIND*) PURE; STDMETHOD(GetTypeInfoType)(THIS_ UINT,TYPEKIND*) PURE;
STDMETHOD(GetTypeInfoOfGuid)(THIS_ REFGUID,ITypeInfo**) PURE; STDMETHOD(GetTypeInfoOfGuid)(THIS_ REFGUID,ITypeInfo**) PURE;
STDMETHOD(GetLibAttr)(THIS_ TLIBATTR**) PURE; STDMETHOD(GetLibAttr)(THIS_ TLIBATTR**) PURE;
STDMETHOD(GetTypeComp)(THIS_ ITypeComp*) PURE; STDMETHOD(GetTypeComp)(THIS_ LPTYPECOMP*) PURE;
STDMETHOD(GetDocumentation)(THIS_ INT,BSTR*,BSTR*,DWORD*,BSTR*) PURE; STDMETHOD(GetDocumentation)(THIS_ INT,BSTR*,BSTR*,DWORD*,BSTR*) PURE;
STDMETHOD(IsName)(THIS_ LPOLESTR,ULONG,BOOL*) PURE; STDMETHOD(IsName)(THIS_ LPOLESTR,ULONG,BOOL*) PURE;
STDMETHOD(FindName)(THIS_ LPOLESTR,ULONG,ITypeInfo**,MEMBERID*,USHORT*) PURE; STDMETHOD(FindName)(THIS_ LPOLESTR,ULONG,ITypeInfo**,MEMBERID*,USHORT*) PURE;
@ -628,6 +687,22 @@ DECLARE_INTERFACE_(ITypeLib,IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define ITypeLib_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITypeLib_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITypeLib_Release(p) (p)->lpVtbl->Release(p)
#define ITypeLib_GetTypeInfoCount(p) (p)->lpVtbl->GetTypeInfoCount(p)
#define ITypeLib_GetTypeInfo(p,a,b) (p)->lpVtbl->GetTypeInfo(p,a,b)
#define ITypeLib_GetTypeInfoType(p,a,b) (p)->lpVtbl->GetTypeInfoType(p,a,b)
#define ITypeLib_GetTypeInfoOfGuid(p,a,b) (p)->lpVtbl->GetTypeInfoOfGuid(p,a,b)
#define ITypeLib_GetLibAttr(p,a) (p)->lpVtbl->GetLibAttr(p,a)
#define ITypeLib_GetTypeComp(p,a) (p)->lpVtbl->GetTypeComp(p,a)
#define ITypeLib_GetDocumentation(p,a,b,c,d,e) (p)->lpVtbl->GetDocumentation(p,a,b,c,d,e)
#define ITypeLib_IsName(p,a,b,c) (p)->lpVtbl->IsName(p,a,b,c)
#define ITypeLib_FindName(p,a,b,c,d,e) (p)->lpVtbl->FindName(p,a,b,c,d,e)
#define ITypeLib_ReleaseTLibAttr(p,a) (p)->lpVtbl->ReleaseTLibAttr(p,a)
#endif
#define INTERFACE ITypeLib2 #define INTERFACE ITypeLib2
DECLARE_INTERFACE_(ITypeLib2,ITypeLib) DECLARE_INTERFACE_(ITypeLib2,ITypeLib)
{ {
@ -639,7 +714,7 @@ DECLARE_INTERFACE_(ITypeLib2,ITypeLib)
STDMETHOD(GetTypeInfoType)(THIS_ UINT,TYPEKIND*) PURE; STDMETHOD(GetTypeInfoType)(THIS_ UINT,TYPEKIND*) PURE;
STDMETHOD(GetTypeInfoOfGuid)(THIS_ REFGUID,ITypeInfo**) PURE; STDMETHOD(GetTypeInfoOfGuid)(THIS_ REFGUID,ITypeInfo**) PURE;
STDMETHOD(GetLibAttr)(THIS_ TLIBATTR**) PURE; STDMETHOD(GetLibAttr)(THIS_ TLIBATTR**) PURE;
STDMETHOD(GetTypeComp)(THIS_ ITypeComp*) PURE; STDMETHOD(GetTypeComp)(THIS_ LPTYPECOMP*) PURE;
STDMETHOD(GetDocumentation)(THIS_ INT,BSTR*,BSTR*,DWORD*,BSTR*) PURE; STDMETHOD(GetDocumentation)(THIS_ INT,BSTR*,BSTR*,DWORD*,BSTR*) PURE;
STDMETHOD(IsName)(THIS_ LPOLESTR,ULONG,BOOL*) PURE; STDMETHOD(IsName)(THIS_ LPOLESTR,ULONG,BOOL*) PURE;
STDMETHOD(FindName)(THIS_ LPOLESTR,ULONG,ITypeInfo**,MEMBERID*,USHORT*) PURE; STDMETHOD(FindName)(THIS_ LPOLESTR,ULONG,ITypeInfo**,MEMBERID*,USHORT*) PURE;
@ -651,6 +726,274 @@ DECLARE_INTERFACE_(ITypeLib2,ITypeLib)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define ITypeLib2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITypeLib2_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITypeLib2_Release(p) (p)->lpVtbl->Release(p)
#define ITypeLib2_GetTypeInfoCount(p) (p)->lpVtbl->GetTypeInfoCount(p)
#define ITypeLib2_GetTypeInfo(p,a,b) (p)->lpVtbl->GetTypeInfo(p,a,b)
#define ITypeLib2_GetTypeInfoType(p,a,b) (p)->lpVtbl->GetTypeInfoType(p,a,b)
#define ITypeLib2_GetTypeInfoOfGuid(p,a,b) (p)->lpVtbl->GetTypeInfoOfGuid(p,a,b)
#define ITypeLib2_GetLibAttr(p,a) (p)->lpVtbl->GetLibAttr(p,a)
#define ITypeLib2_GetTypeComp(p,a) (p)->lpVtbl->GetTypeComp(p,a)
#define ITypeLib2_GetDocumentation(p,a,b,c,d,e) (p)->lpVtbl->GetDocumentation(p,a,b,c,d,e)
#define ITypeLib2_IsName(p,a,b,c) (p)->lpVtbl->IsName(p,a,b,c)
#define ITypeLib2_FindName(p,a,b,c,d,e) (p)->lpVtbl->FindName(p,a,b,c,d,e)
#define ITypeLib2_ReleaseTLibAttr(p,a) (p)->lpVtbl->ReleaseTLibAttr(p,a)
#define ITypeLib2_GetCustData(p,a,b) (p)->lpVtbl->GetCustData(p,a,b)
#define ITypeLib2_GetLibStatistics(p,a,b) (p)->lpVtbl->GetLibStatistics(p,a,b)
#define ITypeLib2_GetDocumentation2(p,a,b,c,d,e) (p)->lpVtbl->GetDocumentation2(p,a,b,c,d,e)
#define ITypeLib2_GetAllCustData(p,a) (p)->lpVtbl->GetAllCustData(p,a)
#endif
#define INTERFACE ITypeFactory
DECLARE_INTERFACE_(ITypeFactory,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(GetAllCustData)(THIS_ CUSTDATA*) PURE;
STDMETHOD(CreateFromTypeInfo)(THIS_ LPTYPEINFO,REFIID,LPUNKNOWN*);
};
#undef INTERFACE
#ifdef COBJMACROS
#define ITypeFactory_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITypeFactory_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITypeFactory_Release(p) (p)->lpVtbl->Release(p)
#define ITypeFactory_CreateFromTypeInfo(p,a,b,c) (p)->lpVtbl->CreateFromTypeInfo(p,a,b,c)
#endif
#define INTERFACE ICreateTypeInfo
DECLARE_INTERFACE_(ICreateTypeInfo,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(SetGuid)(THIS_ REFGUID) PURE;
STDMETHOD(SetTypeFlags)(THIS_ UINT) PURE;
STDMETHOD(SetDocString)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetHelpContext)(THIS_ DWORD) PURE;
STDMETHOD(SetVersion)(THIS_ WORD,WORD) PURE;
STDMETHOD(AddRefTypeInfo)(THIS_ ITypeInfo*,HREFTYPE*) PURE;
STDMETHOD(AddFuncDesc)(THIS_ UINT,FUNCDESC*) PURE;
STDMETHOD(AddImplType)(THIS_ UINT,HREFTYPE) PURE;
STDMETHOD(SetImplTypeFlags)(THIS_ UINT,INT) PURE;
STDMETHOD(SetAlignment)(THIS_ WORD) PURE;
STDMETHOD(SetSchema)(THIS_ LPOLESTR) PURE;
STDMETHOD(AddVarDesc)(THIS_ UINT,VARDESC*) PURE;
STDMETHOD(SetFuncAndParamNames)(THIS_ UINT,LPOLESTR*,UINT) PURE;
STDMETHOD(SetVarName)(THIS_ UINT,LPOLESTR) PURE;
STDMETHOD(SetTypeDescAlias)(THIS_ TYPEDESC*) PURE;
STDMETHOD(DefineFuncAsDllEntry)(THIS_ UINT,LPOLESTR,LPOLESTR) PURE;
STDMETHOD(SetFuncDocString)(THIS_ UINT,LPOLESTR) PURE;
STDMETHOD(SetVarDocString)(THIS_ UINT,LPOLESTR) PURE;
STDMETHOD(SetFuncHelpContext)(THIS_ UINT,DWORD) PURE;
STDMETHOD(SetVarHelpContext)(THIS_ UINT,DWORD) PURE;
STDMETHOD(SetMops)(THIS_ UINT,BSTR) PURE;
STDMETHOD(SetTypeIdldesc)(THIS_ IDLDESC*) PURE;
STDMETHOD(LayOut)(THIS) PURE;
};
#undef INTERFACE
#ifdef COBJMACROS
#define ICreateTypeInfo_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ICreateTypeInfo_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ICreateTypeInfo_Release(p) (p)->lpVtbl->Release(p)
#define ICreateTypeInfo_SetGuid(p,a) (p)->lpVtbl->SetGuid(p,a)
#define ICreateTypeInfo_SetTypeFlags(p,a) (p)->lpVtbl->SetTypeFlags(p,a)
#define ICreateTypeInfo_SetDocString(p,a) (p)->lpVtbl->SetDocString(p,a)
#define ICreateTypeInfo_SetHelpContext(p,a) (p)->lpVtbl->SetHelpContext(p,a)
#define ICreateTypeInfo_SetVersion(p,a,b) (p)->lpVtbl->SetVersion(p,a,b)
#define ICreateTypeInfo_AddRefTypeInfo(p,a,b) (p)->lpVtbl->AddRefTypeInfo(p,a,b)
#define ICreateTypeInfo_AddFuncDesc(p,a,b) (p)->lpVtbl->AddFuncDesc(p,a,b)
#define ICreateTypeInfo_AddImplType(p,a,b) (p)->lpVtbl->AddImplType(p,a,b)
#define ICreateTypeInfo_SetImplTypeFlags(p,a,b) (p)->lpVtbl->SetImplTypeFlags(p,a,b)
#define ICreateTypeInfo_SetAlignment(p,a) (p)->lpVtbl->SetAlignment(p,a)
#define ICreateTypeInfo_SetSchema(p,a) (p)->lpVtbl->SetSchema(p,a)
#define ICreateTypeInfo_AddVarDesc(p,a,b) (p)->lpVtbl->AddVarDesc(p,a,b)
#define ICreateTypeInfo_SetFuncAndParamNames(p,a,b,c) (p)->lpVtbl->SetFuncAndParamNames(p,a,b,c)
#define ICreateTypeInfo_SetVarName(p,a,b) (p)->lpVtbl->SetVarName(p,a,b)
#define ICreateTypeInfo_SetTypeDescAlias(p,a) (p)->lpVtbl->SetTypeDescAlias(p,a)
#define ICreateTypeInfo_DefineFuncAsDllEntry(p,a,b,c) (p)->lpVtbl->DefineFuncAsDllEntry(p,a,b,c)
#define ICreateTypeInfo_SetFuncDocString(p,a,b) (p)->lpVtbl->SetFuncDocString(p,a,b)
#define ICreateTypeInfo_SetVarDocString(p,a,b) (p)->lpVtbl->SetVarDocString(p,a,b)
#define ICreateTypeInfo_SetFuncHelpContext(p,a,b) (p)->lpVtbl->SetFuncHelpContext(p,a,b)
#define ICreateTypeInfo_SetVarHelpContext(p,a,b) (p)->lpVtbl->SetVarHelpContext(p,a,b)
#define ICreateTypeInfo_SetMops(p,a,b) (p)->lpVtbl->SetMops(p,a,b)
#define ICreateTypeInfo_SetTypeIdldesc(p,a) (p)->lpVtbl->SetTypeIdldesc(p,a)
#define ICreateTypeInfo_LayOut(p) (p)->lpVtbl->LayOut(p)
#endif
#define INTERFACE ICreateTypeInfo2
DECLARE_INTERFACE_(ICreateTypeInfo2,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(SetGuid)(THIS_ REFGUID) PURE;
STDMETHOD(SetTypeFlags)(THIS_ UINT) PURE;
STDMETHOD(SetDocString)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetHelpContext)(THIS_ DWORD) PURE;
STDMETHOD(SetVersion)(THIS_ WORD,WORD) PURE;
STDMETHOD(AddRefTypeInfo)(THIS_ ITypeInfo*,HREFTYPE*) PURE;
STDMETHOD(AddFuncDesc)(THIS_ UINT,FUNCDESC*) PURE;
STDMETHOD(AddImplType)(THIS_ UINT,HREFTYPE) PURE;
STDMETHOD(SetImplTypeFlags)(THIS_ UINT,INT) PURE;
STDMETHOD(SetAlignment)(THIS_ WORD) PURE;
STDMETHOD(SetSchema)(THIS_ LPOLESTR) PURE;
STDMETHOD(AddVarDesc)(THIS_ UINT,VARDESC*) PURE;
STDMETHOD(SetFuncAndParamNames)(THIS_ UINT,LPOLESTR*,UINT) PURE;
STDMETHOD(SetVarName)(THIS_ UINT,LPOLESTR) PURE;
STDMETHOD(SetTypeDescAlias)(THIS_ TYPEDESC*) PURE;
STDMETHOD(DefineFuncAsDllEntry)(THIS_ UINT,LPOLESTR,LPOLESTR) PURE;
STDMETHOD(SetFuncDocString)(THIS_ UINT,LPOLESTR) PURE;
STDMETHOD(SetVarDocString)(THIS_ UINT,LPOLESTR) PURE;
STDMETHOD(SetFuncHelpContext)(THIS_ UINT,DWORD) PURE;
STDMETHOD(SetVarHelpContext)(THIS_ UINT,DWORD) PURE;
STDMETHOD(SetMops)(THIS_ UINT,BSTR) PURE;
STDMETHOD(SetTypeIdldesc)(THIS_ IDLDESC*) PURE;
STDMETHOD(LayOut)(THIS) PURE;
STDMETHOD(DeleteFuncDesc)(THIS_ UINT) PURE;
STDMETHOD(DeleteFuncDescByMemId)(THIS_ MEMBERID, INVOKEKIND) PURE;
STDMETHOD(DeleteVarDesc)(THIS_ UINT) PURE;
STDMETHOD(DeleteVarDescByMemId)(THIS_ MEMBERID) PURE;
STDMETHOD(DeleteImplType)(THIS_ UINT) PURE;
STDMETHOD(SetCustData)(THIS_ REFGUID, VARIANT*) PURE;
STDMETHOD(SetFuncCustData)(THIS_ UINT, REFGUID, VARIANT*) PURE;
STDMETHOD(SetParamCustData)(THIS_ UINT, UINT, REFGUID, VARIANT*) PURE;
STDMETHOD(SetVarCustData)(THIS_ UINT, REFGUID, VARIANT*) PURE;
STDMETHOD(SetImplTypeCustData)(THIS_ UINT, REFGUID, VARIANT*) PURE;
STDMETHOD(SetHelpStringContext)(THIS_ ULONG) PURE;
STDMETHOD(SetFuncHelpStringContext)(THIS_ UINT, ULONG) PURE;
STDMETHOD(SetVarHelpStringContext)(THIS_ UINT, ULONG) PURE;
STDMETHOD(Invalidate)(THIS) PURE;
STDMETHOD(SetName)(THIS_ LPOLESTR) PURE;
};
#undef INTERFACE
#ifdef COBJMACROS
#define ICreateTypeInfo2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ICreateTypeInfo2_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ICreateTypeInfo2_Release(p) (p)->lpVtbl->Release(p)
#define ICreateTypeInfo2_SetGuid(p,a) (p)->lpVtbl->SetGuid(p,a)
#define ICreateTypeInfo2_SetTypeFlags(p,a) (p)->lpVtbl->SetTypeFlags(p,a)
#define ICreateTypeInfo2_SetDocString(p,a) (p)->lpVtbl->SetDocString(p,a)
#define ICreateTypeInfo2_SetHelpContext(p,a) (p)->lpVtbl->SetHelpContext(p,a)
#define ICreateTypeInfo2_SetVersion(p,a,b) (p)->lpVtbl->SetVersion(p,a,b)
#define ICreateTypeInfo2_AddRefTypeInfo(p,a,b) (p)->lpVtbl->AddRefTypeInfo(p,a,b)
#define ICreateTypeInfo2_AddFuncDesc(p,a,b) (p)->lpVtbl->AddFuncDesc(p,a,b)
#define ICreateTypeInfo2_AddImplType(p,a,b) (p)->lpVtbl->AddImplType(p,a,b)
#define ICreateTypeInfo2_SetImplTypeFlags(p,a,b) (p)->lpVtbl->SetImplTypeFlags(p,a,b)
#define ICreateTypeInfo2_SetAlignment(p,a) (p)->lpVtbl->SetAlignment(p,a)
#define ICreateTypeInfo2_SetSchema(p,a) (p)->lpVtbl->SetSchema(p,a)
#define ICreateTypeInfo2_AddVarDesc(p,a,b) (p)->lpVtbl->AddVarDesc(p,a,b)
#define ICreateTypeInfo2_SetFuncAndParamNames(p,a,b,c) (p)->lpVtbl->SetFuncAndParamNames(p,a,b,c)
#define ICreateTypeInfo2_SetVarName(p,a,b) (p)->lpVtbl->SetVarName(p,a,b)
#define ICreateTypeInfo2_SetTypeDescAlias(p,a) (p)->lpVtbl->SetTypeDescAlias(p,a)
#define ICreateTypeInfo2_DefineFuncAsDllEntry(p,a,b,c) (p)->lpVtbl->DefineFuncAsDllEntry(p,a,b,c)
#define ICreateTypeInfo2_SetFuncDocString(p,a,b) (p)->lpVtbl->SetFuncDocString(p,a,b)
#define ICreateTypeInfo2_SetVarDocString(p,a,b) (p)->lpVtbl->SetVarDocString(p,a,b)
#define ICreateTypeInfo2_SetFuncHelpContext(p,a,b) (p)->lpVtbl->SetFuncHelpContext(p,a,b)
#define ICreateTypeInfo2_SetVarHelpContext(p,a,b) (p)->lpVtbl->SetVarHelpContext(p,a,b)
#define ICreateTypeInfo2_SetMops(p,a,b) (p)->lpVtbl->SetMops(p,a,b)
#define ICreateTypeInfo2_SetTypeIdldesc(p,a) (p)->lpVtbl->SetTypeIdldesc(p,a)
#define ICreateTypeInfo2_LayOut(p) (p)->lpVtbl->LayOut(p)
#define ICreateTypeInfo2_DeleteFuncDesc(p,a) (p)->lpVtbl->DeleteFuncDesc(p,a)
#define ICreateTypeInfo2_DeleteFuncDescByMemId(p,a,b) (p)->lpVtbl->DeleteFuncDescByMemId(p,a,b)
#define ICreateTypeInfo2_DeleteVarDesc(p,a) (p)->lpVtbl->DeleteVarDesc(p,a)
#define ICreateTypeInfo2_DeleteVarDescByMemId(p,a) (p)->lpVtbl->DeleteVarDescByMemId(p,a)
#define ICreateTypeInfo2_DeleteImplType(p,a) (p)->lpVtbl->DeleteImplType(p,a)
#define ICreateTypeInfo2_SetCustData(p,a,b) (p)->lpVtbl->SetCustData(p,a,b)
#define ICreateTypeInfo2_SetFuncCustData(p,a,b,c) (p)->lpVtbl->SetFuncCustData(p,a,b,c)
#define ICreateTypeInfo2_SetParamCustData(p,a,b,c,d) (p)->lpVtbl->SetParamCustData(p,a,b,c,d)
#define ICreateTypeInfo2_SetVarCustData(p,a,b,c) (p)->lpVtbl->SetVarCustData(p,a,b,c)
#define ICreateTypeInfo2_SetImplTypeCustData(p,a,b,c) (p)->lpVtbl->SetImplTypeCustData(p,a,b,c)
#define ICreateTypeInfo2_SetHelpStringContext(p,a) (p)->lpVtbl->SetHelpStringContext(p,a)
#define ICreateTypeInfo2_SetFuncHelpStringContext(p,a,b) (p)->lpVtbl->SetFuncHelpStringContext(p,a,b)
#define ICreateTypeInfo2_SetVarHelpStringContext(p,a,b) (p)->lpVtbl->SetVarHelpStringContext(p,a,b)
#define ICreateTypeInfo2_Invalidate(p) (p)->lpVtbl->Invalidate(p)
#define ICreateTypeInfo2_SetName(p,a) (p)->lpVtbl->SetName(p,a)
#endif
#define INTERFACE ICreateTypeLib
DECLARE_INTERFACE_(ICreateTypeLib,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(CreateTypeInfo)(THIS_ LPOLESTR,TYPEKIND,ICreateTypeInfo**) PURE;
STDMETHOD(SetName)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetVersion)(THIS_ WORD,WORD) PURE;
STDMETHOD(SetGuid)(THIS_ REFGUID) PURE;
STDMETHOD(SetDocString)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetHelpFileName)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetHelpContext)(THIS_ DWORD) PURE;
STDMETHOD(SetLcid)(THIS_ LCID) PURE;
STDMETHOD(SetLibFlags)(THIS_ UINT) PURE;
STDMETHOD(SaveAllChanges)(THIS) PURE;
};
#undef INTERFACE
#ifdef COBJMACROS
#define ICreateTypeLib_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ICreateTypeLib_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ICreateTypeLib_Release(p) (p)->lpVtbl->Release(p)
#define ICreateTypeLib_CreateTypeInfo(p,a,b,c) (p)->lpVtbl->CreateTypeInfo(p,a,b,c)
#define ICreateTypeLib_SetName(p,a) (p)->lpVtbl->SetName(p,a)
#define ICreateTypeLib_SetVersion(p,a,b) (p)->lpVtbl->SetVersion(p,a,b)
#define ICreateTypeLib_SetGuid(p,a) (p)->lpVtbl->SetGuid(p,a)
#define ICreateTypeLib_SetDocString(p,a) (p)->lpVtbl->SetDocString(p,a)
#define ICreateTypeLib_SetHelpFileName(p,a) (p)->lpVtbl->SetHelpFileName(p,a)
#define ICreateTypeLib_SetHelpContext(p,a) (p)->lpVtbl->SetHelpContext(p,a)
#define ICreateTypeLib_SetLcid(p,a) (p)->lpVtbl->SetLcid(p,a)
#define ICreateTypeLib_SetLibFlags(p,a) (p)->lpVtbl->SetLibFlags(p,a)
#define ICreateTypeLib_SaveAllChanges(p) (p)->lpVtbl->SaveAllChanges(p)
#endif
#define INTERFACE ICreateTypeLib2
DECLARE_INTERFACE_(ICreateTypeLib2,IUnknown)
{
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(CreateTypeInfo)(THIS_ LPOLESTR,TYPEKIND,ICreateTypeInfo**) PURE;
STDMETHOD(SetName)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetVersion)(THIS_ WORD,WORD) PURE;
STDMETHOD(SetGuid)(THIS_ REFGUID) PURE;
STDMETHOD(SetDocString)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetHelpFileName)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetHelpContext)(THIS_ DWORD) PURE;
STDMETHOD(SetLcid)(THIS_ LCID) PURE;
STDMETHOD(SetLibFlags)(THIS_ UINT) PURE;
STDMETHOD(SaveAllChanges)(THIS) PURE;
STDMETHOD(DeleteTypeInfo)(THIS_ LPOLESTR) PURE;
STDMETHOD(SetCustData)(THIS_ REFGUID, VARIANT*) PURE;
STDMETHOD(SetHelpStringContext)(THIS_ ULONG) PURE;
STDMETHOD(SetHelpStringDll)(THIS_ LPOLESTR) PURE;
};
#undef INTERFACE
#ifdef COBJMACROS
#define ICreateTypeLib2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ICreateTypeLib2_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ICreateTypeLib2_Release(p) (p)->lpVtbl->Release(p)
#define ICreateTypeLib2_CreateTypeInfo(p,a,b,c) (p)->lpVtbl->CreateTypeInfo(p,a,b,c)
#define ICreateTypeLib2_SetName(p,a) (p)->lpVtbl->SetName(p,a)
#define ICreateTypeLib2_SetVersion(p,a,b) (p)->lpVtbl->SetVersion(p,a,b)
#define ICreateTypeLib2_SetGuid(p,a) (p)->lpVtbl->SetGuid(p,a)
#define ICreateTypeLib2_SetDocString(p,a) (p)->lpVtbl->SetDocString(p,a)
#define ICreateTypeLib2_SetHelpFileName(p,a) (p)->lpVtbl->SetHelpFileName(p,a)
#define ICreateTypeLib2_SetHelpContext(p,a) (p)->lpVtbl->SetHelpContext(p,a)
#define ICreateTypeLib2_SetLcid(p,a) (p)->lpVtbl->SetLcid(p,a)
#define ICreateTypeLib2_SetLibFlags(p,a) (p)->lpVtbl->SetLibFlags(p,a)
#define ICreateTypeLib2_SaveAllChanges(p) (p)->lpVtbl->SaveAllChanges(p)
#define ICreateTypeLib2_DeleteTypeInfo(p,a) (p)->lpVtbl->DeleteTypeInfo(p,a)
#define ICreateTypeLib2_SetCustData(p,a,b) (p)->lpVtbl->SetCustData(p,a,b)
#define ICreateTypeLib2_SetHelpStringContext(p,a) (p)->lpVtbl->SetHelpStringContext(p,a)
#define ICreateTypeLib2_SetHelpStringDll(p,a) (p)->lpVtbl->SetHelpStringDll(p,a)
#endif
EXTERN_C const IID IID_IErrorInfo; EXTERN_C const IID IID_IErrorInfo;
#define INTERFACE IErrorInfo #define INTERFACE IErrorInfo
DECLARE_INTERFACE_(IErrorInfo, IUnknown) DECLARE_INTERFACE_(IErrorInfo, IUnknown)
@ -765,6 +1108,75 @@ DECLARE_INTERFACE_(ITypeMarshal, IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
unsigned long __RPC_USER BSTR_UserSize(unsigned long*,unsigned long,LPBSTR);
unsigned char* __RPC_USER BSTR_UserMarshal(unsigned long*,unsigned char*,LPBSTR);
unsigned char* __RPC_USER BSTR_UserUnmarshal(unsigned long*,unsigned char*,LPBSTR);
void __RPC_USER BSTR_UserFree(unsigned long*,LPBSTR);
unsigned long __RPC_USER CLEANLOCALSTORAGE_UserSize(unsigned long*,unsigned long,CLEANLOCALSTORAGE*);
unsigned char* __RPC_USER CLEANLOCALSTORAGE_UserMarshal(unsigned long*,unsigned char*,CLEANLOCALSTORAGE*);
unsigned char* __RPC_USER CLEANLOCALSTORAGE_UserUnmarshal(unsigned long*,unsigned char*,CLEANLOCALSTORAGE*);
void __RPC_USER CLEANLOCALSTORAGE_UserFree(unsigned long*,CLEANLOCALSTORAGE*);
unsigned long __RPC_USER VARIANT_UserSize(unsigned long*,unsigned long,LPVARIANT);
unsigned char* __RPC_USER VARIANT_UserMarshal(unsigned long*,unsigned char*,LPVARIANT);
unsigned char* __RPC_USER VARIANT_UserUnmarshal(unsigned long*,unsigned char*,LPVARIANT);
void __RPC_USER VARIANT_UserFree(unsigned long*,LPVARIANT);
HRESULT STDMETHODCALLTYPE IDispatch_Invoke_Proxy(LPDISPATCH,DISPID,REFIID,LCID,WORD,DISPPARAMS*,LPVARIANT,LPEXCEPINFO,LPUINT);
HRESULT STDMETHODCALLTYPE IDispatch_Invoke_Stub(LPDISPATCH,DISPID,REFIID,LCID,DWORD,DISPPARAMS*,LPVARIANT,LPEXCEPINFO,LPUINT,UINT,LPUINT,LPVARIANTARG);
HRESULT STDMETHODCALLTYPE IDispatch_RemoteInvoke_Proxy(LPDISPATCH,DISPID,REFIID,LCID,DWORD,DISPPARAMS*,LPVARIANT,LPEXCEPINFO,LPUINT,UINT,LPUINT,LPVARIANTARG);
HRESULT STDMETHODCALLTYPE IEnumVARIANT_Next_Proxy(LPENUMVARIANT,ULONG,LPVARIANT,PULONG);
HRESULT STDMETHODCALLTYPE IEnumVARIANT_Next_Stub(LPENUMVARIANT,ULONG,LPVARIANT,PULONG);
HRESULT STDMETHODCALLTYPE IEnumVARIANT_RemoteNext_Proxy(LPENUMVARIANT,ULONG,LPVARIANT,PULONG);
HRESULT STDMETHODCALLTYPE ITypeComp_Bind_Proxy(LPTYPECOMP,LPOLESTR,ULONG,WORD,LPTYPEINFO*,DESCKIND*,BINDPTR*);
HRESULT STDMETHODCALLTYPE ITypeComp_Bind_Stub(LPTYPECOMP,LPOLESTR,ULONG,WORD,LPTYPEINFO*,DESCKIND*,LPFUNCDESC*,LPVARDESC*,LPTYPECOMP*,CLEANLOCALSTORAGE*);
HRESULT STDMETHODCALLTYPE ITypeComp_BindType_Proxy(LPTYPECOMP,LPOLESTR,ULONG,LPTYPEINFO*,LPTYPECOMP*);
HRESULT STDMETHODCALLTYPE ITypeComp_BindType_Stub(LPTYPECOMP,LPOLESTR,ULONG,LPTYPEINFO*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetTypeAttr_Proxy(LPTYPEINFO,LPTYPEATTR*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetTypeAttr_Stub(LPTYPEINFO,LPTYPEATTR*,CLEANLOCALSTORAGE*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetFuncDesc_Proxy(LPTYPEINFO,UINT,FUNCDESC**);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetFuncDesc_Stub(LPTYPEINFO,UINT,LPFUNCDESC*,CLEANLOCALSTORAGE*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetVarDesc_Proxy(LPTYPEINFO,UINT,LPVARDESC*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetVarDesc_Stub(LPTYPEINFO,UINT,LPVARDESC*,CLEANLOCALSTORAGE*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetNames_Proxy(LPTYPEINFO,MEMBERID,LPBSTR,UINT,LPUINT);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetNames_Stub(LPTYPEINFO,MEMBERID,LPBSTR,UINT,LPUINT);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetIDsOfNames_Proxy(LPTYPEINFO,LPOLESTR*,UINT,MEMBERID*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetIDsOfNames_Stub(LPTYPEINFO);
HRESULT STDMETHODCALLTYPE ITypeInfo_Invoke_Proxy(LPTYPEINFO,PVOID,MEMBERID,WORD,DISPPARAMS*,LPVARIANT,LPEXCEPINFO,LPUINT);
HRESULT STDMETHODCALLTYPE ITypeInfo_Invoke_Stub(LPTYPEINFO);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetDocumentation_Proxy(LPTYPEINFO,MEMBERID,LPBSTR,LPBSTR,LPDWORD,LPBSTR);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetDocumentation_Stub(LPTYPEINFO,MEMBERID,DWORD,LPBSTR,LPBSTR,LPDWORD,LPBSTR);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetDllEntry_Proxy(LPTYPEINFO,MEMBERID,INVOKEKIND,LPBSTR,LPBSTR,LPWORD);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetDllEntry_Stub(LPTYPEINFO,MEMBERID,INVOKEKIND,DWORD,LPBSTR,LPBSTR,LPWORD);
HRESULT STDMETHODCALLTYPE ITypeInfo_AddressOfMember_Proxy(LPTYPEINFO,MEMBERID,INVOKEKIND,PVOID*);
HRESULT STDMETHODCALLTYPE ITypeInfo_AddressOfMember_Stub(LPTYPEINFO);
HRESULT STDMETHODCALLTYPE ITypeInfo_CreateInstance_Proxy(LPTYPEINFO,LPUNKNOWN,REFIID,PVOID*);
HRESULT STDMETHODCALLTYPE ITypeInfo_CreateInstance_Stub(LPTYPEINFO,REFIID,LPUNKNOWN*);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetContainingTypeLib_Proxy(LPTYPEINFO,LPTYPELIB*,PUINT);
HRESULT STDMETHODCALLTYPE ITypeInfo_GetContainingTypeLib_Stub(LPTYPEINFO,LPTYPELIB*,PUINT);
void STDMETHODCALLTYPE ITypeInfo_ReleaseTypeAttr_Proxy(LPTYPEINFO,LPTYPEATTR);
HRESULT STDMETHODCALLTYPE ITypeInfo_ReleaseTypeAttr_Stub(LPTYPEINFO);
void STDMETHODCALLTYPE ITypeInfo_ReleaseFuncDesc_Proxy(LPTYPEINFO,LPFUNCDESC);
HRESULT STDMETHODCALLTYPE ITypeInfo_ReleaseFuncDesc_Stub(LPTYPEINFO);
void STDMETHODCALLTYPE ITypeInfo_ReleaseVarDesc_Proxy(LPTYPEINFO,VARDESC*);
HRESULT STDMETHODCALLTYPE ITypeInfo_ReleaseVarDesc_Stub(LPTYPEINFO);
HRESULT STDMETHODCALLTYPE ITypeInfo2_GetDocumentation2_Proxy(LPTYPEINFO2,MEMBERID,LCID,LPBSTR,LPDWORD,LPBSTR);
HRESULT STDMETHODCALLTYPE ITypeInfo2_GetDocumentation2_Stub(LPTYPEINFO2,MEMBERID,LCID,DWORD,LPBSTR,LPDWORD,LPBSTR);
UINT STDMETHODCALLTYPE ITypeLib_GetTypeInfoCount_Proxy(LPTYPELIB);
HRESULT STDMETHODCALLTYPE ITypeLib_GetTypeInfoCount_Stub(LPTYPELIB,PUINT);
HRESULT STDMETHODCALLTYPE ITypeLib_GetLibAttr_Proxy(LPTYPELIB,LPTLIBATTR*);
HRESULT STDMETHODCALLTYPE ITypeLib_GetLibAttr_Stub(LPTYPELIB,LPTLIBATTR*,CLEANLOCALSTORAGE*);
HRESULT STDMETHODCALLTYPE ITypeLib_GetDocumentation_Proxy(LPTYPELIB,INT,LPBSTR,LPBSTR,LPDWORD,LPBSTR);
HRESULT STDMETHODCALLTYPE ITypeLib_GetDocumentation_Stub(LPTYPELIB,INT,DWORD,LPBSTR,LPBSTR,LPDWORD,LPBSTR);
HRESULT STDMETHODCALLTYPE ITypeLib_IsName_Proxy(LPTYPELIB,LPOLESTR,ULONG,LPBOOL);
HRESULT STDMETHODCALLTYPE ITypeLib_IsName_Stub(LPTYPELIB,LPOLESTR,ULONG,LPBOOL,LPBSTR);
HRESULT STDMETHODCALLTYPE ITypeLib_FindName_Proxy(LPTYPELIB,LPOLESTR,ULONG,LPTYPEINFO*,MEMBERID*,PUSHORT);
HRESULT STDMETHODCALLTYPE ITypeLib_FindName_Stub(LPTYPELIB,LPOLESTR,ULONG,LPTYPEINFO*,MEMBERID*,PUSHORT,LPBSTR);
void STDMETHODCALLTYPE ITypeLib_ReleaseTLibAttr_Proxy(LPTYPELIB,LPTLIBATTR);
HRESULT STDMETHODCALLTYPE ITypeLib_ReleaseTLibAttr_Stub(LPTYPELIB);
HRESULT STDMETHODCALLTYPE ITypeLib2_GetLibStatistics_Proxy(LPTYPELIB2,PULONG,PULONG);
HRESULT STDMETHODCALLTYPE ITypeLib2_GetLibStatistics_Stub(LPTYPELIB2,PULONG,PULONG);
HRESULT STDMETHODCALLTYPE ITypeLib2_GetDocumentation2_Proxy(LPTYPELIB2,INT,LCID,LPBSTR,LPDWORD,LPBSTR);
HRESULT STDMETHODCALLTYPE ITypeLib2_GetDocumentation2_Stub(LPTYPELIB2,INT,LCID,DWORD,LPBSTR,LPDWORD,LPBSTR);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View file

@ -796,11 +796,11 @@ DECLARE_INTERFACE_(IRpcStubBuffer,IUnknown)
STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(Connect)(THIS_ LPUNKNOWN) PURE; STDMETHOD(Connect)(THIS_ LPUNKNOWN) PURE;
STDMETHOD_(void,Disconnect)(THIS) PURE; STDMETHOD_(void,Disconnect)(THIS) PURE;
STDMETHOD(Invoke)(THIS_ RPCOLEMESSAGE*,LPRPCSTUBBUFFER) PURE; STDMETHOD(Invoke)(THIS_ RPCOLEMESSAGE*,LPRPCCHANNELBUFFER) PURE;
STDMETHOD_(LPRPCSTUBBUFFER,IsIIDSupported)(THIS_ REFIID) PURE; STDMETHOD_(LPRPCSTUBBUFFER,IsIIDSupported)(THIS_ REFIID) PURE;
STDMETHOD_(ULONG,CountRefs)(THIS) PURE; STDMETHOD_(ULONG,CountRefs)(THIS) PURE;
STDMETHOD(DebugServerQueryInterface)(THIS_ PVOID*) PURE; STDMETHOD(DebugServerQueryInterface)(THIS_ PVOID*) PURE;
STDMETHOD(DebugServerRelease)(THIS_ PVOID) PURE; STDMETHOD_(VOID,DebugServerRelease)(THIS_ PVOID) PURE;
}; };
#undef INTERFACE #undef INTERFACE

View file

@ -217,6 +217,14 @@ DECLARE_INTERFACE_(IPropertyBag,IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define IPropertyBag_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IPropertyBag_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IPropertyBag_Release(p) (p)->lpVtbl->Release(p)
#define IPropertyBag_Read(p,a,b,c) (p)->lpVtbl->Read(p,a,b,c)
#define IPropertyBag_Write(p,a,b) (p)->lpVtbl->Write(p,a,b)
#endif
EXTERN_C const IID IID_IPropertyBag2; EXTERN_C const IID IID_IPropertyBag2;
#define INTERFACE IPropertyBag2 #define INTERFACE IPropertyBag2
DECLARE_INTERFACE_(IPropertyBag2,IUnknown) DECLARE_INTERFACE_(IPropertyBag2,IUnknown)
@ -232,6 +240,17 @@ DECLARE_INTERFACE_(IPropertyBag2,IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define IPropertyBag2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IPropertyBag2_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IPropertyBag2_Release(p) (p)->lpVtbl->Release(p)
#define IPropertyBag2_Read(p,a,b,c) (p)->lpVtbl->Read(p,a,b,c)
#define IPropertyBag2_Write(p,a,b) (p)->lpVtbl->Write(p,a,b)
#define IPropertyBag2_CountProperties(p,a) (p)->lpVtbl->CountProperties(p,a)
#define IPropertyBag2_GetPropertyInfo(p,a,b,c,d) (p)->lpVtbl->GetPropertyInfo(p,a,b,c,d)
#define IPropertyBag2_LoadObject(p,a,b,c,d) (p)->lpVtbl->LoadObject(p,a,b,c,d)
#endif
EXTERN_C const IID IID_IPersistPropertyBag; EXTERN_C const IID IID_IPersistPropertyBag;
#define INTERFACE IPersistPropertyBag #define INTERFACE IPersistPropertyBag
DECLARE_INTERFACE_(IPersistPropertyBag,IPersist) DECLARE_INTERFACE_(IPersistPropertyBag,IPersist)
@ -572,6 +591,36 @@ DECLARE_INTERFACE_(IFont,IUnknown)
}; };
#undef INTERFACE #undef INTERFACE
#ifdef COBJMACROS
#define IFont_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IFont_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IFont_Release(p) (p)->lpVtbl->Release(p)
#define IFont_get_Name(p,a) (p)->lpVtbl->get_Name(p,a)
#define IFont_put_Name(p,a) (p)->lpVtbl->put_Name(p,a)
#define IFont_get_Size(p,a) (p)->lpVtbl->get_Size(p,a)
#define IFont_put_Size(p,a) (p)->lpVtbl->put_Size(p,a)
#define IFont_get_Bold(p,a) (p)->lpVtbl->get_Bold(p,a)
#define IFont_put_Bold(p,a) (p)->lpVtbl->put_Bold(p,a)
#define IFont_get_Italic(p,a) (p)->lpVtbl->get_Italic(p,a)
#define IFont_put_Italic(p,a) (p)->lpVtbl->put_Italic(p,a)
#define IFont_get_Underline(p,a) (p)->lpVtbl->get_Underline(p,a)
#define IFont_put_Underline(p,a) (p)->lpVtbl->put_Underline(p,a)
#define IFont_get_Strikethrough(p,a) (p)->lpVtbl->get_Strikethrough(p,a)
#define IFont_put_Strikethrough(p,a) (p)->lpVtbl->put_Strikethrough(p,a)
#define IFont_get_Weight(p,a) (p)->lpVtbl->get_Weight(p,a)
#define IFont_put_Weight(p,a) (p)->lpVtbl->put_Weight(p,a)
#define IFont_get_Charset(p,a) (p)->lpVtbl->get_Charset(p,a)
#define IFont_put_Charset(p,a) (p)->lpVtbl->put_Charset(p,a)
#define IFont_get_hFont(p,a) (p)->lpVtbl->get_hFont(p,a)
#define IFont_Clone(p,a) (p)->lpVtbl->Clone(p,a)
#define IFont_IsEqual(p,a) (p)->lpVtbl->IsEqual(p,a)
#define IFont_SetRatio(p,a,b) (p)->lpVtbl->SetRatio(p,a,b)
#define IFont_QueryTextMetrics(p,a) (p)->lpVtbl->QueryTextMetrics(p,a)
#define IFont_AddRefHfont(p,a) (p)->lpVtbl->AddRefHfont(p,a)
#define IFont_ReleaseHfont(p,a) (p)->lpVtbl->ReleaseHfont(p,a)
#define IFont_SetHdc(p,a) (p)->lpVtbl->SetHdc(p,a)
#endif
EXTERN_C const IID IID_IFontDisp; EXTERN_C const IID IID_IFontDisp;
#define INTERFACE IFontDisp #define INTERFACE IFontDisp
DECLARE_INTERFACE_(IFontDisp,IDispatch) DECLARE_INTERFACE_(IFontDisp,IDispatch)

View file

@ -154,6 +154,8 @@
#include <oaidl.h> #include <oaidl.h>
EXTERN_C const IID IID_StdOle;
typedef enum tagREGKIND { typedef enum tagREGKIND {
REGKIND_DEFAULT, REGKIND_DEFAULT,
REGKIND_REGISTER, REGKIND_REGISTER,

View file

@ -54,6 +54,15 @@ typedef long RPC_STATUS;
#define RpcEndFinally } #define RpcEndFinally }
#define RpcExceptionCode() GetExceptionCode() #define RpcExceptionCode() GetExceptionCode()
#define RpcAbnormalTermination() AbnormalTermination() #define RpcAbnormalTermination() AbnormalTermination()
#else
#define RpcTryExcept if (1) {
#define RpcExcept(x) } else {
#define RpcEndExcept }
#define RpcTryFinally if (1) {
#define RpcFinally } else {
#define RpcEndFinally }
#define RpcExceptionCode() 0
#define RpcAbnormalTermination() AbnormalTermination()
#endif /* 0 */ #endif /* 0 */
RPC_STATUS RPC_ENTRY RpcImpersonateClient(RPC_BINDING_HANDLE); RPC_STATUS RPC_ENTRY RpcImpersonateClient(RPC_BINDING_HANDLE);

View file

@ -12,6 +12,9 @@
extern "C" { extern "C" {
#endif #endif
#include <objfwd.h> #include <objfwd.h>
#define TARGET_IS_NT50_OR_LATER 1
#define TARGET_IS_NT40_OR_LATER 1
#define TARGET_IS_NT351_OR_WIN95_OR_LATER 1
#define DECLSPEC_UUID(x) #define DECLSPEC_UUID(x)
#define MIDL_INTERFACE(x) struct #define MIDL_INTERFACE(x) struct
#define NDR_CHAR_REP_MASK (unsigned long)0xFL #define NDR_CHAR_REP_MASK (unsigned long)0xFL

View file

@ -20,6 +20,10 @@ extern "C" {
#include <rpcndr.h> #include <rpcndr.h>
#include <string.h> #include <string.h>
#ifndef __RPCPROXY_H_VERSION__
#define __RPCPROXY_H_VERSION__ 475
#endif
#define CStdStubBuffer_METHODS CStdStubBuffer_QueryInterface,CStdStubBuffer_AddRef,\ #define CStdStubBuffer_METHODS CStdStubBuffer_QueryInterface,CStdStubBuffer_AddRef,\
CStdStubBuffer_Release,CStdStubBuffer_Connect,CStdStubBuffer_Disconnect,CStdStubBuffer_Invoke,\ CStdStubBuffer_Release,CStdStubBuffer_Connect,CStdStubBuffer_Disconnect,CStdStubBuffer_Invoke,\
CStdStubBuffer_IsIIDSupported,CStdStubBuffer_CountRefs,CStdStubBuffer_DebugServerQueryInterface,\ CStdStubBuffer_IsIIDSupported,CStdStubBuffer_CountRefs,CStdStubBuffer_DebugServerQueryInterface,\
@ -98,6 +102,13 @@ DLLREGISTRY_ROUTINES(pProxyFileList, pClsID)
#define DLLDATA_STANDARD_ROUTINES DLLDATA_ROUTINES( (const ProxyFileInfo**) pProxyFileList, &CLSID_PSFactoryBuffer) #define DLLDATA_STANDARD_ROUTINES DLLDATA_ROUTINES( (const ProxyFileInfo**) pProxyFileList, &CLSID_PSFactoryBuffer)
#define CINTERFACE_PROXY_VTABLE(n) \
struct \
{ \
CInterfaceProxyHeader header; \
void *Vtbl[n]; \
}
struct tagCInterfaceStubVtbl; struct tagCInterfaceStubVtbl;
struct tagCInterfaceProxyVtbl; struct tagCInterfaceProxyVtbl;
typedef struct tagCInterfaceStubVtbl *PCInterfaceStubVtblList; typedef struct tagCInterfaceStubVtbl *PCInterfaceStubVtblList;