2 * Defines the COM interfaces and APIs that allow an interface to
3 * specify a custom marshaling for its objects.
6 #ifndef __WINE_WINE_OBJ_MARSHAL_H
7 #define __WINE_WINE_OBJ_MARSHAL_H
9 #include "wine/obj_base.h"
10 #include "wine/obj_storage.h"
14 #endif /* defined(__cplusplus) */
16 /*****************************************************************************
17 * Predeclare the interfaces
19 DEFINE_OLEGUID(IID_IMarshal, 0x00000003L, 0, 0);
20 typedef struct IMarshal IMarshal,*LPMARSHAL;
22 DEFINE_OLEGUID(IID_IStdMarshalInfo, 0x00000018L, 0, 0);
23 typedef struct IStdMarshalInfo IStdMarshalInfo,*LPSTDMARSHALINFO;
26 /*****************************************************************************
29 #define ICOM_INTERFACE IMarshal
30 #define IMarshal_METHODS \
31 ICOM_METHOD6(HRESULT,GetUnmarshalClass, REFIID,riid, void*,pv, DWORD,dwDestContext, void*,pvDestContext, DWORD,mshlflags, CLSID*,pCid) \
32 ICOM_METHOD6(HRESULT,GetMarshalSizeMax, REFIID,riid, void*,pv, DWORD,dwDestContext, void*,pvDestContext, DWORD,mshlflags, DWORD*,pSize) \
33 ICOM_METHOD6(HRESULT,MarshalInterface, IStream*,pStm, REFIID,riid, void*,pv, DWORD,dwDestContext, void*,pvDestContext, DWORD,mshlflags) \
34 ICOM_METHOD3(HRESULT,UnmarshalInterface, IStream*,pStm, REFIID,riid, void**,ppv) \
35 ICOM_METHOD1(HRESULT,ReleaseMarshalData, IStream*,pStm) \
36 ICOM_METHOD1(HRESULT,DisconnectObject, DWORD,dwReserved)
37 #define IMarshal_IMETHODS \
40 ICOM_DEFINE(IMarshal,IUnknown)
43 #ifdef ICOM_CINTERFACE
44 /*** IUnknown methods ***/
45 #define IMarshal_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
46 #define IMarshal_AddRef(p) ICOM_CALL (AddRef,p)
47 #define IMarshal_Release(p) ICOM_CALL (Release,p)
48 /*** IMarshal methods ***/
49 #define IMarshal_GetUnmarshalClass(p,a,b,c,d,e,f) ICOM_CALL6(GetUnmarshalClass,p,a,b,c,d,e,f)
50 #define IMarshal_GetMarshalSizeMax(p,a,b,c,d,e,f) ICOM_CALL6(GetMarshalSizeMax,p,a,b,c,d,e,f)
51 #define IMarshal_MarshalInterface(p,a,b,c,d,e,f) ICOM_CALL6(MarshalInterface,p,a,b,c,d,e,f)
52 #define IMarshal_UnmarshalInterface(p,a,b,c) ICOM_CALL3(UnmarshalInterface,p,a,b,c)
53 #define IMarshal_ReleaseMarshalData(p,a) ICOM_CALL1(ReleaseMarshalData,p,a)
54 #define IMarshal_DisconnectObject(p,a) ICOM_CALL1(DisconnectObject,p,a)
58 /*****************************************************************************
59 * IStdMarshalInfo interface
61 #define ICOM_INTERFACE IStdMarshalInfo
62 #define IStdMarshalInfo_METHODS \
63 ICOM_METHOD3(HRESULT,GetClassForHandler, DWORD,dwDestContext, void*,pvDestContext, CLSID*,pClsid)
64 #define IStdMarshalInfo_IMETHODS \
66 IStdMarshalInfo_METHODS
67 ICOM_DEFINE(IStdMarshalInfo,IUnknown)
70 #ifdef ICOM_CINTERFACE
71 /*** IUnknown methods ***/
72 #define IStdMarshalInfo_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
73 #define IStdMarshalInfo_AddRef(p) ICOM_CALL (AddRef,p)
74 #define IStdMarshalInfo_Release(p) ICOM_CALL (Release,p)
75 /*** IStdMarshalInfo methods ***/
76 #define IStdMarshalInfo_GetClassForHandler(p,a,b,c) ICOM_CALL3(GetClassForHandler,p,a,b,c)
80 /*****************************************************************************
81 * Additional marshalling API
84 /* FIXME: not implemented */
85 HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal);
87 /* FIXME: not implemented */
88 HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv);
90 /* FIXME: not implemented */
91 HRESULT WINAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
93 /* FIXME: not implemented */
94 HRESULT WINAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL* ppMarshal);
96 /* FIXME: not implemented */
97 HRESULT WINAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
99 /* FIXME: not implemented */
100 HRESULT WINAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
102 /* FIXME: not implemented */
103 HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM* ppStm);
105 /* FIXME: not implemented */
106 HRESULT WINAPI CoReleaseMarshalData(LPSTREAM pStm);
108 /* FIXME: not implemented */
109 HRESULT WINAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT* phresult);
111 /* FIXME: not implemented */
112 HRESULT WINAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID* ppv);
116 #endif /* defined(__cplusplus) */
118 #endif /* __WINE_WINE_OBJ_MARSHAL_H */