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__
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
34 #define _ATL_VER _ATL_VER_100
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
50 HRESULT (WINAPI
*pfnUpdateRegistry
)(BOOL bRegister
);
51 _ATL_CREATORFUNC
* pfnGetClassObject
;
52 _ATL_CREATORFUNC
* pfnCreateInstance
;
55 _ATL_DESCRIPTIONFUNCA
* pfnGetObjectDescription
;
56 }_ATL_OBJMAP_ENTRYA_V1
;
58 typedef struct _ATL_OBJMAP_ENTRYW_V1_TAG
61 HRESULT (WINAPI
*pfnUpdateRegistry
)(BOOL bRegister
);
62 _ATL_CREATORFUNC
* pfnGetClassObject
;
63 _ATL_CREATORFUNC
* pfnCreateInstance
;
66 _ATL_DESCRIPTIONFUNCW
* pfnGetObjectDescription
;
67 } _ATL_OBJMAP_ENTRYW_V1
;
69 typedef struct _ATL_OBJMAP_ENTRYA_TAG
72 HRESULT (WINAPI
*pfnUpdateRegistry
)(BOOL bRegister
);
73 _ATL_CREATORFUNC
* pfnGetClassObject
;
74 _ATL_CREATORFUNC
* pfnCreateInstance
;
77 _ATL_DESCRIPTIONFUNCA
* pfnGetObjectDescription
;
78 _ATL_CATMAPFUNC
* pfnGetCategoryMap
;
79 void (WINAPI
*pfnObjectMain
)(BOOL bStarting
);
82 typedef struct _ATL_OBJMAP_ENTRYW_TAG
85 HRESULT (WINAPI
*pfnUpdateRegistry
)(BOOL bRegister
);
86 _ATL_CREATORFUNC
* pfnGetClassObject
;
87 _ATL_CREATORFUNC
* pfnCreateInstance
;
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
100 struct _ATL_TERMFUNC_ELEM_TAG
* pNext
;
101 } _ATL_TERMFUNC_ELEM
;
103 typedef struct _AtlCreateWndData_TAG
107 struct _AtlCreateWndData_TAG
* m_pNext
;
110 typedef struct _ATL_MODULEA_TAG
114 HINSTANCE m_hInstResource
;
115 HINSTANCE m_hInstTypeLib
;
116 _ATL_OBJMAP_ENTRYA
* m_pObjMap
;
121 CRITICAL_SECTION m_csTypeInfoHolder
;
122 CRITICAL_SECTION m_csStaticDataInit
;
124 CRITICAL_SECTION m_csWindowCreate
;
125 CRITICAL_SECTION m_csObjMap
;
128 _AtlCreateWndData
* m_pCreateWndList
;
134 _ATL_TERMFUNC_ELEM
* m_pTermFuncs
;
137 typedef struct _ATL_MODULEW_TAG
141 HINSTANCE m_hInstResource
;
142 HINSTANCE m_hInstTypeLib
;
143 _ATL_OBJMAP_ENTRYW
* m_pObjMap
;
148 CRITICAL_SECTION m_csTypeInfoHolder
;
149 CRITICAL_SECTION m_csStaticDataInit
;
151 CRITICAL_SECTION m_csWindowCreate
;
152 CRITICAL_SECTION m_csObjMap
;
155 _AtlCreateWndData
* m_pCreateWndList
;
161 _ATL_TERMFUNC_ELEM
* m_pTermFuncs
;
171 typedef struct _ATL_MODULE70
175 _ATL_TERMFUNC_ELEM
*m_pTermFuncs
;
176 CComCriticalSection m_csStaticDataInitAndTypeInfo
;
179 typedef struct _ATL_WIN_MODULE70
182 CComCriticalSection m_csWindowCreate
;
183 _AtlCreateWndData
*m_pCreateWndList
;
184 CSimpleArray
/* <ATOM> */ m_rgWindowClassAtoms
;
187 typedef struct _ATL_COM_MODULE70
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
;
200 typedef _ATL_MODULEW _ATL_MODULE
;
201 typedef _ATL_MODULEW _ATL_WIN_MODULE
;
204 typedef struct _ATL_INTMAP_ENTRY_TAG
208 _ATL_CREATORARGFUNC
* pFunc
;
211 struct _ATL_REGMAP_ENTRY
217 struct _ATL_CATMAP_ENTRY
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
AtlComModuleUnregisterServer(_ATL_COM_MODULE
*,BOOL
,const CLSID
*);
259 BOOL WINAPI
AtlWaitWithMessageLoop(HANDLE
);
260 HRESULT WINAPI
AtlGetObjectSourceInterface(IUnknown
*,GUID
*,IID
*,unsigned short*,unsigned short*);
261 HRESULT WINAPI
AtlGetPerUserRegistration(unsigned char /*bool*/ *);
263 #endif /* __WINE_ATLBASE_H__ */