Use emergency TEB selector to avoid debugger crashes when stepping
[wine] / include / interfaces.h
1 #ifndef _WINE_INTERFACES_H
2 #define _WINE_INTERFACES_H
3
4 #include "ole.h"
5 #include "ole2.h"
6 #include "compobj.h"
7
8 #define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
9 #define STDMETHOD_(ret,xfn) ret (CALLBACK *fn##xfn)
10 #define PURE
11 #define FAR
12 #define THIS_ THIS,
13
14
15 DEFINE_OLEGUID(IID_IUnknown,0,0,0);
16 DEFINE_OLEGUID(IID_IClassFactory,1,0,0);
17 DEFINE_OLEGUID(IID_IMalloc,2,0,0);
18 DEFINE_OLEGUID(IID_IMarshal,3,0,0);
19 DEFINE_OLEGUID(IID_IStorage,0xb,0,0);
20 DEFINE_OLEGUID(IID_IStream,0xc,0,0);
21 DEFINE_OLEGUID(IID_IBindCtx,0xe,0,0);
22 DEFINE_OLEGUID(IID_IMoniker,0xf,0,0);
23 DEFINE_OLEGUID(IID_IRunningObject,0x10,0,0);
24 DEFINE_OLEGUID(IID_IRootStorage,0x12,0,0);
25 DEFINE_OLEGUID(IID_IMessageFilter,0x16,0,0);
26 DEFINE_OLEGUID(IID_IStdMarshalInfo,0x18,0,0);
27
28 #define THIS LPUNKNOWN this
29 typedef struct IUnknown *LPUNKNOWN,IUnknown;
30 typedef struct {
31         STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE;
32         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
33         STDMETHOD_(ULONG,Release) (THIS) PURE;
34 } *LPUNKNOWN_VTABLE,IUnknown_VTable;
35
36 struct IUnknown {
37         LPUNKNOWN_VTABLE        lpvtbl;
38         DWORD                   ref;
39 };
40 #undef THIS
41
42 #define THIS LPCLASSFACTORY this
43 typedef struct IClassFactory *LPCLASSFACTORY,IClassFactory;
44 typedef struct {
45         STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE;
46         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
47         STDMETHOD_(ULONG,Release) (THIS) PURE;
48         STDMETHOD(CreateInstance) (THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID FAR* ppvObject) PURE;
49     STDMETHOD(LockServer) (THIS) PURE;
50 } *LPCLASSFACTORY_VTABLE,IClassFactory_VTable;
51
52 struct IClassFactory {
53         LPCLASSFACTORY_VTABLE   lpvtbl;
54         DWORD                   ref;
55 };
56 #undef THIS
57
58 #define THIS LPMALLOC32 this
59 typedef struct IMalloc32 *LPMALLOC32,IMalloc32;
60 typedef struct {
61         STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE;
62         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
63         STDMETHOD_(ULONG,Release) (THIS) PURE;
64
65         STDMETHOD_(LPVOID,Alloc) ( THIS_ DWORD cb);
66         STDMETHOD_(LPVOID,Realloc) ( THIS_ LPVOID pv,DWORD cb);
67         STDMETHOD_(VOID,Free) ( THIS_ LPVOID pv);
68         STDMETHOD_(DWORD,GetSize) ( THIS_ LPVOID pv);
69         STDMETHOD_(INT32,DidAlloc) ( THIS_ LPVOID pv);
70         STDMETHOD_(LPVOID,HeapMinimize) ( THIS );
71 } *LPMALLOC32_VTABLE,IMalloc32_VTable;
72
73 struct IMalloc32 {
74         LPMALLOC32_VTABLE       lpvtbl;
75         DWORD                   ref;
76 };
77 #undef THIS
78
79 #define THIS LPMALLOC16 this
80 typedef struct IMalloc16 *LPMALLOC16,IMalloc16;
81 typedef struct {
82         STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE;
83         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
84         STDMETHOD_(ULONG,Release) (THIS) PURE;
85
86         STDMETHOD_(LPVOID,Alloc) ( THIS_ DWORD cb);
87         STDMETHOD_(LPVOID,Realloc) ( THIS_ LPVOID pv,DWORD cb);
88         STDMETHOD_(VOID,Free) ( THIS_ LPVOID pv);
89         STDMETHOD_(DWORD,GetSize) ( THIS_ LPVOID pv);
90         STDMETHOD_(INT16,DidAlloc) ( THIS_ LPVOID pv);
91         STDMETHOD_(LPVOID,HeapMinimize) ( THIS );
92 } *LPMALLOC16_VTABLE,IMalloc16_VTable;
93
94 struct IMalloc16 {
95         LPMALLOC16_VTABLE       lpvtbl;
96         DWORD                   ref;
97         /* Gmm, I think one is not enough, we should probably manage a list of
98          * heaps
99          */
100         HGLOBAL16               heap;
101 };
102 #undef THIS
103
104 /* private prototypes for the constructors */
105 #ifdef __WINE__
106 LPUNKNOWN       IUnknown_Constructor(void);
107 LPMALLOC16      IMalloc16_Constructor(void);
108 LPMALLOC32      IMalloc32_Constructor(void);
109 #endif
110
111 HRESULT WINAPI CoGetMalloc32(DWORD, LPMALLOC32*);
112
113 #undef STDMETHOD
114 #undef STDMETHOD_
115 #undef PURE
116 #undef FAR
117 #undef THIS_
118 #endif /*_WINE_INTERFACES_H*/