msvcr100: Added _sprintf_p implementation.
[wine.git] / include / atlbase.h
blobce62474156a46f2c94f2546d713d723b6db8a085
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>
26 /* Wine extension: we (ab)use _ATL_VER to handle struct layout differences between ATL versions. */
27 #define _ATL_VER_30 0x0300
28 #define _ATL_VER_70 0x0700
29 #define _ATL_VER_80 0x0800
30 #define _ATL_VER_100 0x0a00
32 #ifndef _ATL_VER
33 #define _ATL_VER _ATL_VER_100
34 #endif
36 typedef HRESULT (WINAPI _ATL_CREATORFUNC)(void* pv, REFIID riid, LPVOID* ppv);
37 typedef HRESULT (WINAPI _ATL_CREATORARGFUNC)(void* pv, REFIID riid, LPVOID* ppv, DWORD dw);
38 typedef HRESULT (WINAPI _ATL_MODULEFUNC)(DWORD dw);
39 typedef LPCSTR (WINAPI _ATL_DESCRIPTIONFUNCA)(void);
40 typedef LPCWSTR (WINAPI _ATL_DESCRIPTIONFUNCW)(void);
41 typedef const struct _ATL_CATMAP_ENTRY* (_ATL_CATMAPFUNC)(void);
42 typedef void (WINAPI _ATL_TERMFUNC)(DWORD dw);
44 typedef CRITICAL_SECTION CComCriticalSection;
46 typedef struct _ATL_OBJMAP_ENTRYA_V1_TAG
48 const CLSID* pclsid;
49 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
50 _ATL_CREATORFUNC* pfnGetClassObject;
51 _ATL_CREATORFUNC* pfnCreateInstance;
52 IUnknown* pCF;
53 DWORD dwRegister;
54 _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription;
55 }_ATL_OBJMAP_ENTRYA_V1;
57 typedef struct _ATL_OBJMAP_ENTRYW_V1_TAG
59 const CLSID* pclsid;
60 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
61 _ATL_CREATORFUNC* pfnGetClassObject;
62 _ATL_CREATORFUNC* pfnCreateInstance;
63 IUnknown* pCF;
64 DWORD dwRegister;
65 _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription;
66 } _ATL_OBJMAP_ENTRYW_V1;
68 typedef struct _ATL_OBJMAP_ENTRYA_TAG
70 const CLSID* pclsid;
71 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
72 _ATL_CREATORFUNC* pfnGetClassObject;
73 _ATL_CREATORFUNC* pfnCreateInstance;
74 IUnknown* pCF;
75 DWORD dwRegister;
76 _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription;
77 _ATL_CATMAPFUNC* pfnGetCategoryMap;
78 void (WINAPI *pfnObjectMain)(BOOL bStarting);
79 }_ATL_OBJMAP_ENTRYA;
81 typedef struct _ATL_OBJMAP_ENTRYW_TAG
83 const CLSID* pclsid;
84 HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
85 _ATL_CREATORFUNC* pfnGetClassObject;
86 _ATL_CREATORFUNC* pfnCreateInstance;
87 IUnknown* pCF;
88 DWORD dwRegister;
89 _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription;
90 _ATL_CATMAPFUNC* pfnGetCategoryMap;
91 void (WINAPI *pfnObjectMain)(BOOL bStarting);
92 } _ATL_OBJMAP_ENTRYW;
95 typedef struct _ATL_TERMFUNC_ELEM_TAG
97 _ATL_TERMFUNC* pFunc;
98 DWORD_PTR dw;
99 struct _ATL_TERMFUNC_ELEM_TAG* pNext;
100 } _ATL_TERMFUNC_ELEM;
102 typedef struct _AtlCreateWndData_TAG
104 void* m_pThis;
105 DWORD m_dwThreadID;
106 struct _AtlCreateWndData_TAG* m_pNext;
107 } _AtlCreateWndData;
109 typedef struct _ATL_MODULEA_TAG
111 UINT cbSize;
112 HINSTANCE m_hInst;
113 HINSTANCE m_hInstResource;
114 HINSTANCE m_hInstTypeLib;
115 _ATL_OBJMAP_ENTRYA* m_pObjMap;
116 LONG m_nLockCnt;
117 HANDLE m_hHeap;
118 union
120 CRITICAL_SECTION m_csTypeInfoHolder;
121 CRITICAL_SECTION m_csStaticDataInit;
122 } u;
123 CRITICAL_SECTION m_csWindowCreate;
124 CRITICAL_SECTION m_csObjMap;
126 DWORD dwAtlBuildVer;
127 _AtlCreateWndData* m_pCreateWndList;
128 BOOL m_bDestroyHeap;
129 GUID* pguidVer;
130 DWORD m_dwHeaps;
131 HANDLE* m_phHeaps;
132 int m_nHeap;
133 _ATL_TERMFUNC_ELEM* m_pTermFuncs;
134 } _ATL_MODULEA;
136 typedef struct _ATL_MODULEW_TAG
138 UINT cbSize;
139 HINSTANCE m_hInst;
140 HINSTANCE m_hInstResource;
141 HINSTANCE m_hInstTypeLib;
142 _ATL_OBJMAP_ENTRYW* m_pObjMap;
143 LONG m_nLockCnt;
144 HANDLE m_hHeap;
145 union
147 CRITICAL_SECTION m_csTypeInfoHolder;
148 CRITICAL_SECTION m_csStaticDataInit;
149 } u;
150 CRITICAL_SECTION m_csWindowCreate;
151 CRITICAL_SECTION m_csObjMap;
153 DWORD dwAtlBuildVer;
154 _AtlCreateWndData* m_pCreateWndList;
155 BOOL m_bDestroyHeap;
156 GUID* pguidVer;
157 DWORD m_dwHeaps;
158 HANDLE* m_phHeaps;
159 int m_nHeap;
160 _ATL_TERMFUNC_ELEM* m_pTermFuncs;
161 } _ATL_MODULEW;
163 typedef struct _ATL_MODULE70
165 UINT cbSize;
166 LONG m_nLockCnt;
167 _ATL_TERMFUNC_ELEM *m_pTermFuncs;
168 CComCriticalSection m_csStaticDataInitAndTypeInfo;
169 } _ATL_MODULE70;
171 #if _ATL_VER >= _ATL_VER_70
172 typedef _ATL_MODULE70 _ATL_MODULE;
173 #else
174 typedef _ATL_MODULEW _ATL_MODULE;
175 #endif
177 typedef struct _ATL_INTMAP_ENTRY_TAG
179 const IID* piid;
180 DWORD dw;
181 _ATL_CREATORARGFUNC* pFunc;
182 } _ATL_INTMAP_ENTRY;
184 struct _ATL_REGMAP_ENTRY
186 LPCOLESTR szKey;
187 LPCOLESTR szData;
190 HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID * iid, LPDWORD dpw);
191 HRESULT WINAPI AtlAxAttachControl(IUnknown*,HWND,IUnknown**);
192 HRESULT WINAPI AtlAxCreateControl(LPCOLESTR,HWND,IStream*,IUnknown**);
193 HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR,HWND,IStream*,IUnknown**,IUnknown**,REFIID,IUnknown*);
194 HRESULT WINAPI AtlFreeMarshalStream(IStream *pStream);
195 HRESULT WINAPI AtlInternalQueryInterface(void* pThis, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, void** ppvObject);
196 HRESULT WINAPI AtlMarshalPtrInProc(IUnknown *pUnk, const IID *iid, IStream **ppStream);
197 void WINAPI AtlModuleAddCreateWndData(_ATL_MODULEW *pM, _AtlCreateWndData *pData, void* pvObject);
198 HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULE *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR dw);
199 void WINAPI AtlCallTermFunc(_ATL_MODULE*);
200 void* WINAPI AtlModuleExtractCreateWndData(_ATL_MODULEW *pM);
201 HRESULT WINAPI AtlModuleInit(_ATL_MODULEW* pM, _ATL_OBJMAP_ENTRYW* p, HINSTANCE h);
202 HRESULT WINAPI AtlModuleLoadTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex, BSTR *pbstrPath, ITypeLib **ppTypeLib);
203 HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW* pM, DWORD dwClsContext, DWORD dwFlags);
204 HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* pCLSID);
205 HRESULT WINAPI AtlModuleRegisterTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex);
206 HRESULT WINAPI AtlModuleUnregisterServer(_ATL_MODULEW* pM, const CLSID* pCLSID);
207 HRESULT WINAPI AtlModuleUpdateRegistryFromResourceD(_ATL_MODULEW *pM, LPCOLESTR lpszRes, BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries, IRegistrar *pReg );
208 HRESULT WINAPI AtlModuleUnregisterServerEx(_ATL_MODULEW* pM, BOOL bUnRegTypeLib, const CLSID* pCLSID);
209 HRESULT WINAPI AtlModuleTerm(_ATL_MODULEW* pM);
210 HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID * iid, DWORD dw);
211 HRESULT WINAPI AtlUnmarshalPtr(IStream *pStream, const IID *iid, IUnknown **ppUnk);
212 HRESULT WINAPI AtlCreateRegistrar(IRegistrar**);
213 HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE,LPCOLESTR,BOOL,struct _ATL_REGMAP_ENTRY*,IRegistrar*);
214 HRESULT WINAPI AtlLoadTypeLib(HINSTANCE,LPCOLESTR,BSTR*,ITypeLib**);
216 #endif /* __WINE_ATLBASE_H__ */