Fixed the WINE_NO_STRICT #ifdefs to do the right thing if STRICT is
[wine] / include / wine / obj_marshal.h
1 /*
2  * Defines the COM interfaces and APIs that allow an interface to
3  * specify a custom marshaling for its objects.
4  *
5  * Copyright (C) 1999 Francois Gouget
6  *
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.
11  *
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.
16  *
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
20  */
21
22 #ifndef __WINE_WINE_OBJ_MARSHAL_H
23 #define __WINE_WINE_OBJ_MARSHAL_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* defined(__cplusplus) */
28
29 /*****************************************************************************
30  * Predeclare the interfaces
31  */
32 DEFINE_OLEGUID(IID_IMarshal,            0x00000003L, 0, 0);
33 typedef struct IMarshal IMarshal,*LPMARSHAL;
34
35 DEFINE_OLEGUID(IID_IStdMarshalInfo,     0x00000018L, 0, 0);
36 typedef struct IStdMarshalInfo IStdMarshalInfo,*LPSTDMARSHALINFO;
37
38 DEFINE_OLEGUID(CLSID_DfMarshal,         0x0000030BL, 0, 0);
39
40
41 /*****************************************************************************
42  * IMarshal interface
43  */
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 \
53     IUnknown_IMETHODS \
54     IMarshal_METHODS
55 ICOM_DEFINE(IMarshal,IUnknown)
56 #undef ICOM_INTERFACE
57
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)
69
70
71 /*****************************************************************************
72  * IStdMarshalInfo interface
73  */
74 #define ICOM_INTERFACE IStdMarshalInfo
75 #define IStdMarshalInfo_METHODS \
76     ICOM_METHOD3(HRESULT,GetClassForHandler,  DWORD,dwDestContext, void*,pvDestContext, CLSID*,pClsid)
77 #define IStdMarshalInfo_IMETHODS \
78     IUnknown_IMETHODS \
79     IStdMarshalInfo_METHODS
80 ICOM_DEFINE(IStdMarshalInfo,IUnknown)
81 #undef ICOM_INTERFACE
82
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)
89
90
91 /*****************************************************************************
92  * Additional marshalling API
93  */
94
95 /* FIXME: not implemented */
96 HRESULT WINAPI CoCreateFreeThreadedMarshaler(LPUNKNOWN punkOuter, LPUNKNOWN* ppunkMarshal);
97
98 /* FIXME: not implemented */
99 HRESULT WINAPI CoGetInterfaceAndReleaseStream(LPSTREAM pStm, REFIID iid, LPVOID* ppv);
100
101 /* FIXME: not implemented */
102 HRESULT WINAPI CoGetMarshalSizeMax(ULONG* pulSize, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
103
104 /* FIXME: not implemented */
105 HRESULT WINAPI CoGetStandardMarshal(REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags, LPMARSHAL* ppMarshal);
106
107 /* FIXME: not implemented */
108 HRESULT WINAPI CoMarshalHresult(LPSTREAM pstm, HRESULT hresult);
109
110 /* FIXME: not implemented */
111 HRESULT WINAPI CoMarshalInterface(LPSTREAM pStm, REFIID riid, LPUNKNOWN pUnk, DWORD dwDestContext, LPVOID pvDestContext, DWORD mshlflags);
112
113 /* FIXME: not implemented */
114 HRESULT WINAPI CoMarshalInterThreadInterfaceInStream(REFIID riid, LPUNKNOWN pUnk, LPSTREAM* ppStm);
115
116 /* FIXME: not implemented */
117 HRESULT WINAPI CoReleaseMarshalData(LPSTREAM pStm);
118
119 /* FIXME: not implemented */
120 HRESULT WINAPI CoUnmarshalHresult(LPSTREAM pstm, HRESULT* phresult);
121
122 /* FIXME: not implemented */
123 HRESULT WINAPI CoUnmarshalInterface(LPSTREAM pStm, REFIID riid, LPVOID* ppv);
124
125 #ifdef __cplusplus
126 } /* extern "C" */
127 #endif /* defined(__cplusplus) */
128
129 #endif /* __WINE_WINE_OBJ_MARSHAL_H */