2 * Defines the COM interfaces and APIs that allow an interface to
3 * specify a custom marshaling for its objects.
5 * Copyright (C) 1999 Francois Gouget
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __WINE_WINE_OBJ_MARSHAL_H
23 #define __WINE_WINE_OBJ_MARSHAL_H
27 #endif /* defined(__cplusplus) */
29 /*****************************************************************************
30 * Predeclare the interfaces
32 DEFINE_OLEGUID(IID_IMarshal, 0x00000003L, 0, 0);
33 typedef struct IMarshal IMarshal,*LPMARSHAL;
35 DEFINE_OLEGUID(IID_IStdMarshalInfo, 0x00000018L, 0, 0);
36 typedef struct IStdMarshalInfo IStdMarshalInfo,*LPSTDMARSHALINFO;
38 DEFINE_OLEGUID(CLSID_DfMarshal, 0x0000030BL, 0, 0);
41 /*****************************************************************************
44 #define ICOM_INTERFACE IMarshal
45 #define IMarshal_METHODS \
46 ICOM_METHOD6(HRESULT,GetUnmarshalClass, REFIID,riid, void*,pv, DWORD,dwDestContext, void*,pvDestContext, DWORD,mshlflags, CLSID*,pCid) \
47 ICOM_METHOD6(HRESULT,GetMarshalSizeMax, REFIID,riid, void*,pv, DWORD,dwDestContext, void*,pvDestContext, DWORD,mshlflags, DWORD*,pSize) \
48 ICOM_METHOD6(HRESULT,MarshalInterface, IStream*,pStm, REFIID,riid, void*,pv, DWORD,dwDestContext, void*,pvDestContext, DWORD,mshlflags) \
49 ICOM_METHOD3(HRESULT,UnmarshalInterface, IStream*,pStm, REFIID,riid, void**,ppv) \
50 ICOM_METHOD1(HRESULT,ReleaseMarshalData, IStream*,pStm) \
51 ICOM_METHOD1(HRESULT,DisconnectObject, DWORD,dwReserved)
52 #define IMarshal_IMETHODS \
55 ICOM_DEFINE(IMarshal,IUnknown)
58 /*** IUnknown methods ***/
59 #define IMarshal_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
60 #define IMarshal_AddRef(p) ICOM_CALL (AddRef,p)
61 #define IMarshal_Release(p) ICOM_CALL (Release,p)
62 /*** IMarshal methods ***/
63 #define IMarshal_GetUnmarshalClass(p,a,b,c,d,e,f) ICOM_CALL6(GetUnmarshalClass,p,a,b,c,d,e,f)
64 #define IMarshal_GetMarshalSizeMax(p,a,b,c,d,e,f) ICOM_CALL6(GetMarshalSizeMax,p,a,b,c,d,e,f)
65 #define IMarshal_MarshalInterface(p,a,b,c,d,e,f) ICOM_CALL6(MarshalInterface,p,a,b,c,d,e,f)
66 #define IMarshal_UnmarshalInterface(p,a,b,c) ICOM_CALL3(UnmarshalInterface,p,a,b,c)
67 #define IMarshal_ReleaseMarshalData(p,a) ICOM_CALL1(ReleaseMarshalData,p,a)
68 #define IMarshal_DisconnectObject(p,a) ICOM_CALL1(DisconnectObject,p,a)
71 /*****************************************************************************
72 * IStdMarshalInfo interface
74 #define ICOM_INTERFACE IStdMarshalInfo
75 #define IStdMarshalInfo_METHODS \
76 ICOM_METHOD3(HRESULT,GetClassForHandler, DWORD,dwDestContext, void*,pvDestContext, CLSID*,pClsid)
77 #define IStdMarshalInfo_IMETHODS \
79 IStdMarshalInfo_METHODS
80 ICOM_DEFINE(IStdMarshalInfo,IUnknown)
83 /*** IUnknown methods ***/
84 #define IStdMarshalInfo_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
85 #define IStdMarshalInfo_AddRef(p) ICOM_CALL (AddRef,p)
86 #define IStdMarshalInfo_Release(p) ICOM_CALL (Release,p)
87 /*** IStdMarshalInfo methods ***/
88 #define IStdMarshalInfo_GetClassForHandler(p,a,b,c) ICOM_CALL3(GetClassForHandler,p,a,b,c)
91 /*****************************************************************************
92 * Additional marshalling API
95 /* FIXME: not implemented */
96 HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal);
98 /* FIXME: not implemented */
99 HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv);
101 /* FIXME: not implemented */
102 HRESULT WINAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
104 /* FIXME: not implemented */
105 HRESULT WINAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL* ppMarshal);
107 /* FIXME: not implemented */
108 HRESULT WINAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
110 /* FIXME: not implemented */
111 HRESULT WINAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
113 /* FIXME: not implemented */
114 HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM* ppStm);
116 /* FIXME: not implemented */
117 HRESULT WINAPI CoReleaseMarshalData(LPSTREAM pStm);
119 /* FIXME: not implemented */
120 HRESULT WINAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT* phresult);
122 /* FIXME: not implemented */
123 HRESULT WINAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID* ppv);
127 #endif /* defined(__cplusplus) */
129 #endif /* __WINE_WINE_OBJ_MARSHAL_H */