dplayx: Get rid of the LPDIRECTPLAYLOBBY usage.
[wine.git] / include / atlbase.h
blob1f91f55895011069f1a7d590a1fd580c3df13a00
1 /*
2 * Implementation of the Active Template Library (atl.dll)
4 * Copyright 2004 Aric Stewart for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_ATLBASE_H__
22 #define __WINE_ATLBASE_H__
24 #include <atliface.h>
25 #include <comcat.h>
27 /* Wine extension: we (ab)use _ATL_VER to handle struct layout differences between ATL versions. */
28 #define _ATL_VER_30 0x0300
29 #define _ATL_VER_70 0x0700
30 #define _ATL_VER_80 0x0800
31 #define _ATL_VER_100 0x0a00
33 #ifndef _ATL_VER
34 #define _ATL_VER _ATL_VER_100
35 #endif
37 typedef HRESULT (WINAPI _ATL_CREATORFUNC)(void* pv, REFIID riid, LPVOID* ppv);
38 typedef HRESULT (WINAPI _ATL_CREATORARGFUNC)(void* pv, REFIID riid, LPVOID* ppv, DWORD dw);
39 typedef HRESULT (WINAPI _ATL_MODULEFUNC)(DWORD dw);
40 typedef LPCSTR (WINAPI _ATL_DESCRIPTIONFUNCA)(void);
41 typedef LPCWSTR (WINAPI _ATL_DESCRIPTIONFUNCW)(void);
42 typedef const struct _ATL_CATMAP_ENTRY* (_ATL_CATMAPFUNC)(void);
43 typedef void (WINAPI _ATL_TERMFUNC)(DWORD dw);
45 typedef CRITICAL_SECTION CComCriticalSection;
47 typedef struct _ATL_OBJMAP_ENTRYA_V1_TAG
49 const CLSID* pclsid;
50 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
51 _ATL_CREATORFUNC* pfnGetClassObject;
52 _ATL_CREATORFUNC* pfnCreateInstance;
53 IUnknown* pCF;
54 DWORD dwRegister;
55 _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription;
56 }_ATL_OBJMAP_ENTRYA_V1;
58 typedef struct _ATL_OBJMAP_ENTRYW_V1_TAG
60 const CLSID* pclsid;
61 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
62 _ATL_CREATORFUNC* pfnGetClassObject;
63 _ATL_CREATORFUNC* pfnCreateInstance;
64 IUnknown* pCF;
65 DWORD dwRegister;
66 _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription;
67 } _ATL_OBJMAP_ENTRYW_V1;
69 typedef struct _ATL_OBJMAP_ENTRYA_TAG
71 const CLSID* pclsid;
72 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
73 _ATL_CREATORFUNC* pfnGetClassObject;
74 _ATL_CREATORFUNC* pfnCreateInstance;
75 IUnknown* pCF;
76 DWORD dwRegister;
77 _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription;
78 _ATL_CATMAPFUNC* pfnGetCategoryMap;
79 void (WINAPI *pfnObjectMain)(BOOL bStarting);
80 }_ATL_OBJMAP_ENTRYA;
82 typedef struct _ATL_OBJMAP_ENTRYW_TAG
84 const CLSID* pclsid;
85 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
86 _ATL_CREATORFUNC* pfnGetClassObject;
87 _ATL_CREATORFUNC* pfnCreateInstance;
88 IUnknown* pCF;
89 DWORD dwRegister;
90 _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription;
91 _ATL_CATMAPFUNC* pfnGetCategoryMap;
92 void (WINAPI *pfnObjectMain)(BOOL bStarting);
93 } _ATL_OBJMAP_ENTRYW, _ATL_OBJMAP_ENTRY30, _ATL_OBJMAP_ENTRY;
96 typedef struct _ATL_TERMFUNC_ELEM_TAG
98 _ATL_TERMFUNC* pFunc;
99 DWORD_PTR dw;
100 struct _ATL_TERMFUNC_ELEM_TAG* pNext;
101 } _ATL_TERMFUNC_ELEM;
103 typedef struct _AtlCreateWndData_TAG
105 void* m_pThis;
106 DWORD m_dwThreadID;
107 struct _AtlCreateWndData_TAG* m_pNext;
108 } _AtlCreateWndData;
110 typedef struct _ATL_MODULEA_TAG
112 UINT cbSize;
113 HINSTANCE m_hInst;
114 HINSTANCE m_hInstResource;
115 HINSTANCE m_hInstTypeLib;
116 _ATL_OBJMAP_ENTRYA* m_pObjMap;
117 LONG m_nLockCnt;
118 HANDLE m_hHeap;
119 union
121 CRITICAL_SECTION m_csTypeInfoHolder;
122 CRITICAL_SECTION m_csStaticDataInit;
123 } u;
124 CRITICAL_SECTION m_csWindowCreate;
125 CRITICAL_SECTION m_csObjMap;
127 DWORD dwAtlBuildVer;
128 _AtlCreateWndData* m_pCreateWndList;
129 BOOL m_bDestroyHeap;
130 GUID* pguidVer;
131 DWORD m_dwHeaps;
132 HANDLE* m_phHeaps;
133 int m_nHeap;
134 _ATL_TERMFUNC_ELEM* m_pTermFuncs;
135 } _ATL_MODULEA;
137 typedef struct _ATL_MODULEW_TAG
139 UINT cbSize;
140 HINSTANCE m_hInst;
141 HINSTANCE m_hInstResource;
142 HINSTANCE m_hInstTypeLib;
143 _ATL_OBJMAP_ENTRYW* m_pObjMap;
144 LONG m_nLockCnt;
145 HANDLE m_hHeap;
146 union
148 CRITICAL_SECTION m_csTypeInfoHolder;
149 CRITICAL_SECTION m_csStaticDataInit;
150 } u;
151 CRITICAL_SECTION m_csWindowCreate;
152 CRITICAL_SECTION m_csObjMap;
154 DWORD dwAtlBuildVer;
155 _AtlCreateWndData* m_pCreateWndList;
156 BOOL m_bDestroyHeap;
157 GUID* pguidVer;
158 DWORD m_dwHeaps;
159 HANDLE* m_phHeaps;
160 int m_nHeap;
161 _ATL_TERMFUNC_ELEM* m_pTermFuncs;
162 } _ATL_MODULEW;
164 typedef struct
166 void *m_aT;
167 int m_nSize;
168 int m_nAllocSize;
169 } CSimpleArray;
171 typedef struct _ATL_MODULE70
173 UINT cbSize;
174 LONG m_nLockCnt;
175 _ATL_TERMFUNC_ELEM *m_pTermFuncs;
176 CComCriticalSection m_csStaticDataInitAndTypeInfo;
177 } _ATL_MODULE70;
179 typedef struct _ATL_WIN_MODULE70
181 UINT cbSize;
182 CComCriticalSection m_csWindowCreate;
183 _AtlCreateWndData *m_pCreateWndList;
184 CSimpleArray /* <ATOM> */ m_rgWindowClassAtoms;
185 } _ATL_WIN_MODULE70;
187 typedef struct _ATL_COM_MODULE70
189 UINT cbSize;
190 HINSTANCE m_hInstTypeLib;
191 _ATL_OBJMAP_ENTRY **m_ppAutoObjMapFirst;
192 _ATL_OBJMAP_ENTRY **m_ppAutoObjMapLast;
193 CComCriticalSection m_csObjMap;
194 } _ATL_COM_MODULE70, _ATL_COM_MODULE;
196 #if _ATL_VER >= _ATL_VER_70
197 typedef _ATL_MODULE70 _ATL_MODULE;
198 typedef _ATL_WIN_MODULE70 _ATL_WIN_MODULE;
199 #else
200 typedef _ATL_MODULEW _ATL_MODULE;
201 typedef _ATL_MODULEW _ATL_WIN_MODULE;
202 #endif
204 typedef struct _ATL_INTMAP_ENTRY_TAG
206 const IID* piid;
207 DWORD dw;
208 _ATL_CREATORARGFUNC* pFunc;
209 } _ATL_INTMAP_ENTRY;
211 struct _ATL_REGMAP_ENTRY
213 LPCOLESTR szKey;
214 LPCOLESTR szData;
217 struct _ATL_CATMAP_ENTRY
219 int iType;
220 const CATID *pcatid;
223 #define _ATL_CATMAP_ENTRY_END 0
224 #define _ATL_CATMAP_ENTRY_IMPLEMENTED 1
225 #define _ATL_CATMAP_ENTRY_REQUIRED 2
227 HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID * iid, LPDWORD dpw);
228 HRESULT WINAPI AtlAxAttachControl(IUnknown*,HWND,IUnknown**);
229 HRESULT WINAPI AtlAxCreateControl(LPCOLESTR,HWND,IStream*,IUnknown**);
230 HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR,HWND,IStream*,IUnknown**,IUnknown**,REFIID,IUnknown*);
231 HRESULT WINAPI AtlFreeMarshalStream(IStream *pStream);
232 HRESULT WINAPI AtlInternalQueryInterface(void* pThis, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, void** ppvObject);
233 HRESULT WINAPI AtlMarshalPtrInProc(IUnknown *pUnk, const IID *iid, IStream **ppStream);
234 void WINAPI AtlModuleAddCreateWndData(_ATL_MODULEW *pM, _AtlCreateWndData *pData, void* pvObject);
235 HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE*);
236 void WINAPI AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE*,_AtlCreateWndData*,void*);
237 void* WINAPI AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE*);
238 HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULE *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw);
239 void WINAPI AtlCallTermFunc(_ATL_MODULE*);
240 void* WINAPI AtlModuleExtractCreateWndData(_ATL_MODULEW *pM);
241 HRESULT WINAPI AtlModuleInit(_ATL_MODULEW* pM, _ATL_OBJMAP_ENTRYW* p, HINSTANCE h);
242 HRESULT WINAPI AtlModuleLoadTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib);
243 HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW* pM, DWORD dwClsContext, DWORD dwFlags);
244 HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* pCLSID);
245 HRESULT WINAPI AtlModuleRegisterTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex);
246 HRESULT WINAPI AtlModuleUnregisterServer(_ATL_MODULEW* pM, const CLSID* pCLSID);
247 HRESULT WINAPI AtlModuleUpdateRegistryFromResourceD(_ATL_MODULEW *pM, LPCOLESTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries, IRegistrar *pReg );
248 HRESULT WINAPI AtlModuleUnregisterServerEx(_ATL_MODULEW* pM, BOOL bUnRegTypeLib, const CLSID* pCLSID);
249 HRESULT WINAPI AtlModuleTerm(_ATL_MODULEW* pM);
250 HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID * iid, DWORD dw);
251 HRESULT WINAPI AtlUnmarshalPtr(IStream *pStream, const IID *iid, IUnknown **ppUnk);
252 HRESULT WINAPI AtlCreateRegistrar(IRegistrar**);
253 HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE,LPCOLESTR,BOOL,struct _ATL_REGMAP_ENTRY*,IRegistrar*);
254 HRESULT WINAPI AtlLoadTypeLib(HINSTANCE,LPCOLESTR,BSTR*,ITypeLib**);
255 HRESULT WINAPI AtlRegisterTypeLib(HINSTANCE,LPCOLESTR);
256 HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID,const struct _ATL_CATMAP_ENTRY*,BOOL);
257 HRESULT WINAPI AtlComModuleGetClassObject(_ATL_COM_MODULE*,REFCLSID,REFIID,void**);
258 HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE*,DWORD,DWORD);
259 HRESULT WINAPI AtlComModuleUnregisterServer(_ATL_COM_MODULE*,BOOL,const CLSID*);
260 BOOL WINAPI AtlWaitWithMessageLoop(HANDLE);
261 HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown*,GUID*,IID*,unsigned short*,unsigned short*);
262 HRESULT WINAPI AtlSetPerUserRegistration(unsigned char /*bool*/);
263 HRESULT WINAPI AtlGetPerUserRegistration(unsigned char /*bool*/ *);
265 #endif /* __WINE_ATLBASE_H__ */