kernel32/tests: Add a missing linebreak to an ok() message.
[wine.git] / include / atlbase.h
blobbcd634e7d9a79260e5c2ef4933fcc9088a2a1541
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_90 0x0900
32 #define _ATL_VER_100 0x0a00
33 #define _ATL_VER_110 0x0b00
35 #ifndef _ATL_VER
36 #define _ATL_VER _ATL_VER_100
37 #endif
39 typedef HRESULT (WINAPI _ATL_CREATORFUNC)(void* pv, REFIID riid, LPVOID* ppv);
40 typedef HRESULT (WINAPI _ATL_CREATORARGFUNC)(void* pv, REFIID riid, LPVOID* ppv, DWORD dw);
41 typedef HRESULT (WINAPI _ATL_MODULEFUNC)(DWORD dw);
42 typedef LPCSTR (WINAPI _ATL_DESCRIPTIONFUNCA)(void);
43 typedef LPCWSTR (WINAPI _ATL_DESCRIPTIONFUNCW)(void);
44 typedef const struct _ATL_CATMAP_ENTRY* (_ATL_CATMAPFUNC)(void);
45 typedef void (WINAPI _ATL_TERMFUNC)(DWORD dw);
47 typedef CRITICAL_SECTION CComCriticalSection;
49 typedef struct _ATL_OBJMAP_ENTRYA_V1_TAG
51 const CLSID* pclsid;
52 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
53 _ATL_CREATORFUNC* pfnGetClassObject;
54 _ATL_CREATORFUNC* pfnCreateInstance;
55 IUnknown* pCF;
56 DWORD dwRegister;
57 _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription;
58 }_ATL_OBJMAP_ENTRYA_V1;
60 typedef struct _ATL_OBJMAP_ENTRYW_V1_TAG
62 const CLSID* pclsid;
63 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
64 _ATL_CREATORFUNC* pfnGetClassObject;
65 _ATL_CREATORFUNC* pfnCreateInstance;
66 IUnknown* pCF;
67 DWORD dwRegister;
68 _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription;
69 } _ATL_OBJMAP_ENTRYW_V1;
71 typedef struct _ATL_OBJMAP_ENTRYA_TAG
73 const CLSID* pclsid;
74 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
75 _ATL_CREATORFUNC* pfnGetClassObject;
76 _ATL_CREATORFUNC* pfnCreateInstance;
77 IUnknown* pCF;
78 DWORD dwRegister;
79 _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription;
80 _ATL_CATMAPFUNC* pfnGetCategoryMap;
81 void (WINAPI *pfnObjectMain)(BOOL bStarting);
82 }_ATL_OBJMAP_ENTRYA;
84 typedef struct _ATL_OBJMAP_ENTRYW_TAG
86 const CLSID* pclsid;
87 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
88 _ATL_CREATORFUNC* pfnGetClassObject;
89 _ATL_CREATORFUNC* pfnCreateInstance;
90 IUnknown* pCF;
91 DWORD dwRegister;
92 _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription;
93 _ATL_CATMAPFUNC* pfnGetCategoryMap;
94 void (WINAPI *pfnObjectMain)(BOOL bStarting);
95 } _ATL_OBJMAP_ENTRYW, _ATL_OBJMAP_ENTRY30, _ATL_OBJMAP_ENTRY;
98 typedef struct _ATL_TERMFUNC_ELEM_TAG
100 _ATL_TERMFUNC* pFunc;
101 DWORD_PTR dw;
102 struct _ATL_TERMFUNC_ELEM_TAG* pNext;
103 } _ATL_TERMFUNC_ELEM;
105 typedef struct _AtlCreateWndData_TAG
107 void* m_pThis;
108 DWORD m_dwThreadID;
109 struct _AtlCreateWndData_TAG* m_pNext;
110 } _AtlCreateWndData;
112 typedef struct _ATL_MODULEA_TAG
114 UINT cbSize;
115 HINSTANCE m_hInst;
116 HINSTANCE m_hInstResource;
117 HINSTANCE m_hInstTypeLib;
118 _ATL_OBJMAP_ENTRYA* m_pObjMap;
119 LONG m_nLockCnt;
120 HANDLE m_hHeap;
121 union
123 CRITICAL_SECTION m_csTypeInfoHolder;
124 CRITICAL_SECTION m_csStaticDataInit;
125 } u;
126 CRITICAL_SECTION m_csWindowCreate;
127 CRITICAL_SECTION m_csObjMap;
129 DWORD dwAtlBuildVer;
130 _AtlCreateWndData* m_pCreateWndList;
131 BOOL m_bDestroyHeap;
132 GUID* pguidVer;
133 DWORD m_dwHeaps;
134 HANDLE* m_phHeaps;
135 int m_nHeap;
136 _ATL_TERMFUNC_ELEM* m_pTermFuncs;
137 } _ATL_MODULEA;
139 typedef struct _ATL_MODULEW_TAG
141 UINT cbSize;
142 HINSTANCE m_hInst;
143 HINSTANCE m_hInstResource;
144 HINSTANCE m_hInstTypeLib;
145 _ATL_OBJMAP_ENTRYW* m_pObjMap;
146 LONG m_nLockCnt;
147 HANDLE m_hHeap;
148 union
150 CRITICAL_SECTION m_csTypeInfoHolder;
151 CRITICAL_SECTION m_csStaticDataInit;
152 } u;
153 CRITICAL_SECTION m_csWindowCreate;
154 CRITICAL_SECTION m_csObjMap;
156 DWORD dwAtlBuildVer;
157 _AtlCreateWndData* m_pCreateWndList;
158 BOOL m_bDestroyHeap;
159 GUID* pguidVer;
160 DWORD m_dwHeaps;
161 HANDLE* m_phHeaps;
162 int m_nHeap;
163 _ATL_TERMFUNC_ELEM* m_pTermFuncs;
164 } _ATL_MODULEW;
166 typedef struct
168 void *m_aT;
169 int m_nSize;
170 int m_nAllocSize;
171 } CSimpleArray;
173 typedef struct _ATL_MODULE70
175 UINT cbSize;
176 LONG m_nLockCnt;
177 _ATL_TERMFUNC_ELEM *m_pTermFuncs;
178 CComCriticalSection m_csStaticDataInitAndTypeInfo;
179 } _ATL_MODULE70;
181 typedef struct _ATL_WIN_MODULE70
183 UINT cbSize;
184 CComCriticalSection m_csWindowCreate;
185 _AtlCreateWndData *m_pCreateWndList;
186 CSimpleArray /* <ATOM> */ m_rgWindowClassAtoms;
187 } _ATL_WIN_MODULE70;
189 typedef struct _ATL_COM_MODULE70
191 UINT cbSize;
192 HINSTANCE m_hInstTypeLib;
193 _ATL_OBJMAP_ENTRY **m_ppAutoObjMapFirst;
194 _ATL_OBJMAP_ENTRY **m_ppAutoObjMapLast;
195 CComCriticalSection m_csObjMap;
196 } _ATL_COM_MODULE70, _ATL_COM_MODULE;
198 #if _ATL_VER >= _ATL_VER_70
199 typedef _ATL_MODULE70 _ATL_MODULE;
200 typedef _ATL_WIN_MODULE70 _ATL_WIN_MODULE;
201 #else
202 typedef _ATL_MODULEW _ATL_MODULE;
203 typedef _ATL_MODULEW _ATL_WIN_MODULE;
204 #endif
206 typedef struct _ATL_INTMAP_ENTRY_TAG
208 const IID* piid;
209 DWORD dw;
210 _ATL_CREATORARGFUNC* pFunc;
211 } _ATL_INTMAP_ENTRY;
213 struct _ATL_REGMAP_ENTRY
215 LPCOLESTR szKey;
216 LPCOLESTR szData;
219 struct _ATL_CATMAP_ENTRY
221 int iType;
222 const CATID *pcatid;
225 #define _ATL_CATMAP_ENTRY_END 0
226 #define _ATL_CATMAP_ENTRY_IMPLEMENTED 1
227 #define _ATL_CATMAP_ENTRY_REQUIRED 2
229 HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID * iid, LPDWORD dpw);
230 HRESULT WINAPI AtlAxAttachControl(IUnknown*,HWND,IUnknown**);
231 HRESULT WINAPI AtlAxCreateControl(LPCOLESTR,HWND,IStream*,IUnknown**);
232 HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR,HWND,IStream*,IUnknown**,IUnknown**,REFIID,IUnknown*);
233 HRESULT WINAPI AtlFreeMarshalStream(IStream *pStream);
234 HRESULT WINAPI AtlInternalQueryInterface(void* pThis, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, void** ppvObject);
235 HRESULT WINAPI AtlMarshalPtrInProc(IUnknown *pUnk, const IID *iid, IStream **ppStream);
236 void WINAPI AtlModuleAddCreateWndData(_ATL_MODULEW *pM, _AtlCreateWndData *pData, void* pvObject);
237 HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE*);
238 void WINAPI AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE*,_AtlCreateWndData*,void*);
239 void* WINAPI AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE*);
240 HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULE *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw);
241 void WINAPI AtlCallTermFunc(_ATL_MODULE*);
242 void* WINAPI AtlModuleExtractCreateWndData(_ATL_MODULEW *pM);
243 HRESULT WINAPI AtlModuleInit(_ATL_MODULEW* pM, _ATL_OBJMAP_ENTRYW* p, HINSTANCE h);
244 HRESULT WINAPI AtlModuleLoadTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib);
245 HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW* pM, DWORD dwClsContext, DWORD dwFlags);
246 HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* pCLSID);
247 HRESULT WINAPI AtlModuleRegisterTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex);
248 HRESULT WINAPI AtlModuleUnregisterServer(_ATL_MODULEW* pM, const CLSID* pCLSID);
249 HRESULT WINAPI AtlModuleUpdateRegistryFromResourceD(_ATL_MODULEW *pM, LPCOLESTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries, IRegistrar *pReg );
250 HRESULT WINAPI AtlModuleUnregisterServerEx(_ATL_MODULEW* pM, BOOL bUnRegTypeLib, const CLSID* pCLSID);
251 HRESULT WINAPI AtlModuleTerm(_ATL_MODULEW* pM);
252 HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID * iid, DWORD dw);
253 HRESULT WINAPI AtlUnmarshalPtr(IStream *pStream, const IID *iid, IUnknown **ppUnk);
254 HRESULT WINAPI AtlCreateRegistrar(IRegistrar**);
255 HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE,LPCOLESTR,BOOL,struct _ATL_REGMAP_ENTRY*,IRegistrar*);
256 HRESULT WINAPI AtlLoadTypeLib(HINSTANCE,LPCOLESTR,BSTR*,ITypeLib**);
257 HRESULT WINAPI AtlRegisterTypeLib(HINSTANCE,LPCOLESTR);
258 HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID,const struct _ATL_CATMAP_ENTRY*,BOOL);
259 HRESULT WINAPI AtlComModuleGetClassObject(_ATL_COM_MODULE*,REFCLSID,REFIID,void**);
260 HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE*,DWORD,DWORD);
261 HRESULT WINAPI AtlComModuleUnregisterServer(_ATL_COM_MODULE*,BOOL,const CLSID*);
262 BOOL WINAPI AtlWaitWithMessageLoop(HANDLE);
263 HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown*,GUID*,IID*,unsigned short*,unsigned short*);
264 HRESULT WINAPI AtlSetPerUserRegistration(unsigned char /*bool*/);
265 HRESULT WINAPI AtlGetPerUserRegistration(unsigned char /*bool*/ *);
267 #endif /* __WINE_ATLBASE_H__ */