1*cdf0e10cSrcweir--- include/atl/atlbase.h.orig	2005-04-14 17:54:32.000000000 +0900
2*cdf0e10cSrcweir+++ include/atl/atlbase.h	2007-12-23 14:38:02.467500000 +0900
3*cdf0e10cSrcweir@@ -10,6 +10,9 @@
4*cdf0e10cSrcweir
5*cdf0e10cSrcweir #ifndef __ATLBASE_H__
6*cdf0e10cSrcweir #define __ATLBASE_H__
7*cdf0e10cSrcweir+#if __GNUC__ >=3
8*cdf0e10cSrcweir+#pragma GCC system_header
9*cdf0e10cSrcweir+#endif
10*cdf0e10cSrcweir
11*cdf0e10cSrcweir #ifndef __cplusplus
12*cdf0e10cSrcweir         #error ATL requires C++ compilation (use a .cpp suffix)
13*cdf0e10cSrcweir@@ -73,19 +76,47 @@
14*cdf0e10cSrcweir #define _ATL_TYPELIB_INDEX_LENGTH 10
15*cdf0e10cSrcweir #define _ATL_QUOTES_SPACE 2
16*cdf0e10cSrcweir
17*cdf0e10cSrcweir-#pragma pack(push, _ATL_PACKING)
18*cdf0e10cSrcweir+#pragma pack(push, 8)
19*cdf0e10cSrcweir
20*cdf0e10cSrcweir #if defined(_ATL_DLL)
21*cdf0e10cSrcweir         #pragma comment(lib, "atl.lib")
22*cdf0e10cSrcweir #endif
23*cdf0e10cSrcweir
24*cdf0e10cSrcweir-extern "C" const __declspec(selectany) GUID LIBID_ATLLib = {0x44EC0535,0x400F,0x11D0,{0x9D,0xCD,0x00,0xA0,0xC9,0x03,0x91,0xD3}};
25*cdf0e10cSrcweir-extern "C" const __declspec(selectany) CLSID CLSID_Registrar = {0x44EC053A,0x400F,0x11D0,{0x9D,0xCD,0x00,0xA0,0xC9,0x03,0x91,0xD3}};
26*cdf0e10cSrcweir-extern "C" const __declspec(selectany) IID IID_IRegistrar = {0x44EC053B,0x400F,0x11D0,{0x9D,0xCD,0x00,0xA0,0xC9,0x03,0x91,0xD3}};
27*cdf0e10cSrcweir-extern "C" const __declspec(selectany) IID IID_IAxWinHostWindow = {0xb6ea2050,0x48a,0x11d1,{0x82,0xb9,0x0,0xc0,0x4f,0xb9,0x94,0x2e}};
28*cdf0e10cSrcweir-extern "C" const __declspec(selectany) IID IID_IAxWinAmbientDispatch = {0xb6ea2051,0x48a,0x11d1,{0x82,0xb9,0x0,0xc0,0x4f,0xb9,0x94,0x2e}};
29*cdf0e10cSrcweir-extern "C" const __declspec(selectany) IID IID_IInternalConnection = {0x72AD0770,0x6A9F,0x11d1,{0xBC,0xEC,0x00,0x60,0x08,0x8F,0x44,0x4E}};
30*cdf0e10cSrcweir-extern "C" const __declspec(selectany) IID IID_IDocHostUIHandlerDispatch = {0x425B5AF0,0x65F1,0x11d1,{0x96,0x11,0x00,0x00,0xF8,0x1E,0x0D,0x0D}};
31*cdf0e10cSrcweir+#define __uuidof(I) IID_##I
32*cdf0e10cSrcweir+
33*cdf0e10cSrcweir+#include <excpt.h>
34*cdf0e10cSrcweir+
35*cdf0e10cSrcweir+namespace ATL
36*cdf0e10cSrcweir+{
37*cdf0e10cSrcweir+inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
38*cdf0e10cSrcweir+{
39*cdf0e10cSrcweir+   return (
40*cdf0e10cSrcweir+      ((unsigned long *) &rguid1)[0] == ((unsigned long *) &rguid2)[0] &&
41*cdf0e10cSrcweir+      ((unsigned long *) &rguid1)[1] == ((unsigned long *) &rguid2)[1] &&
42*cdf0e10cSrcweir+      ((unsigned long *) &rguid1)[2] == ((unsigned long *) &rguid2)[2] &&
43*cdf0e10cSrcweir+      ((unsigned long *) &rguid1)[3] == ((unsigned long *) &rguid2)[3]);
44*cdf0e10cSrcweir+}
45*cdf0e10cSrcweir+}
46*cdf0e10cSrcweir+
47*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
48*cdf0e10cSrcweir+extern "C" const GUID LIBID_ATLLib = {0x44EC0535,0x400F,0x11D0,{0x9D,0xCD,0x00,0xA0,0xC9,0x03,0x91,0xD3}};
49*cdf0e10cSrcweir+extern "C" const CLSID CLSID_Registrar = {0x44EC053A,0x400F,0x11D0,{0x9D,0xCD,0x00,0xA0,0xC9,0x03,0x91,0xD3}};
50*cdf0e10cSrcweir+extern "C" const IID IID_IRegistrar = {0x44EC053B,0x400F,0x11D0,{0x9D,0xCD,0x00,0xA0,0xC9,0x03,0x91,0xD3}};
51*cdf0e10cSrcweir+extern "C" const IID IID_IAxWinHostWindow = {0xb6ea2050,0x48a,0x11d1,{0x82,0xb9,0x0,0xc0,0x4f,0xb9,0x94,0x2e}};
52*cdf0e10cSrcweir+extern "C" const IID IID_IAxWinAmbientDispatch = {0xb6ea2051,0x48a,0x11d1,{0x82,0xb9,0x0,0xc0,0x4f,0xb9,0x94,0x2e}};
53*cdf0e10cSrcweir+extern "C" const IID IID_IInternalConnection = {0x72AD0770,0x6A9F,0x11d1,{0xBC,0xEC,0x00,0x60,0x08,0x8F,0x44,0x4E}};
54*cdf0e10cSrcweir+extern "C" const IID IID_IDocHostUIHandlerDispatch = {0x425B5AF0,0x65F1,0x11d1,{0x96,0x11,0x00,0x00,0xF8,0x1E,0x0D,0x0D}};
55*cdf0e10cSrcweir+#else
56*cdf0e10cSrcweir+extern "C" {
57*cdf0e10cSrcweir+extern const GUID LIBID_ATLLib;
58*cdf0e10cSrcweir+extern const CLSID CLSID_Registrar;
59*cdf0e10cSrcweir+extern const IID IID_IRegistrar;
60*cdf0e10cSrcweir+extern const IID IID_IAxWinHostWindow;
61*cdf0e10cSrcweir+extern const IID IID_IAxWinAmbientDispatch;
62*cdf0e10cSrcweir+extern const IID IID_IInternalConnection;
63*cdf0e10cSrcweir+extern const IID IID_IDocHostUIHandlerDispatch;
64*cdf0e10cSrcweir+}
65*cdf0e10cSrcweir+#endif
66*cdf0e10cSrcweir
67*cdf0e10cSrcweir #ifndef _ATL_DLL_IMPL
68*cdf0e10cSrcweir namespace ATL
69*cdf0e10cSrcweir@@ -135,7 +166,7 @@
70*cdf0e10cSrcweir                 IUnknown* p = NULL;
71*cdf0e10cSrcweir                 if (pfnGetClassObject == NULL)
72*cdf0e10cSrcweir                         return S_OK;
73*cdf0e10cSrcweir-                HRESULT hRes = pfnGetClassObject(pfnCreateInstance, IID_IUnknown, (LPVOID*) &p);
74*cdf0e10cSrcweir+                HRESULT hRes = pfnGetClassObject((LPVOID)pfnCreateInstance, IID_IUnknown, (LPVOID*) &p);
75*cdf0e10cSrcweir                 if (SUCCEEDED(hRes))
76*cdf0e10cSrcweir                         hRes = CoRegisterClassObject(*pclsid, p, dwClsContext, dwFlags, &dwRegister);
77*cdf0e10cSrcweir                 if (p != NULL)
78*cdf0e10cSrcweir@@ -284,13 +315,15 @@
79*cdf0e10cSrcweir };
80*cdf0e10cSrcweir #pragma pack(pop)
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir-PVOID __stdcall __AllocStdCallThunk(VOID);
83*cdf0e10cSrcweir-VOID  __stdcall __FreeStdCallThunk(PVOID);
84*cdf0e10cSrcweir+//PVOID __stdcall __AllocStdCallThunk(VOID);
85*cdf0e10cSrcweir+//VOID  __stdcall __FreeStdCallThunk(PVOID);
86*cdf0e10cSrcweir
87*cdf0e10cSrcweir-#define AllocStdCallThunk() __AllocStdCallThunk()
88*cdf0e10cSrcweir-#define FreeStdCallThunk(p) __FreeStdCallThunk(p)
89*cdf0e10cSrcweir+//#define AllocStdCallThunk() __AllocStdCallThunk()
90*cdf0e10cSrcweir+//#define FreeStdCallThunk(p) __FreeStdCallThunk(p)
91*cdf0e10cSrcweir
92*cdf0e10cSrcweir-#pragma comment(lib, "atlthunk.lib")
93*cdf0e10cSrcweir+//#pragma comment(lib, "atlthunk.lib")
94*cdf0e10cSrcweir+#define AllocStdCallThunk() HeapAlloc(GetProcessHeap(),0,sizeof(_stdcallthunk))
95*cdf0e10cSrcweir+#define FreeStdCallThunk(p) HeapFree(GetProcessHeap(), 0, p)
96*cdf0e10cSrcweir
97*cdf0e10cSrcweir #elif defined (_M_AMD64)
98*cdf0e10cSrcweir #pragma pack(push,2)
99*cdf0e10cSrcweir@@ -465,7 +498,7 @@
100*cdf0e10cSrcweir         return( HRESULT_FROM_WIN32( nError ) );
101*cdf0e10cSrcweir }
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir-inline void __declspec(noreturn) _AtlRaiseException( DWORD dwExceptionCode, DWORD dwExceptionFlags = EXCEPTION_NONCONTINUABLE )
104*cdf0e10cSrcweir+inline void _AtlRaiseException( DWORD dwExceptionCode, DWORD dwExceptionFlags = EXCEPTION_NONCONTINUABLE )
105*cdf0e10cSrcweir {
106*cdf0e10cSrcweir         RaiseException( dwExceptionCode, dwExceptionFlags, 0, NULL );
107*cdf0e10cSrcweir }
108*cdf0e10cSrcweir@@ -658,6 +691,7 @@
109*cdf0e10cSrcweir class _NoAddRefReleaseOnCComPtr : public T
110*cdf0e10cSrcweir {
111*cdf0e10cSrcweir         private:
112*cdf0e10cSrcweir+                _NoAddRefReleaseOnCComPtr();
113*cdf0e10cSrcweir                 STDMETHOD_(ULONG, AddRef)()=0;
114*cdf0e10cSrcweir                 STDMETHOD_(ULONG, Release)()=0;
115*cdf0e10cSrcweir };
116*cdf0e10cSrcweir@@ -781,6 +815,7 @@
117*cdf0e10cSrcweir         {
118*cdf0e10cSrcweir                 return AtlAdvise(p, pUnk, iid, pdw);
119*cdf0e10cSrcweir         }
120*cdf0e10cSrcweir+#if 0
121*cdf0e10cSrcweir         HRESULT CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
122*cdf0e10cSrcweir         {
123*cdf0e10cSrcweir                 ATLASSERT(p == NULL);
124*cdf0e10cSrcweir@@ -801,11 +836,12 @@
125*cdf0e10cSrcweir                 ATLASSERT(pp != NULL && *pp == NULL);
126*cdf0e10cSrcweir                 return p->QueryInterface(__uuidof(Q), (void**)pp);
127*cdf0e10cSrcweir         }
128*cdf0e10cSrcweir+#endif
129*cdf0e10cSrcweir         T* p;
130*cdf0e10cSrcweir };
131*cdf0e10cSrcweir
132*cdf0e10cSrcweir
133*cdf0e10cSrcweir-template <class T, const IID* piid = &__uuidof(T)>
134*cdf0e10cSrcweir+template <class T, const IID* piid>
135*cdf0e10cSrcweir class CComQIPtr
136*cdf0e10cSrcweir {
137*cdf0e10cSrcweir public:
138*cdf0e10cSrcweir@@ -933,6 +969,7 @@
139*cdf0e10cSrcweir         {
140*cdf0e10cSrcweir                 return AtlAdvise(p, pUnk, iid, pdw);
141*cdf0e10cSrcweir         }
142*cdf0e10cSrcweir+#if 0
143*cdf0e10cSrcweir         HRESULT CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
144*cdf0e10cSrcweir         {
145*cdf0e10cSrcweir                 ATLASSERT(p == NULL);
146*cdf0e10cSrcweir@@ -953,6 +990,7 @@
147*cdf0e10cSrcweir                 ATLASSERT(pp != NULL && *pp == NULL);
148*cdf0e10cSrcweir                 return p->QueryInterface(__uuidof(Q), (void**)pp);
149*cdf0e10cSrcweir         }
150*cdf0e10cSrcweir+#endif
151*cdf0e10cSrcweir         T* p;
152*cdf0e10cSrcweir };
153*cdf0e10cSrcweir
154*cdf0e10cSrcweir@@ -1087,12 +1125,14 @@
155*cdf0e10cSrcweir                         hr = ::CoCreateInstance(clsid, pUnkOuter, dwClsContext, __uuidof(IUnknown), (void**)&p);
156*cdf0e10cSrcweir                 return hr;
157*cdf0e10cSrcweir         }
158*cdf0e10cSrcweir+#if 0
159*cdf0e10cSrcweir         template <class Q>
160*cdf0e10cSrcweir         HRESULT QueryInterface(Q** pp)
161*cdf0e10cSrcweir         {
162*cdf0e10cSrcweir                 ATLASSERT(pp != NULL && *pp == NULL);
163*cdf0e10cSrcweir                 return p->QueryInterface(__uuidof(Q), (void**)pp);
164*cdf0e10cSrcweir         }
165*cdf0e10cSrcweir+#endif
166*cdf0e10cSrcweir         IUnknown* p;
167*cdf0e10cSrcweir };
168*cdf0e10cSrcweir
169*cdf0e10cSrcweir@@ -1257,21 +1297,26 @@
170*cdf0e10cSrcweir 		LeaveCriticalSection(&m_sec);
171*cdf0e10cSrcweir 		return S_OK;
172*cdf0e10cSrcweir 	}
173*cdf0e10cSrcweir+	static void _InitHandler(void *pData, LPEXCEPTION_POINTERS ep)
174*cdf0e10cSrcweir+	  {
175*cdf0e10cSrcweir+	    HRESULT &hRes=*reinterpret_cast<HRESULT*>(pData);
176*cdf0e10cSrcweir+			if (STATUS_NO_MEMORY == ep->ExceptionRecord->ExceptionCode)
177*cdf0e10cSrcweir+				hRes = E_OUTOFMEMORY;
178*cdf0e10cSrcweir+			else
179*cdf0e10cSrcweir+				hRes = E_FAIL;
180*cdf0e10cSrcweir+	  }
181*cdf0e10cSrcweir 	HRESULT Init() throw()
182*cdf0e10cSrcweir 	{
183*cdf0e10cSrcweir 		HRESULT hRes = S_OK;
184*cdf0e10cSrcweir-		__try
185*cdf0e10cSrcweir-		{
186*cdf0e10cSrcweir+                jmp_buf _sejmpbuf;
187*cdf0e10cSrcweir+                __SEHandler _sehandler;
188*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0)
189*cdf0e10cSrcweir+                {
190*cdf0e10cSrcweir+                        _sehandler.Set(_sejmpbuf, &hRes, reinterpret_cast<__SEHandler::PF>(EXCEPTION_EXECUTE_HANDLER), _InitHandler);
191*cdf0e10cSrcweir 			InitializeCriticalSection(&m_sec);
192*cdf0e10cSrcweir-		}
193*cdf0e10cSrcweir+                }
194*cdf0e10cSrcweir 		// structured exception may be raised in low memory situations
195*cdf0e10cSrcweir-		__except(EXCEPTION_EXECUTE_HANDLER)
196*cdf0e10cSrcweir-		{
197*cdf0e10cSrcweir-			if (STATUS_NO_MEMORY == GetExceptionCode())
198*cdf0e10cSrcweir-				hRes = E_OUTOFMEMORY;
199*cdf0e10cSrcweir-			else
200*cdf0e10cSrcweir-				hRes = E_FAIL;
201*cdf0e10cSrcweir-		}
202*cdf0e10cSrcweir+                _sehandler.Reset();
203*cdf0e10cSrcweir 		return hRes;
204*cdf0e10cSrcweir 	}
205*cdf0e10cSrcweir
206*cdf0e10cSrcweir@@ -2799,10 +2844,19 @@
207*cdf0e10cSrcweir
208*cdf0e10cSrcweir
209*cdf0e10cSrcweir class CComModule;
210*cdf0e10cSrcweir-__declspec(selectany) CComModule* _pModule=NULL;
211*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
212*cdf0e10cSrcweir+CComModule* _pModule=NULL;
213*cdf0e10cSrcweir+#else
214*cdf0e10cSrcweir+extern CComModule* _pModule;
215*cdf0e10cSrcweir+#endif
216*cdf0e10cSrcweir+
217*cdf0e10cSrcweir
218*cdf0e10cSrcweir // {B62F5910-6528-11d1-9611-0000F81E0D0D}
219*cdf0e10cSrcweir-_declspec(selectany) GUID GUID_ATLVer30 = { 0xb62f5910, 0x6528, 0x11d1, { 0x96, 0x11, 0x0, 0x0, 0xf8, 0x1e, 0xd, 0xd } };
220*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
221*cdf0e10cSrcweir+GUID GUID_ATLVer30 = { 0xb62f5910, 0x6528, 0x11d1, { 0x96, 0x11, 0x0, 0x0, 0xf8, 0x1e, 0xd, 0xd } };
222*cdf0e10cSrcweir+#else
223*cdf0e10cSrcweir+extern GUID GUID_ATLVer30;
224*cdf0e10cSrcweir+#endif
225*cdf0e10cSrcweir
226*cdf0e10cSrcweir class CComModule : public _ATL_MODULE
227*cdf0e10cSrcweir {
228*cdf0e10cSrcweir@@ -4286,7 +4340,9 @@
229*cdf0e10cSrcweir
230*cdf0e10cSrcweir #endif
231*cdf0e10cSrcweir
232*cdf0e10cSrcweir-__declspec(selectany) GUID CComModule::m_libid = {0x0,0x0,0x0,{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}};
233*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
234*cdf0e10cSrcweir+GUID CComModule::m_libid = {0x0,0x0,0x0,{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}};
235*cdf0e10cSrcweir+#endif
236*cdf0e10cSrcweir
237*cdf0e10cSrcweir #ifdef _ATL_STATIC_REGISTRY
238*cdf0e10cSrcweir #define UpdateRegistryFromResource UpdateRegistryFromResourceS
239*cdf0e10cSrcweir@@ -4355,7 +4411,9 @@
240*cdf0e10cSrcweir         LONG m_nLockCnt;
241*cdf0e10cSrcweir };
242*cdf0e10cSrcweir
243*cdf0e10cSrcweir-__declspec(selectany) UINT CComApartment::ATL_CREATE_OBJECT = 0;
244*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
245*cdf0e10cSrcweir+UINT CComApartment::ATL_CREATE_OBJECT = 0;
246*cdf0e10cSrcweir+#endif
247*cdf0e10cSrcweir
248*cdf0e10cSrcweir class CComSimpleThreadAllocator
249*cdf0e10cSrcweir {
250*cdf0e10cSrcweir@@ -5855,6 +5913,10 @@
251*cdf0e10cSrcweir                 }
252*cdf0e10cSrcweir
253*cdf0e10cSrcweir         }
254*cdf0e10cSrcweir+        static int _Except(void *pThis, LPEXCEPTION_POINTERS lpEP)
255*cdf0e10cSrcweir+        {
256*cdf0e10cSrcweir+	  return reinterpret_cast<CVirtualBuffer *>(pThis)->Except(lpEP);
257*cdf0e10cSrcweir+	}
258*cdf0e10cSrcweir         void Seek(int nElement)
259*cdf0e10cSrcweir         {
260*cdf0e10cSrcweir                 if(nElement < 0 || nElement >= m_nMaxElements)
261*cdf0e10cSrcweir@@ -5866,41 +5928,53 @@
262*cdf0e10cSrcweir         {
263*cdf0e10cSrcweir                 if(nElement < 0 || nElement >= m_nMaxElements)
264*cdf0e10cSrcweir                         _AtlRaiseException((DWORD)EXCEPTION_ARRAY_BOUNDS_EXCEEDED);
265*cdf0e10cSrcweir-                __try
266*cdf0e10cSrcweir+                jmp_buf _sejmpbuf;
267*cdf0e10cSrcweir+                __SEHandler _sehandler;
268*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0)
269*cdf0e10cSrcweir                 {
270*cdf0e10cSrcweir+                        _sehandler.Set(_sejmpbuf, this, _Except);
271*cdf0e10cSrcweir                         T* p = &m_pBase[nElement];
272*cdf0e10cSrcweir                         *p = Element;
273*cdf0e10cSrcweir                         m_pTop = p > m_pTop ? p : m_pTop;
274*cdf0e10cSrcweir                 }
275*cdf0e10cSrcweir-                __except(Except(GetExceptionInformation()))
276*cdf0e10cSrcweir+                else
277*cdf0e10cSrcweir                 {
278*cdf0e10cSrcweir                 }
279*cdf0e10cSrcweir+                _sehandler.Reset();
280*cdf0e10cSrcweir
281*cdf0e10cSrcweir         }
282*cdf0e10cSrcweir         template <class Q>
283*cdf0e10cSrcweir         void WriteBulk(Q& helper)
284*cdf0e10cSrcweir         {
285*cdf0e10cSrcweir-                __try
286*cdf0e10cSrcweir+                jmp_buf _sejmpbuf;
287*cdf0e10cSrcweir+                __SEHandler _sehandler;
288*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0)
289*cdf0e10cSrcweir                 {
290*cdf0e10cSrcweir+                        _sehandler.Set(_sejmpbuf, this, _Except);
291*cdf0e10cSrcweir                         m_pCurrent = helper(m_pBase);
292*cdf0e10cSrcweir                         m_pTop = m_pCurrent > m_pTop ? m_pCurrent : m_pTop;
293*cdf0e10cSrcweir                 }
294*cdf0e10cSrcweir-                __except(Except(GetExceptionInformation()))
295*cdf0e10cSrcweir+                else
296*cdf0e10cSrcweir                 {
297*cdf0e10cSrcweir                 }
298*cdf0e10cSrcweir+                _sehandler.Reset();
299*cdf0e10cSrcweir         }
300*cdf0e10cSrcweir         void Write(const T& Element)
301*cdf0e10cSrcweir         {
302*cdf0e10cSrcweir             if (m_pCurrent < &m_pBase[m_nMaxElements]) {
303*cdf0e10cSrcweir-                __try
304*cdf0e10cSrcweir+                jmp_buf _sejmpbuf;
305*cdf0e10cSrcweir+                __SEHandler _sehandler;
306*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0)
307*cdf0e10cSrcweir                 {
308*cdf0e10cSrcweir+                    _sehandler.Set(_sejmpbuf, this, _Except);
309*cdf0e10cSrcweir                     *m_pCurrent = Element;
310*cdf0e10cSrcweir                     m_pCurrent++;
311*cdf0e10cSrcweir                     m_pTop = m_pCurrent > m_pTop ? m_pCurrent : m_pTop;
312*cdf0e10cSrcweir                 }
313*cdf0e10cSrcweir-                __except(Except(GetExceptionInformation()))
314*cdf0e10cSrcweir+                else
315*cdf0e10cSrcweir                 {
316*cdf0e10cSrcweir                 }
317*cdf0e10cSrcweir+                _sehandler.Reset();
318*cdf0e10cSrcweir             }
319*cdf0e10cSrcweir         }
320*cdf0e10cSrcweir         T& Read()
321*cdf0e10cSrcweir@@ -5910,14 +5984,18 @@
322*cdf0e10cSrcweir         operator BSTR()
323*cdf0e10cSrcweir         {
324*cdf0e10cSrcweir                 BSTR bstrTemp = NULL ;
325*cdf0e10cSrcweir-                __try
326*cdf0e10cSrcweir+                jmp_buf _sejmpbuf;
327*cdf0e10cSrcweir+                __SEHandler _sehandler;
328*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0)
329*cdf0e10cSrcweir                 {
330*cdf0e10cSrcweir+                        _sehandler.Set(_sejmpbuf, this, _Except);
331*cdf0e10cSrcweir                         bstrTemp = SysAllocStringByteLen((char*) m_pBase,
332*cdf0e10cSrcweir                                 (UINT) ((BYTE*)m_pTop - (BYTE*)m_pBase));
333*cdf0e10cSrcweir                 }
334*cdf0e10cSrcweir-                __except(Except(GetExceptionInformation()))
335*cdf0e10cSrcweir+                else
336*cdf0e10cSrcweir                 {
337*cdf0e10cSrcweir                 }
338*cdf0e10cSrcweir+                _sehandler.Reset();
339*cdf0e10cSrcweir                 return bstrTemp;
340*cdf0e10cSrcweir         }
341*cdf0e10cSrcweir         const T& operator[](int nElement) const
342*cdf0e10cSrcweir@@ -6336,6 +6414,11 @@
343*cdf0e10cSrcweir //Although these functions are big, they are only used once in a module
344*cdf0e10cSrcweir //so we should make them inline.
345*cdf0e10cSrcweir
346*cdf0e10cSrcweir+ATLINLINE int atlmoduleinitfilter(void *, LPEXCEPTION_POINTERS ep)
347*cdf0e10cSrcweir+{
348*cdf0e10cSrcweir+  return ep->ExceptionRecord->ExceptionCode == STATUS_NO_MEMORY ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
349*cdf0e10cSrcweir+}
350*cdf0e10cSrcweir+
351*cdf0e10cSrcweir ATLINLINE ATLAPI AtlModuleInit(_ATL_MODULE* pM, _ATL_OBJMAP_ENTRY* p, HINSTANCE h)
352*cdf0e10cSrcweir {
353*cdf0e10cSrcweir         ATLASSERT(pM != NULL);
354*cdf0e10cSrcweir@@ -6352,32 +6435,43 @@
355*cdf0e10cSrcweir         pM->m_hInst = pM->m_hInstTypeLib = pM->m_hInstResource = h;
356*cdf0e10cSrcweir         pM->m_nLockCnt=0L;
357*cdf0e10cSrcweir         pM->m_hHeap = NULL;
358*cdf0e10cSrcweir-        __try {
359*cdf0e10cSrcweir+        jmp_buf _sejmpbuf;
360*cdf0e10cSrcweir+        __SEHandler _sehandler;
361*cdf0e10cSrcweir+        if (__builtin_setjmp(_sejmpbuf) == 0) {
362*cdf0e10cSrcweir+            _sehandler.Set(_sejmpbuf, NULL, atlmoduleinitfilter);
363*cdf0e10cSrcweir             InitializeCriticalSection(&pM->m_csTypeInfoHolder);
364*cdf0e10cSrcweir-        } __except (GetExceptionCode() == STATUS_NO_MEMORY ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
365*cdf0e10cSrcweir+        } else {
366*cdf0e10cSrcweir             ZeroMemory(&pM->m_csTypeInfoHolder, sizeof(pM->m_csTypeInfoHolder));
367*cdf0e10cSrcweir-            return STATUS_NO_MEMORY;
368*cdf0e10cSrcweir+            _sehandler.Reset();
369*cdf0e10cSrcweir+	    return STATUS_NO_MEMORY;
370*cdf0e10cSrcweir         }
371*cdf0e10cSrcweir+        _sehandler.Reset();
372*cdf0e10cSrcweir
373*cdf0e10cSrcweir-        __try {
374*cdf0e10cSrcweir+        if (__builtin_setjmp(_sejmpbuf) == 0) {
375*cdf0e10cSrcweir+            _sehandler.Set(_sejmpbuf, NULL, atlmoduleinitfilter);
376*cdf0e10cSrcweir             InitializeCriticalSection(&pM->m_csWindowCreate);
377*cdf0e10cSrcweir-        } __except (GetExceptionCode() == STATUS_NO_MEMORY ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
378*cdf0e10cSrcweir+        } else {
379*cdf0e10cSrcweir             DeleteCriticalSection(&pM->m_csTypeInfoHolder);
380*cdf0e10cSrcweir             ZeroMemory(&pM->m_csWindowCreate, sizeof(pM->m_csWindowCreate));
381*cdf0e10cSrcweir             ZeroMemory(&pM->m_csTypeInfoHolder, sizeof(pM->m_csTypeInfoHolder));
382*cdf0e10cSrcweir+            _sehandler.Reset();
383*cdf0e10cSrcweir             return STATUS_NO_MEMORY;
384*cdf0e10cSrcweir         }
385*cdf0e10cSrcweir+        _sehandler.Reset();
386*cdf0e10cSrcweir
387*cdf0e10cSrcweir-        __try {
388*cdf0e10cSrcweir+        if (__builtin_setjmp(_sejmpbuf) == 0) {
389*cdf0e10cSrcweir+            _sehandler.Set(_sejmpbuf, NULL, atlmoduleinitfilter);
390*cdf0e10cSrcweir             InitializeCriticalSection(&pM->m_csObjMap);
391*cdf0e10cSrcweir-        } __except (GetExceptionCode() == STATUS_NO_MEMORY ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
392*cdf0e10cSrcweir+        } else {
393*cdf0e10cSrcweir             DeleteCriticalSection(&pM->m_csWindowCreate);
394*cdf0e10cSrcweir             DeleteCriticalSection(&pM->m_csTypeInfoHolder);
395*cdf0e10cSrcweir             ZeroMemory(&pM->m_csObjMap, sizeof(pM->m_csObjMap));
396*cdf0e10cSrcweir             ZeroMemory(&pM->m_csWindowCreate, sizeof(pM->m_csWindowCreate));
397*cdf0e10cSrcweir             ZeroMemory(&pM->m_csTypeInfoHolder, sizeof(pM->m_csTypeInfoHolder));
398*cdf0e10cSrcweir+            _sehandler.Reset();
399*cdf0e10cSrcweir             return STATUS_NO_MEMORY;
400*cdf0e10cSrcweir         }
401*cdf0e10cSrcweir+        _sehandler.Reset();
402*cdf0e10cSrcweir #ifdef _ATL_DLL_IMPL
403*cdf0e10cSrcweir         if (pM->cbSize > _nAtlModuleVer21Size)
404*cdf0e10cSrcweir #endif
405*cdf0e10cSrcweir@@ -6450,6 +6544,11 @@
406*cdf0e10cSrcweir         return hRes;
407*cdf0e10cSrcweir }
408*cdf0e10cSrcweir
409*cdf0e10cSrcweir+ATLINLINE void atlfinalleavecriticalsection(void *pData)
410*cdf0e10cSrcweir+{
411*cdf0e10cSrcweir+  LeaveCriticalSection(reinterpret_cast<LPCRITICAL_SECTION>(pData));
412*cdf0e10cSrcweir+}
413*cdf0e10cSrcweir+
414*cdf0e10cSrcweir ATLINLINE ATLAPI AtlModuleGetClassObject(_ATL_MODULE* pM, REFCLSID rclsid, REFIID riid, LPVOID* ppv)
415*cdf0e10cSrcweir {
416*cdf0e10cSrcweir         ATLASSERT(pM != NULL);
417*cdf0e10cSrcweir@@ -6473,15 +6572,15 @@
418*cdf0e10cSrcweir                         if (pEntry->pCF == NULL)
419*cdf0e10cSrcweir                         {
420*cdf0e10cSrcweir                                 EnterCriticalSection(&pM->m_csObjMap);
421*cdf0e10cSrcweir-                                __try
422*cdf0e10cSrcweir+                                jmp_buf _sejmpbuf;
423*cdf0e10cSrcweir+                                __SEHandler _sehandler;
424*cdf0e10cSrcweir+                                if (__builtin_setjmp(_sejmpbuf) == 0)
425*cdf0e10cSrcweir                                 {
426*cdf0e10cSrcweir+                                        _sehandler.Set(_sejmpbuf, &pM->m_csObjMap, EXCEPTION_CONTINUE_SEARCH, NULL, atlfinalleavecriticalsection);
427*cdf0e10cSrcweir                                         if (pEntry->pCF == NULL)
428*cdf0e10cSrcweir-                                                hRes = pEntry->pfnGetClassObject(pEntry->pfnCreateInstance, IID_IUnknown, (LPVOID*)&pEntry->pCF);
429*cdf0e10cSrcweir-                                }
430*cdf0e10cSrcweir-                                __finally
431*cdf0e10cSrcweir-                                {
432*cdf0e10cSrcweir-                                        LeaveCriticalSection(&pM->m_csObjMap);
433*cdf0e10cSrcweir+						hRes = pEntry->pfnGetClassObject((void *)(pEntry->pfnCreateInstance), IID_IUnknown, (LPVOID*)&pEntry->pCF);
434*cdf0e10cSrcweir                                 }
435*cdf0e10cSrcweir+                                _sehandler.Reset();
436*cdf0e10cSrcweir                         }
437*cdf0e10cSrcweir                         if (pEntry->pCF != NULL)
438*cdf0e10cSrcweir                                 hRes = pEntry->pCF->QueryInterface(riid, ppv);
439*cdf0e10cSrcweir--- include/atl/atlcom.h.orig	2005-04-14 17:54:32.000000000 +0900
440*cdf0e10cSrcweir+++ include/atl/atlcom.h	2007-12-03 22:43:54.833375000 +0900
441*cdf0e10cSrcweir@@ -10,6 +10,9 @@
442*cdf0e10cSrcweir
443*cdf0e10cSrcweir #ifndef __ATLCOM_H__
444*cdf0e10cSrcweir #define __ATLCOM_H__
445*cdf0e10cSrcweir+#if __GNUC__ >=3
446*cdf0e10cSrcweir+#pragma GCC system_header
447*cdf0e10cSrcweir+#endif
448*cdf0e10cSrcweir
449*cdf0e10cSrcweir #ifndef __cplusplus
450*cdf0e10cSrcweir         #error ATL requires C++ compilation (use a .cpp suffix)
451*cdf0e10cSrcweir@@ -19,7 +22,10 @@
452*cdf0e10cSrcweir         #error atlcom.h requires atlbase.h to be included first
453*cdf0e10cSrcweir #endif
454*cdf0e10cSrcweir
455*cdf0e10cSrcweir-#pragma pack(push, _ATL_PACKING)
456*cdf0e10cSrcweir+#include <algorithm>
457*cdf0e10cSrcweir+using ::std::min;
458*cdf0e10cSrcweir+
459*cdf0e10cSrcweir+#pragma pack(push, 8)
460*cdf0e10cSrcweir
461*cdf0e10cSrcweir EXTERN_C const IID IID_ITargetFrame;
462*cdf0e10cSrcweir
463*cdf0e10cSrcweir@@ -2191,19 +2197,23 @@
464*cdf0e10cSrcweir // override it in your class and call each base class' version of this
465*cdf0e10cSrcweir #define BEGIN_COM_MAP(x) public: \
466*cdf0e10cSrcweir         typedef x _ComMapClass; \
467*cdf0e10cSrcweir+        static void _CacheFinal(void *pData)\
468*cdf0e10cSrcweir+        {\
469*cdf0e10cSrcweir+                reinterpret_cast<_ComMapClass*>(pData)->Unlock();\
470*cdf0e10cSrcweir+        }\
471*cdf0e10cSrcweir         static HRESULT WINAPI _Cache(void* pv, REFIID iid, void** ppvObject, DWORD_PTR dw)\
472*cdf0e10cSrcweir         {\
473*cdf0e10cSrcweir                 _ComMapClass* p = (_ComMapClass*)pv;\
474*cdf0e10cSrcweir                 p->Lock();\
475*cdf0e10cSrcweir                 HRESULT hRes = E_FAIL; \
476*cdf0e10cSrcweir-                __try \
477*cdf0e10cSrcweir+                jmp_buf _sejmpbuf; \
478*cdf0e10cSrcweir+                __SEHandler _sehandler; \
479*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0) \
480*cdf0e10cSrcweir                 { \
481*cdf0e10cSrcweir+                        _sehandler.Set(_sejmpbuf, p, EXCEPTION_CONTINUE_SEARCH, NULL, _CacheFinal);\
482*cdf0e10cSrcweir                         hRes = CComObjectRootBase::_Cache(pv, iid, ppvObject, dw);\
483*cdf0e10cSrcweir                 } \
484*cdf0e10cSrcweir-                __finally \
485*cdf0e10cSrcweir-                { \
486*cdf0e10cSrcweir-                        p->Unlock();\
487*cdf0e10cSrcweir-                } \
488*cdf0e10cSrcweir+                _sehandler.Reset();\
489*cdf0e10cSrcweir                 return hRes;\
490*cdf0e10cSrcweir         }\
491*cdf0e10cSrcweir         IUnknown* _GetRawUnknown() \
492*cdf0e10cSrcweir@@ -2339,7 +2349,7 @@
493*cdf0e10cSrcweir    return( pMap ); }
494*cdf0e10cSrcweir
495*cdf0e10cSrcweir #define BEGIN_OBJECT_MAP(x) static _ATL_OBJMAP_ENTRY x[] = {
496*cdf0e10cSrcweir-#define END_OBJECT_MAP()   {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
497*cdf0e10cSrcweir+#define END_OBJECT_MAP()   {NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL}};
498*cdf0e10cSrcweir #define OBJECT_ENTRY(clsid, class) {&clsid, class::UpdateRegistry, class::_ClassFactoryCreatorClass::CreateInstance, class::_CreatorClass::CreateInstance, NULL, 0, class::GetObjectDescription, class::GetCategoryMap, class::ObjectMain },
499*cdf0e10cSrcweir #define OBJECT_ENTRY_NON_CREATEABLE(class) {&CLSID_NULL, class::UpdateRegistry, NULL, NULL, NULL, 0, NULL, class::GetCategoryMap, class::ObjectMain },
500*cdf0e10cSrcweir
501*cdf0e10cSrcweir@@ -2492,9 +2502,9 @@
502*cdf0e10cSrcweir public:
503*cdf0e10cSrcweir         typedef ThreadModel _ThreadModel;
504*cdf0e10cSrcweir #ifdef OLD_ATL_CRITSEC_CODE
505*cdf0e10cSrcweir-        typename typedef _ThreadModel::AutoCriticalSection _CritSec;
506*cdf0e10cSrcweir+        typedef typename _ThreadModel::AutoCriticalSection _CritSec;
507*cdf0e10cSrcweir #else
508*cdf0e10cSrcweir-    	typename typedef _ThreadModel::AutoDeleteCriticalSection _AutoDelCritSec;
509*cdf0e10cSrcweir+    	typedef typename _ThreadModel::AutoDeleteCriticalSection _AutoDelCritSec;
510*cdf0e10cSrcweir #endif  /* OLD_ATL_CRITSEC_CODE */
511*cdf0e10cSrcweir         typedef CComObjectLockT<_ThreadModel> ObjectLock;
512*cdf0e10cSrcweir
513*cdf0e10cSrcweir@@ -2638,8 +2648,8 @@
514*cdf0e10cSrcweir         // Set refcount to 1 to protect destruction
515*cdf0e10cSrcweir         ~CComObject()
516*cdf0e10cSrcweir         {
517*cdf0e10cSrcweir-                m_dwRef = 1L;
518*cdf0e10cSrcweir-                FinalRelease();
519*cdf0e10cSrcweir+                this->m_dwRef = 1L;
520*cdf0e10cSrcweir+                this->FinalRelease();
521*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
522*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(_GetRawUnknown());
523*cdf0e10cSrcweir #endif
524*cdf0e10cSrcweir@@ -2647,22 +2657,24 @@
525*cdf0e10cSrcweir         }
526*cdf0e10cSrcweir         //If InternalAddRef or InternalRelease is undefined then your class
527*cdf0e10cSrcweir         //doesn't derive from CComObjectRoot
528*cdf0e10cSrcweir-        STDMETHOD_(ULONG, AddRef)() {return InternalAddRef();}
529*cdf0e10cSrcweir+        STDMETHOD_(ULONG, AddRef)() {return this->InternalAddRef();}
530*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)()
531*cdf0e10cSrcweir         {
532*cdf0e10cSrcweir-                ULONG l = InternalRelease();
533*cdf0e10cSrcweir+                ULONG l = this->InternalRelease();
534*cdf0e10cSrcweir                 if (l == 0)
535*cdf0e10cSrcweir                         delete this;
536*cdf0e10cSrcweir                 return l;
537*cdf0e10cSrcweir         }
538*cdf0e10cSrcweir         //if _InternalQueryInterface is undefined then you forgot BEGIN_COM_MAP
539*cdf0e10cSrcweir         STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject)
540*cdf0e10cSrcweir-        {return _InternalQueryInterface(iid, ppvObject);}
541*cdf0e10cSrcweir+        {return this->_InternalQueryInterface(iid, ppvObject);}
542*cdf0e10cSrcweir+#if 0
543*cdf0e10cSrcweir         template <class Q>
544*cdf0e10cSrcweir         HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)
545*cdf0e10cSrcweir         {
546*cdf0e10cSrcweir                 return QueryInterface(__uuidof(Q), (void**)pp);
547*cdf0e10cSrcweir         }
548*cdf0e10cSrcweir+#endif
549*cdf0e10cSrcweir
550*cdf0e10cSrcweir         static HRESULT WINAPI CreateInstance(CComObject<Base>** pp);
551*cdf0e10cSrcweir };
552*cdf0e10cSrcweir@@ -2719,8 +2731,8 @@
553*cdf0e10cSrcweir #endif  /* OLD_ATL_CRITSEC_CODE */
554*cdf0e10cSrcweir         ~CComObjectCached()
555*cdf0e10cSrcweir         {
556*cdf0e10cSrcweir-                m_dwRef = 1L;
557*cdf0e10cSrcweir-                FinalRelease();
558*cdf0e10cSrcweir+                this->m_dwRef = 1L;
559*cdf0e10cSrcweir+                this->FinalRelease();
560*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
561*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(_GetRawUnknown());
562*cdf0e10cSrcweir #endif
563*cdf0e10cSrcweir@@ -2729,14 +2741,14 @@
564*cdf0e10cSrcweir         //doesn't derive from CComObjectRoot
565*cdf0e10cSrcweir         STDMETHOD_(ULONG, AddRef)()
566*cdf0e10cSrcweir         {
567*cdf0e10cSrcweir-                ULONG l = InternalAddRef();
568*cdf0e10cSrcweir+                ULONG l = this->InternalAddRef();
569*cdf0e10cSrcweir                 if (l == 2)
570*cdf0e10cSrcweir                         _Module.Lock();
571*cdf0e10cSrcweir                 return l;
572*cdf0e10cSrcweir         }
573*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)()
574*cdf0e10cSrcweir         {
575*cdf0e10cSrcweir-                ULONG l = InternalRelease();
576*cdf0e10cSrcweir+                ULONG l = this->InternalRelease();
577*cdf0e10cSrcweir                 if (l == 0)
578*cdf0e10cSrcweir                         delete this;
579*cdf0e10cSrcweir                 else if (l == 1)
580*cdf0e10cSrcweir@@ -2745,7 +2757,7 @@
581*cdf0e10cSrcweir         }
582*cdf0e10cSrcweir         //if _InternalQueryInterface is undefined then you forgot BEGIN_COM_MAP
583*cdf0e10cSrcweir         STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject)
584*cdf0e10cSrcweir-        {return _InternalQueryInterface(iid, ppvObject);}
585*cdf0e10cSrcweir+        {return this->_InternalQueryInterface(iid, ppvObject);}
586*cdf0e10cSrcweir #ifndef OLD_ATL_CRITSEC_CODE
587*cdf0e10cSrcweir     	CComGlobalsThreadModel::AutoDeleteCriticalSection m_csCached;
588*cdf0e10cSrcweir #endif  /* OLD_ATL_CRITSEC_CODE */
589*cdf0e10cSrcweir@@ -2762,8 +2774,8 @@
590*cdf0e10cSrcweir         // Set refcount to 1 to protect destruction
591*cdf0e10cSrcweir         ~CComObjectNoLock()
592*cdf0e10cSrcweir         {
593*cdf0e10cSrcweir-                m_dwRef = 1L;
594*cdf0e10cSrcweir-                FinalRelease();
595*cdf0e10cSrcweir+                this->m_dwRef = 1L;
596*cdf0e10cSrcweir+                this->FinalRelease();
597*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
598*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(_GetRawUnknown());
599*cdf0e10cSrcweir #endif
600*cdf0e10cSrcweir@@ -2771,17 +2783,17 @@
601*cdf0e10cSrcweir
602*cdf0e10cSrcweir         //If InternalAddRef or InternalRelease is undefined then your class
603*cdf0e10cSrcweir         //doesn't derive from CComObjectRoot
604*cdf0e10cSrcweir-        STDMETHOD_(ULONG, AddRef)() {return InternalAddRef();}
605*cdf0e10cSrcweir+        STDMETHOD_(ULONG, AddRef)() {return this->InternalAddRef();}
606*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)()
607*cdf0e10cSrcweir         {
608*cdf0e10cSrcweir-                ULONG l = InternalRelease();
609*cdf0e10cSrcweir+                ULONG l = this->InternalRelease();
610*cdf0e10cSrcweir                 if (l == 0)
611*cdf0e10cSrcweir                         delete this;
612*cdf0e10cSrcweir                 return l;
613*cdf0e10cSrcweir         }
614*cdf0e10cSrcweir         //if _InternalQueryInterface is undefined then you forgot BEGIN_COM_MAP
615*cdf0e10cSrcweir         STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject)
616*cdf0e10cSrcweir-        {return _InternalQueryInterface(iid, ppvObject);}
617*cdf0e10cSrcweir+        {return this->_InternalQueryInterface(iid, ppvObject);}
618*cdf0e10cSrcweir };
619*cdf0e10cSrcweir
620*cdf0e10cSrcweir // It is possible for Base not to derive from CComObjectRoot
621*cdf0e10cSrcweir@@ -2794,14 +2806,14 @@
622*cdf0e10cSrcweir         CComObjectGlobal(void* = NULL)
623*cdf0e10cSrcweir         {
624*cdf0e10cSrcweir #ifndef OLD_ATL_CRITSEC_CODE
625*cdf0e10cSrcweir-			m_hResFinalConstruct = _AtlInitialConstruct();
626*cdf0e10cSrcweir+			m_hResFinalConstruct = this->_AtlInitialConstruct();
627*cdf0e10cSrcweir 			if (SUCCEEDED(m_hResFinalConstruct))
628*cdf0e10cSrcweir #endif  /* OLD_ATL_CRITSEC_CODE */
629*cdf0e10cSrcweir-                m_hResFinalConstruct = FinalConstruct();
630*cdf0e10cSrcweir+                m_hResFinalConstruct = this->FinalConstruct();
631*cdf0e10cSrcweir         }
632*cdf0e10cSrcweir         ~CComObjectGlobal()
633*cdf0e10cSrcweir         {
634*cdf0e10cSrcweir-                FinalRelease();
635*cdf0e10cSrcweir+                this->FinalRelease();
636*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
637*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(_GetRawUnknown());
638*cdf0e10cSrcweir #endif
639*cdf0e10cSrcweir@@ -2810,7 +2822,7 @@
640*cdf0e10cSrcweir         STDMETHOD_(ULONG, AddRef)() {return _Module.Lock();}
641*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)(){return _Module.Unlock();}
642*cdf0e10cSrcweir         STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject)
643*cdf0e10cSrcweir-        {return _InternalQueryInterface(iid, ppvObject);}
644*cdf0e10cSrcweir+        {return this->_InternalQueryInterface(iid, ppvObject);}
645*cdf0e10cSrcweir         HRESULT m_hResFinalConstruct;
646*cdf0e10cSrcweir };
647*cdf0e10cSrcweir
648*cdf0e10cSrcweir@@ -2824,14 +2836,14 @@
649*cdf0e10cSrcweir         CComObjectStack(void* = NULL)
650*cdf0e10cSrcweir         {
651*cdf0e10cSrcweir #ifndef OLD_ATL_CRITSEC_CODE
652*cdf0e10cSrcweir-			m_hResFinalConstruct = _AtlInitialConstruct();
653*cdf0e10cSrcweir+			m_hResFinalConstruct = this->_AtlInitialConstruct();
654*cdf0e10cSrcweir 			if (SUCCEEDED(m_hResFinalConstruct))
655*cdf0e10cSrcweir #endif  /* OLD_ATL_CRITSEC_CODE */
656*cdf0e10cSrcweir-                m_hResFinalConstruct = FinalConstruct();
657*cdf0e10cSrcweir+                m_hResFinalConstruct = this->FinalConstruct();
658*cdf0e10cSrcweir         }
659*cdf0e10cSrcweir         ~CComObjectStack()
660*cdf0e10cSrcweir         {
661*cdf0e10cSrcweir-                FinalRelease();
662*cdf0e10cSrcweir+                this->FinalRelease();
663*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
664*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(_GetRawUnknown());
665*cdf0e10cSrcweir #endif
666*cdf0e10cSrcweir@@ -2850,6 +2862,8 @@
667*cdf0e10cSrcweir {
668*cdf0e10cSrcweir public:
669*cdf0e10cSrcweir         typedef Base _BaseClass;
670*cdf0e10cSrcweir+        using Base::_GetRawUnknown;
671*cdf0e10cSrcweir+        using Base::m_pOuterUnknown;
672*cdf0e10cSrcweir         CComContainedObject(void* pv) {m_pOuterUnknown = (IUnknown*)pv;}
673*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
674*cdf0e10cSrcweir         ~CComContainedObject()
675*cdf0e10cSrcweir@@ -2859,20 +2873,22 @@
676*cdf0e10cSrcweir         }
677*cdf0e10cSrcweir #endif
678*cdf0e10cSrcweir
679*cdf0e10cSrcweir-        STDMETHOD_(ULONG, AddRef)() {return OuterAddRef();}
680*cdf0e10cSrcweir-        STDMETHOD_(ULONG, Release)() {return OuterRelease();}
681*cdf0e10cSrcweir+        STDMETHOD_(ULONG, AddRef)() {return this->OuterAddRef();}
682*cdf0e10cSrcweir+        STDMETHOD_(ULONG, Release)() {return this->OuterRelease();}
683*cdf0e10cSrcweir         STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject)
684*cdf0e10cSrcweir         {
685*cdf0e10cSrcweir-                HRESULT hr = OuterQueryInterface(iid, ppvObject);
686*cdf0e10cSrcweir+                HRESULT hr = this->OuterQueryInterface(iid, ppvObject);
687*cdf0e10cSrcweir                 if (FAILED(hr) && _GetRawUnknown() != m_pOuterUnknown)
688*cdf0e10cSrcweir-                        hr = _InternalQueryInterface(iid, ppvObject);
689*cdf0e10cSrcweir+                        hr = this->_InternalQueryInterface(iid, ppvObject);
690*cdf0e10cSrcweir                 return hr;
691*cdf0e10cSrcweir         }
692*cdf0e10cSrcweir+#if 0
693*cdf0e10cSrcweir         template <class Q>
694*cdf0e10cSrcweir         HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)
695*cdf0e10cSrcweir         {
696*cdf0e10cSrcweir                 return QueryInterface(__uuidof(Q), (void**)pp);
697*cdf0e10cSrcweir         }
698*cdf0e10cSrcweir+#endif
699*cdf0e10cSrcweir         //GetControllingUnknown may be virtual if the Base class has declared
700*cdf0e10cSrcweir         //DECLARE_GET_CONTROLLING_UNKNOWN()
701*cdf0e10cSrcweir         IUnknown* GetControllingUnknown()
702*cdf0e10cSrcweir@@ -2915,18 +2931,18 @@
703*cdf0e10cSrcweir         // override it in your class and call each base class' version of this
704*cdf0e10cSrcweir         HRESULT FinalConstruct()
705*cdf0e10cSrcweir         {
706*cdf0e10cSrcweir-                CComObjectRootEx<contained::_ThreadModel::ThreadModelNoCS>::FinalConstruct();
707*cdf0e10cSrcweir+                CComObjectRootEx<typename contained::_ThreadModel::ThreadModelNoCS>::FinalConstruct();
708*cdf0e10cSrcweir                 return m_contained.FinalConstruct();
709*cdf0e10cSrcweir         }
710*cdf0e10cSrcweir         void FinalRelease()
711*cdf0e10cSrcweir         {
712*cdf0e10cSrcweir-                CComObjectRootEx<contained::_ThreadModel::ThreadModelNoCS>::FinalRelease();
713*cdf0e10cSrcweir+                CComObjectRootEx<typename contained::_ThreadModel::ThreadModelNoCS>::FinalRelease();
714*cdf0e10cSrcweir                 m_contained.FinalRelease();
715*cdf0e10cSrcweir         }
716*cdf0e10cSrcweir         // Set refcount to 1 to protect destruction
717*cdf0e10cSrcweir         ~CComAggObject()
718*cdf0e10cSrcweir         {
719*cdf0e10cSrcweir-                m_dwRef = 1L;
720*cdf0e10cSrcweir+                this->m_dwRef = 1L;
721*cdf0e10cSrcweir                 FinalRelease();
722*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
723*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(this);
724*cdf0e10cSrcweir@@ -2934,10 +2950,10 @@
725*cdf0e10cSrcweir                 _Module.Unlock();
726*cdf0e10cSrcweir         }
727*cdf0e10cSrcweir
728*cdf0e10cSrcweir-        STDMETHOD_(ULONG, AddRef)() {return InternalAddRef();}
729*cdf0e10cSrcweir+        STDMETHOD_(ULONG, AddRef)() {return this->InternalAddRef();}
730*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)()
731*cdf0e10cSrcweir         {
732*cdf0e10cSrcweir-                ULONG l = InternalRelease();
733*cdf0e10cSrcweir+                ULONG l = this->InternalRelease();
734*cdf0e10cSrcweir                 if (l == 0)
735*cdf0e10cSrcweir                         delete this;
736*cdf0e10cSrcweir                 return l;
737*cdf0e10cSrcweir@@ -2959,11 +2975,13 @@
738*cdf0e10cSrcweir                         hRes = m_contained._InternalQueryInterface(iid, ppvObject);
739*cdf0e10cSrcweir                 return hRes;
740*cdf0e10cSrcweir         }
741*cdf0e10cSrcweir+#if 0
742*cdf0e10cSrcweir         template <class Q>
743*cdf0e10cSrcweir         HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)
744*cdf0e10cSrcweir         {
745*cdf0e10cSrcweir                 return QueryInterface(__uuidof(Q), (void**)pp);
746*cdf0e10cSrcweir         }
747*cdf0e10cSrcweir+#endif
748*cdf0e10cSrcweir         static HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, CComAggObject<contained>** pp)
749*cdf0e10cSrcweir         {
750*cdf0e10cSrcweir                 _ATL_VALIDATE_OUT_POINTER(pp);
751*cdf0e10cSrcweir@@ -3023,21 +3041,21 @@
752*cdf0e10cSrcweir         // override it in your class and call each base class' version of this
753*cdf0e10cSrcweir         HRESULT FinalConstruct()
754*cdf0e10cSrcweir         {
755*cdf0e10cSrcweir-                InternalAddRef();
756*cdf0e10cSrcweir-                CComObjectRootEx<contained::_ThreadModel::ThreadModelNoCS>::FinalConstruct();
757*cdf0e10cSrcweir+                this->InternalAddRef();
758*cdf0e10cSrcweir+                CComObjectRootEx<typename contained::_ThreadModel::ThreadModelNoCS>::FinalConstruct();
759*cdf0e10cSrcweir                 HRESULT hr = m_contained.FinalConstruct();
760*cdf0e10cSrcweir-                InternalRelease();
761*cdf0e10cSrcweir+                this->InternalRelease();
762*cdf0e10cSrcweir                 return hr;
763*cdf0e10cSrcweir         }
764*cdf0e10cSrcweir         void FinalRelease()
765*cdf0e10cSrcweir         {
766*cdf0e10cSrcweir-                CComObjectRootEx<contained::_ThreadModel::ThreadModelNoCS>::FinalRelease();
767*cdf0e10cSrcweir+                CComObjectRootEx<typename contained::_ThreadModel::ThreadModelNoCS>::FinalRelease();
768*cdf0e10cSrcweir                 m_contained.FinalRelease();
769*cdf0e10cSrcweir         }
770*cdf0e10cSrcweir         // Set refcount to 1 to protect destruction
771*cdf0e10cSrcweir         ~CComPolyObject()
772*cdf0e10cSrcweir         {
773*cdf0e10cSrcweir-                m_dwRef = 1L;
774*cdf0e10cSrcweir+                this->m_dwRef = 1L;
775*cdf0e10cSrcweir                 FinalRelease();
776*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
777*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(this);
778*cdf0e10cSrcweir@@ -3045,10 +3063,10 @@
779*cdf0e10cSrcweir                 _Module.Unlock();
780*cdf0e10cSrcweir         }
781*cdf0e10cSrcweir
782*cdf0e10cSrcweir-        STDMETHOD_(ULONG, AddRef)() {return InternalAddRef();}
783*cdf0e10cSrcweir+        STDMETHOD_(ULONG, AddRef)() {return this->InternalAddRef();}
784*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)()
785*cdf0e10cSrcweir         {
786*cdf0e10cSrcweir-                ULONG l = InternalRelease();
787*cdf0e10cSrcweir+                ULONG l = this->InternalRelease();
788*cdf0e10cSrcweir                 if (l == 0)
789*cdf0e10cSrcweir                         delete this;
790*cdf0e10cSrcweir                 return l;
791*cdf0e10cSrcweir@@ -3072,11 +3090,13 @@
792*cdf0e10cSrcweir                         hRes = m_contained._InternalQueryInterface(iid, ppvObject);
793*cdf0e10cSrcweir                 return hRes;
794*cdf0e10cSrcweir         }
795*cdf0e10cSrcweir+#if 0
796*cdf0e10cSrcweir         template <class Q>
797*cdf0e10cSrcweir         HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)
798*cdf0e10cSrcweir         {
799*cdf0e10cSrcweir                 return QueryInterface(__uuidof(Q), (void**)pp);
800*cdf0e10cSrcweir         }
801*cdf0e10cSrcweir+#endif
802*cdf0e10cSrcweir         static HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, CComPolyObject<contained>** pp)
803*cdf0e10cSrcweir         {
804*cdf0e10cSrcweir                 _ATL_VALIDATE_OUT_POINTER(pp);
805*cdf0e10cSrcweir@@ -3111,27 +3131,28 @@
806*cdf0e10cSrcweir class CComTearOffObject : public Base
807*cdf0e10cSrcweir {
808*cdf0e10cSrcweir public:
809*cdf0e10cSrcweir+        using Base::m_pOwner;
810*cdf0e10cSrcweir         CComTearOffObject(void* pv)
811*cdf0e10cSrcweir         {
812*cdf0e10cSrcweir                 ATLASSERT(m_pOwner == NULL);
813*cdf0e10cSrcweir-                m_pOwner = reinterpret_cast<CComObject<Base::_OwnerClass>*>(pv);
814*cdf0e10cSrcweir+                m_pOwner = reinterpret_cast<CComObject<typename Base::_OwnerClass>*>(pv);
815*cdf0e10cSrcweir                 m_pOwner->AddRef();
816*cdf0e10cSrcweir         }
817*cdf0e10cSrcweir         // Set refcount to 1 to protect destruction
818*cdf0e10cSrcweir         ~CComTearOffObject()
819*cdf0e10cSrcweir         {
820*cdf0e10cSrcweir-                m_dwRef = 1L;
821*cdf0e10cSrcweir-                FinalRelease();
822*cdf0e10cSrcweir+                this->m_dwRef = 1L;
823*cdf0e10cSrcweir+                this->FinalRelease();
824*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
825*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(_GetRawUnknown());
826*cdf0e10cSrcweir #endif
827*cdf0e10cSrcweir                 m_pOwner->Release();
828*cdf0e10cSrcweir         }
829*cdf0e10cSrcweir
830*cdf0e10cSrcweir-        STDMETHOD_(ULONG, AddRef)() {return InternalAddRef();}
831*cdf0e10cSrcweir+        STDMETHOD_(ULONG, AddRef)() {return this->InternalAddRef();}
832*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)()
833*cdf0e10cSrcweir         {
834*cdf0e10cSrcweir-                ULONG l = InternalRelease();
835*cdf0e10cSrcweir+                ULONG l = this->InternalRelease();
836*cdf0e10cSrcweir                 if (l == 0)
837*cdf0e10cSrcweir                         delete this;
838*cdf0e10cSrcweir                 return l;
839*cdf0e10cSrcweir@@ -3150,27 +3171,27 @@
840*cdf0e10cSrcweir public:
841*cdf0e10cSrcweir         typedef contained _BaseClass;
842*cdf0e10cSrcweir         CComCachedTearOffObject(void* pv) :
843*cdf0e10cSrcweir-                m_contained(((contained::_OwnerClass*)pv)->GetControllingUnknown())
844*cdf0e10cSrcweir+                m_contained(((typename contained::_OwnerClass*)pv)->GetControllingUnknown())
845*cdf0e10cSrcweir         {
846*cdf0e10cSrcweir                 ATLASSERT(m_contained.m_pOwner == NULL);
847*cdf0e10cSrcweir-                m_contained.m_pOwner = reinterpret_cast<CComObject<contained::_OwnerClass>*>(pv);
848*cdf0e10cSrcweir+                m_contained.m_pOwner = reinterpret_cast<CComObject<typename contained::_OwnerClass>*>(pv);
849*cdf0e10cSrcweir         }
850*cdf0e10cSrcweir         //If you get a message that this call is ambiguous then you need to
851*cdf0e10cSrcweir         // override it in your class and call each base class' version of this
852*cdf0e10cSrcweir         HRESULT FinalConstruct()
853*cdf0e10cSrcweir         {
854*cdf0e10cSrcweir-                CComObjectRootEx<contained::_ThreadModel::ThreadModelNoCS>::FinalConstruct();
855*cdf0e10cSrcweir+                CComObjectRootEx<typename contained::_ThreadModel::ThreadModelNoCS>::FinalConstruct();
856*cdf0e10cSrcweir                 return m_contained.FinalConstruct();
857*cdf0e10cSrcweir         }
858*cdf0e10cSrcweir         void FinalRelease()
859*cdf0e10cSrcweir         {
860*cdf0e10cSrcweir-                CComObjectRootEx<contained::_ThreadModel::ThreadModelNoCS>::FinalRelease();
861*cdf0e10cSrcweir+                CComObjectRootEx<typename contained::_ThreadModel::ThreadModelNoCS>::FinalRelease();
862*cdf0e10cSrcweir                 m_contained.FinalRelease();
863*cdf0e10cSrcweir         }
864*cdf0e10cSrcweir         // Set refcount to 1 to protect destruction
865*cdf0e10cSrcweir         ~CComCachedTearOffObject()
866*cdf0e10cSrcweir         {
867*cdf0e10cSrcweir-                m_dwRef = 1L;
868*cdf0e10cSrcweir+                this->m_dwRef = 1L;
869*cdf0e10cSrcweir                 FinalRelease();
870*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
871*cdf0e10cSrcweir                 _Module.DeleteNonAddRefThunk(this);
872*cdf0e10cSrcweir@@ -3178,10 +3199,10 @@
873*cdf0e10cSrcweir         }
874*cdf0e10cSrcweir
875*cdf0e10cSrcweir
876*cdf0e10cSrcweir-        STDMETHOD_(ULONG, AddRef)() {return InternalAddRef();}
877*cdf0e10cSrcweir+        STDMETHOD_(ULONG, AddRef)() {return this->InternalAddRef();}
878*cdf0e10cSrcweir         STDMETHOD_(ULONG, Release)()
879*cdf0e10cSrcweir         {
880*cdf0e10cSrcweir-                ULONG l = InternalRelease();
881*cdf0e10cSrcweir+                ULONG l = this->InternalRelease();
882*cdf0e10cSrcweir                 if (l == 0)
883*cdf0e10cSrcweir                         delete this;
884*cdf0e10cSrcweir                 return l;
885*cdf0e10cSrcweir@@ -3260,7 +3281,9 @@
886*cdf0e10cSrcweir {
887*cdf0e10cSrcweir public:
888*cdf0e10cSrcweir         typedef license _LicenseClass;
889*cdf0e10cSrcweir-        typedef CComClassFactory2<license> _ComMapClass;
890*cdf0e10cSrcweir+        using license::IsLicenseValid;
891*cdf0e10cSrcweir+        using license::GetLicenseKey;
892*cdf0e10cSrcweir+//        typedef CComClassFactory2<license> _ComMapClass;
893*cdf0e10cSrcweir BEGIN_COM_MAP(CComClassFactory2<license>)
894*cdf0e10cSrcweir         COM_INTERFACE_ENTRY(IClassFactory)
895*cdf0e10cSrcweir         COM_INTERFACE_ENTRY(IClassFactory2)
896*cdf0e10cSrcweir@@ -3297,7 +3320,7 @@
897*cdf0e10cSrcweir                 if (ppvObject == NULL)
898*cdf0e10cSrcweir                         return E_POINTER;
899*cdf0e10cSrcweir                 *ppvObject = NULL;
900*cdf0e10cSrcweir-                if ( ((bstrKey != NULL) && !VerifyLicenseKey(bstrKey)) ||
901*cdf0e10cSrcweir+                if ( ((bstrKey != NULL) && !this->VerifyLicenseKey(bstrKey)) ||
902*cdf0e10cSrcweir                          ((bstrKey == NULL) && !IsLicenseValid()) )
903*cdf0e10cSrcweir                         return CLASS_E_NOTLICENSED;
904*cdf0e10cSrcweir                 if ((pUnkOuter != NULL) && !InlineIsEqualUnknown(riid))
905*cdf0e10cSrcweir@@ -3363,7 +3386,7 @@
906*cdf0e10cSrcweir                         if (pUnkOuter != NULL)
907*cdf0e10cSrcweir                                 hRes = CLASS_E_NOAGGREGATION;
908*cdf0e10cSrcweir                         else
909*cdf0e10cSrcweir-                                hRes = _Module.CreateInstance(m_pfnCreateInstance, riid, ppvObj);
910*cdf0e10cSrcweir+                                hRes = _Module.CreateInstance((LPVOID)m_pfnCreateInstance, riid, ppvObj);
911*cdf0e10cSrcweir                 }
912*cdf0e10cSrcweir                 return hRes;
913*cdf0e10cSrcweir         }
914*cdf0e10cSrcweir@@ -3454,6 +3477,7 @@
915*cdf0e10cSrcweir                         lpszHelpFile, iid, hRes);
916*cdf0e10cSrcweir         }
917*cdf0e10cSrcweir #endif
918*cdf0e10cSrcweir+#if 0
919*cdf0e10cSrcweir         template <class Q>
920*cdf0e10cSrcweir         static HRESULT CreateInstance(IUnknown* punkOuter, Q** pp)
921*cdf0e10cSrcweir         {
922*cdf0e10cSrcweir@@ -3464,6 +3488,7 @@
923*cdf0e10cSrcweir         {
924*cdf0e10cSrcweir                 return T::_CreatorClass::CreateInstance(NULL, __uuidof(Q), (void**) pp);
925*cdf0e10cSrcweir         }
926*cdf0e10cSrcweir+#endif
927*cdf0e10cSrcweir };
928*cdf0e10cSrcweir
929*cdf0e10cSrcweir // ATL doesn't support multiple LCID's at the same time
930*cdf0e10cSrcweir@@ -3651,7 +3676,7 @@
931*cdf0e10cSrcweir                         {
932*cdf0e10cSrcweir                                 CComPtr<ITypeInfo> spInfo(spTypeInfo);
933*cdf0e10cSrcweir                                 CComPtr<ITypeInfo2> spTypeInfo2;
934*cdf0e10cSrcweir-                                if (SUCCEEDED(spTypeInfo->QueryInterface(&spTypeInfo2)))
935*cdf0e10cSrcweir+                                if (SUCCEEDED(spTypeInfo->QueryInterface(IID_ITypeInfo2, (void**)&spTypeInfo2)))
936*cdf0e10cSrcweir                                         spInfo = spTypeInfo2;
937*cdf0e10cSrcweir
938*cdf0e10cSrcweir                                 m_pInfo = spInfo.Detach();
939*cdf0e10cSrcweir@@ -3760,6 +3785,9 @@
940*cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////
941*cdf0e10cSrcweir // IDispEventImpl
942*cdf0e10cSrcweir
943*cdf0e10cSrcweir+template <class T>
944*cdf0e10cSrcweir+struct _ATL_EVENT_ENTRY;
945*cdf0e10cSrcweir+
946*cdf0e10cSrcweir #ifdef _ATL_DLL
947*cdf0e10cSrcweir ATLAPI AtlGetObjectSourceInterface(IUnknown* punkObj, GUID* plibid, IID* piid, unsigned short* pdwMajor, unsigned short* pdwMinor);
948*cdf0e10cSrcweir #else
949*cdf0e10cSrcweir@@ -3909,16 +3937,17 @@
950*cdf0e10cSrcweir #else
951*cdf0e10cSrcweir
952*cdf0e10cSrcweir #pragma warning(disable:4740)       // flow in/out of inline disables global opts
953*cdf0e10cSrcweir-inline void __declspec(naked) __stdcall CComStdCallThunkHelper()
954*cdf0e10cSrcweir+inline void __stdcall CComStdCallThunkHelper()
955*cdf0e10cSrcweir {
956*cdf0e10cSrcweir-        __asm
957*cdf0e10cSrcweir-        {
958*cdf0e10cSrcweir-                mov eax, [esp+4];       // get pThunk
959*cdf0e10cSrcweir-                mov edx, [eax+4];       // get the pThunk->pThis
960*cdf0e10cSrcweir-                mov [esp+4], edx;       // replace pThunk with pThis
961*cdf0e10cSrcweir-                mov eax, [eax+8];       // get pThunk->pfn
962*cdf0e10cSrcweir-                jmp eax;                // jump pfn
963*cdf0e10cSrcweir-        };
964*cdf0e10cSrcweir+  asm(
965*cdf0e10cSrcweir+      " movl $8(%ebp), %eax\n"       // get pThunk
966*cdf0e10cSrcweir+      " movl $4(%eax), edx\n"       // get the pThunk->pThis
967*cdf0e10cSrcweir+      " movl %edx, $8(%ebp)\n"       // replace pThunk with pThis
968*cdf0e10cSrcweir+      " movl $8(%eax), %eax\n"       // get pThunk->pfn
969*cdf0e10cSrcweir+      "	movl %ebp, %esp\n"
970*cdf0e10cSrcweir+      "	popl %ebp\n"
971*cdf0e10cSrcweir+      "	jmp %eax"                // jump pfn
972*cdf0e10cSrcweir+      );
973*cdf0e10cSrcweir }
974*cdf0e10cSrcweir #pragma warning(default:4740)
975*cdf0e10cSrcweir #endif
976*cdf0e10cSrcweir@@ -3985,6 +4014,7 @@
977*cdf0e10cSrcweir class ATL_NO_VTABLE IDispEventSimpleImpl : public _IDispEventLocator<nID, pdiid>
978*cdf0e10cSrcweir {
979*cdf0e10cSrcweir public:
980*cdf0e10cSrcweir+        using _IDispEventLocator<nID, pdiid>::m_dwEventCookie;
981*cdf0e10cSrcweir         STDMETHOD(_LocDEQueryInterface)(REFIID riid, void ** ppvObject)
982*cdf0e10cSrcweir         {
983*cdf0e10cSrcweir                 _ATL_VALIDATE_OUT_POINTER(ppvObject);
984*cdf0e10cSrcweir@@ -3992,7 +4022,7 @@
985*cdf0e10cSrcweir                 if (InlineIsEqualGUID(riid, *pdiid) ||
986*cdf0e10cSrcweir                         InlineIsEqualUnknown(riid) ||
987*cdf0e10cSrcweir                         InlineIsEqualGUID(riid, IID_IDispatch) ||
988*cdf0e10cSrcweir-                        InlineIsEqualGUID(riid, m_iid))
989*cdf0e10cSrcweir+                        InlineIsEqualGUID(riid, this->m_iid))
990*cdf0e10cSrcweir                 {
991*cdf0e10cSrcweir                         *ppvObject = this;
992*cdf0e10cSrcweir                         AddRef();
993*cdf0e10cSrcweir@@ -4186,6 +4216,10 @@
994*cdf0e10cSrcweir {
995*cdf0e10cSrcweir public:
996*cdf0e10cSrcweir         typedef tihclass _tihclass;
997*cdf0e10cSrcweir+        using IDispEventSimpleImpl<nID, T, pdiid>::m_libid;
998*cdf0e10cSrcweir+        using IDispEventSimpleImpl<nID, T, pdiid>::m_iid;
999*cdf0e10cSrcweir+        using IDispEventSimpleImpl<nID, T, pdiid>::m_wMajorVerNum;
1000*cdf0e10cSrcweir+        using IDispEventSimpleImpl<nID, T, pdiid>::m_wMinorVerNum;
1001*cdf0e10cSrcweir
1002*cdf0e10cSrcweir         IDispEventImpl()
1003*cdf0e10cSrcweir         {
1004*cdf0e10cSrcweir@@ -4475,6 +4509,11 @@
1005*cdf0e10cSrcweir         }
1006*cdf0e10cSrcweir };
1007*cdf0e10cSrcweir
1008*cdf0e10cSrcweir+template <class Base, const IID* piid, class T, class Copy, class ThreadModel = CComObjectThreadModel>
1009*cdf0e10cSrcweir+class ATL_NO_VTABLE CComEnum;
1010*cdf0e10cSrcweir+template <class Base, const IID* piid, class T, class Copy, class CollType, class ThreadModel = CComObjectThreadModel>
1011*cdf0e10cSrcweir+class ATL_NO_VTABLE CComEnumOnSTL;
1012*cdf0e10cSrcweir+
1013*cdf0e10cSrcweir
1014*cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////
1015*cdf0e10cSrcweir // CComEnumImpl
1016*cdf0e10cSrcweir@@ -4746,7 +4785,7 @@
1017*cdf0e10cSrcweir         return S_OK;
1018*cdf0e10cSrcweir }
1019*cdf0e10cSrcweir
1020*cdf0e10cSrcweir-template <class Base, const IID* piid, class T, class Copy, class ThreadModel = CComObjectThreadModel>
1021*cdf0e10cSrcweir+template <class Base, const IID* piid, class T, class Copy, class ThreadModel>
1022*cdf0e10cSrcweir class ATL_NO_VTABLE CComEnum :
1023*cdf0e10cSrcweir         public CComEnumImpl<Base, piid, T, Copy>,
1024*cdf0e10cSrcweir         public CComObjectRootEx< ThreadModel >
1025*cdf0e10cSrcweir@@ -4868,7 +4907,7 @@
1026*cdf0e10cSrcweir         return hRes;
1027*cdf0e10cSrcweir }
1028*cdf0e10cSrcweir
1029*cdf0e10cSrcweir-template <class Base, const IID* piid, class T, class Copy, class CollType, class ThreadModel = CComObjectThreadModel>
1030*cdf0e10cSrcweir+template <class Base, const IID* piid, class T, class Copy, class CollType, class ThreadModel>
1031*cdf0e10cSrcweir class ATL_NO_VTABLE CComEnumOnSTL :
1032*cdf0e10cSrcweir         public IEnumOnSTLImpl<Base, piid, T, Copy, CollType>,
1033*cdf0e10cSrcweir         public CComObjectRootEx< ThreadModel >
1034*cdf0e10cSrcweir@@ -4901,7 +4940,7 @@
1035*cdf0e10cSrcweir                         return E_INVALIDARG;
1036*cdf0e10cSrcweir                 HRESULT hr = E_FAIL;
1037*cdf0e10cSrcweir                 Index--;
1038*cdf0e10cSrcweir-                CollType::iterator iter = m_coll.begin();
1039*cdf0e10cSrcweir+                typename CollType::iterator iter = m_coll.begin();
1040*cdf0e10cSrcweir                 while (iter != m_coll.end() && Index > 0)
1041*cdf0e10cSrcweir                 {
1042*cdf0e10cSrcweir                         iter++;
1043*cdf0e10cSrcweir@@ -5314,7 +5353,7 @@
1044*cdf0e10cSrcweir                 if (InlineIsEqualGUID(riid, IID_IConnectionPoint) || InlineIsEqualUnknown(riid))
1045*cdf0e10cSrcweir                 {
1046*cdf0e10cSrcweir                         *ppvObject = this;
1047*cdf0e10cSrcweir-                        AddRef();
1048*cdf0e10cSrcweir+                        this->AddRef();
1049*cdf0e10cSrcweir #ifdef _ATL_DEBUG_INTERFACES
1050*cdf0e10cSrcweir                         _Module.AddThunk((IUnknown**)ppvObject, _T("IConnectionPointImpl"), riid);
1051*cdf0e10cSrcweir #endif // _ATL_DEBUG_INTERFACES
1052*cdf0e10cSrcweir--- include/atl/atlconv.h.orig	2005-04-14 17:54:32.000000000 +0900
1053*cdf0e10cSrcweir+++ include/atl/atlconv.h	2007-12-31 07:29:34.759750000 +0900
1054*cdf0e10cSrcweir@@ -10,6 +10,9 @@
1055*cdf0e10cSrcweir
1056*cdf0e10cSrcweir #ifndef __ATLCONV_H__
1057*cdf0e10cSrcweir #define __ATLCONV_H__
1058*cdf0e10cSrcweir+#if __GNUC__ >=3
1059*cdf0e10cSrcweir+#pragma GCC system_header
1060*cdf0e10cSrcweir+#endif
1061*cdf0e10cSrcweir
1062*cdf0e10cSrcweir #ifndef __cplusplus
1063*cdf0e10cSrcweir         #error ATL requires C++ compilation (use a .cpp suffix)
1064*cdf0e10cSrcweir@@ -30,7 +33,11 @@
1065*cdf0e10cSrcweir // Following code is to avoid alloca causing a stack overflow.
1066*cdf0e10cSrcweir // It is intended for use from the _ATL_SAFE_ALLOCA macros
1067*cdf0e10cSrcweir // or Conversion macros.
1068*cdf0e10cSrcweir-__declspec(selectany) DWORD _Atlosplatform = 0;
1069*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
1070*cdf0e10cSrcweir+DWORD _Atlosplatform = 0;
1071*cdf0e10cSrcweir+#else
1072*cdf0e10cSrcweir+extern DWORD _Atlosplatform;
1073*cdf0e10cSrcweir+#endif
1074*cdf0e10cSrcweir inline BOOL _AtlGetVersionEx()
1075*cdf0e10cSrcweir {
1076*cdf0e10cSrcweir         OSVERSIONINFO osi;
1077*cdf0e10cSrcweir@@ -156,8 +163,11 @@
1078*cdf0e10cSrcweir #pragma prefast(suppress:515, "Atlresetstkoflw is the same as resetstkoflw")
1079*cdf0e10cSrcweir
1080*cdf0e10cSrcweir // Verifies if sufficient space is available on the stack.
1081*cdf0e10cSrcweir-inline bool _AtlVerifyStackAvailable(SIZE_T Size)
1082*cdf0e10cSrcweir+inline bool _AtlVerifyStackAvailable(SIZE_T /*Size*/)
1083*cdf0e10cSrcweir {
1084*cdf0e10cSrcweir+#if 1
1085*cdf0e10cSrcweir+    return false;
1086*cdf0e10cSrcweir+#else
1087*cdf0e10cSrcweir     bool bStackAvailable = true;
1088*cdf0e10cSrcweir
1089*cdf0e10cSrcweir     __try
1090*cdf0e10cSrcweir@@ -173,6 +183,7 @@
1091*cdf0e10cSrcweir         _Atlresetstkoflw();
1092*cdf0e10cSrcweir     }
1093*cdf0e10cSrcweir     return bStackAvailable;
1094*cdf0e10cSrcweir+#endif
1095*cdf0e10cSrcweir }
1096*cdf0e10cSrcweir
1097*cdf0e10cSrcweir #pragma prefast(pop)
1098*cdf0e10cSrcweir@@ -281,15 +292,15 @@
1099*cdf0e10cSrcweir
1100*cdf0e10cSrcweir #ifdef _CONVERSION_USES_THREAD_LOCALE
1101*cdf0e10cSrcweir         #ifndef _DEBUG
1102*cdf0e10cSrcweir-                #define USES_CONVERSION int _convert; _convert; UINT _acp = GetACP(); _acp; LPCWSTR _lpw; _lpw; LPCSTR _lpa; _lpa
1103*cdf0e10cSrcweir+                #define USES_CONVERSION int _convert; (void)_convert; UINT _acp = GetACP(); (void)_acp; LPCWSTR _lpw; (void)_lpw; LPCSTR _lpa; (void)_lpa
1104*cdf0e10cSrcweir         #else
1105*cdf0e10cSrcweir-                #define USES_CONVERSION int _convert = 0; _convert; UINT _acp = GetACP(); _acp; LPCWSTR _lpw = NULL; _lpw; LPCSTR _lpa = NULL; _lpa
1106*cdf0e10cSrcweir+                #define USES_CONVERSION int _convert = 0; (void)_convert; UINT _acp = GetACP(); (void)_acp; LPCWSTR _lpw = NULL; (void)_lpw; LPCSTR _lpa = NULL; (void)_lpa
1107*cdf0e10cSrcweir         #endif
1108*cdf0e10cSrcweir #else
1109*cdf0e10cSrcweir         #ifndef _DEBUG
1110*cdf0e10cSrcweir-                #define USES_CONVERSION int _convert; _convert; UINT _acp = CP_ACP; _acp; LPCWSTR _lpw; _lpw; LPCSTR _lpa; _lpa
1111*cdf0e10cSrcweir+                #define USES_CONVERSION int _convert; (void)_convert; UINT _acp = CP_ACP; (void)_acp; LPCWSTR _lpw; (void)_lpw; LPCSTR _lpa; (void)_lpa
1112*cdf0e10cSrcweir         #else
1113*cdf0e10cSrcweir-                #define USES_CONVERSION int _convert = 0; _convert; UINT _acp = CP_ACP; _acp; LPCWSTR _lpw = NULL; _lpw; LPCSTR _lpa = NULL; _lpa
1114*cdf0e10cSrcweir+                #define USES_CONVERSION int _convert = 0; (void)_convert; UINT _acp = CP_ACP; (void)_acp; LPCWSTR _lpw = NULL; (void)_lpw; LPCSTR _lpa = NULL; (void)_lpa
1115*cdf0e10cSrcweir         #endif
1116*cdf0e10cSrcweir #endif
1117*cdf0e10cSrcweir
1118*cdf0e10cSrcweir--- include/atl/atlctl.h.orig	2005-04-14 17:54:32.000000000 +0900
1119*cdf0e10cSrcweir+++ include/atl/atlctl.h	2009-04-19 13:31:15.146000000 +0900
1120*cdf0e10cSrcweir@@ -10,6 +10,9 @@
1121*cdf0e10cSrcweir
1122*cdf0e10cSrcweir #ifndef __ATLCTL_H__
1123*cdf0e10cSrcweir #define __ATLCTL_H__
1124*cdf0e10cSrcweir+#if __GNUC__ >=3
1125*cdf0e10cSrcweir+#pragma GCC system_header
1126*cdf0e10cSrcweir+#endif
1127*cdf0e10cSrcweir
1128*cdf0e10cSrcweir #ifndef __cplusplus
1129*cdf0e10cSrcweir         #error ATL requires C++ compilation (use a .cpp suffix)
1130*cdf0e10cSrcweir@@ -57,7 +60,7 @@
1131*cdf0e10cSrcweir namespace ATL
1132*cdf0e10cSrcweir {
1133*cdf0e10cSrcweir
1134*cdf0e10cSrcweir-#pragma pack(push, _ATL_PACKING)
1135*cdf0e10cSrcweir+#pragma pack(push, 8)
1136*cdf0e10cSrcweir
1137*cdf0e10cSrcweir // Forward declarations
1138*cdf0e10cSrcweir //
1139*cdf0e10cSrcweir@@ -142,7 +145,9 @@
1140*cdf0e10cSrcweir         CComControlBase(HWND& h) : m_hWndCD(h)
1141*cdf0e10cSrcweir         {
1142*cdf0e10cSrcweir                 memset(this, 0, sizeof(CComControlBase));
1143*cdf0e10cSrcweir-                m_phWndCD = &h;
1144*cdf0e10cSrcweir+		// previous element of m_hWndCD in this class is m_rcPos
1145*cdf0e10cSrcweir+		*reinterpret_cast<HWND **>(reinterpret_cast<DWORD>(reinterpret_cast<char *>(&m_rcPos)+sizeof(m_rcPos)+(__alignof__(m_hWndCD)-1))&(-(__alignof__(m_hWndCD))))=&h;
1146*cdf0e10cSrcweir+//                m_phWndCD = &h;
1147*cdf0e10cSrcweir                 m_sizeExtent.cx = 2*2540;
1148*cdf0e10cSrcweir                 m_sizeExtent.cy = 2*2540;
1149*cdf0e10cSrcweir                 m_sizeNatural = m_sizeExtent;
1150*cdf0e10cSrcweir@@ -530,13 +535,13 @@
1151*cdf0e10cSrcweir         SIZE m_sizeNatural; //unscaled size in himetric
1152*cdf0e10cSrcweir         SIZE m_sizeExtent;  //current extents in himetric
1153*cdf0e10cSrcweir         RECT m_rcPos; // position in pixels
1154*cdf0e10cSrcweir-#pragma warning(disable: 4510 4610) // unnamed union
1155*cdf0e10cSrcweir-        union
1156*cdf0e10cSrcweir-        {
1157*cdf0e10cSrcweir+//#pragma warning(disable: 4510 4610) // unnamed union
1158*cdf0e10cSrcweir+//        union
1159*cdf0e10cSrcweir+//        {
1160*cdf0e10cSrcweir                 HWND& m_hWndCD;
1161*cdf0e10cSrcweir-                HWND* m_phWndCD;
1162*cdf0e10cSrcweir-        };
1163*cdf0e10cSrcweir-#pragma warning(default: 4510 4610)
1164*cdf0e10cSrcweir+//                HWND* m_phWndCD;
1165*cdf0e10cSrcweir+//        };
1166*cdf0e10cSrcweir+//#pragma warning(default: 4510 4610)
1167*cdf0e10cSrcweir         union
1168*cdf0e10cSrcweir         {
1169*cdf0e10cSrcweir                 // m_nFreezeEvents is the only one actually used
1170*cdf0e10cSrcweir@@ -1362,7 +1367,7 @@
1171*cdf0e10cSrcweir class ATL_NO_VTABLE CComControl :  public CComControlBase, public WinBase
1172*cdf0e10cSrcweir {
1173*cdf0e10cSrcweir public:
1174*cdf0e10cSrcweir-        CComControl() : CComControlBase(m_hWnd) {}
1175*cdf0e10cSrcweir+        CComControl() : CComControlBase(this->m_hWnd) {}
1176*cdf0e10cSrcweir         HRESULT FireOnRequestEdit(DISPID dispID)
1177*cdf0e10cSrcweir         {
1178*cdf0e10cSrcweir                 T* pT = static_cast<T*>(this);
1179*cdf0e10cSrcweir@@ -1401,6 +1406,8 @@
1180*cdf0e10cSrcweir class CComCompositeControl : public CComControl< T, CAxDialogImpl< T > >
1181*cdf0e10cSrcweir {
1182*cdf0e10cSrcweir public:
1183*cdf0e10cSrcweir+        using CComControl< T, CAxDialogImpl< T > >::m_hWnd;
1184*cdf0e10cSrcweir+        using CComControl< T, CAxDialogImpl< T > >::GetNextDlgTabItem;
1185*cdf0e10cSrcweir         CComCompositeControl()
1186*cdf0e10cSrcweir         {
1187*cdf0e10cSrcweir                 m_hbrBackground = NULL;
1188*cdf0e10cSrcweir@@ -1429,7 +1436,7 @@
1189*cdf0e10cSrcweir                         m_hbrBackground = NULL;
1190*cdf0e10cSrcweir                 }
1191*cdf0e10cSrcweir                 OLE_COLOR clr;
1192*cdf0e10cSrcweir-                HRESULT hr = GetAmbientBackColor(clr);
1193*cdf0e10cSrcweir+                HRESULT hr = this->GetAmbientBackColor(clr);
1194*cdf0e10cSrcweir                 if (SUCCEEDED(hr))
1195*cdf0e10cSrcweir                 {
1196*cdf0e10cSrcweir                         COLORREF rgb;
1197*cdf0e10cSrcweir@@ -1443,7 +1450,7 @@
1198*cdf0e10cSrcweir         {
1199*cdf0e10cSrcweir                 CAxWindow wnd(hwnd);
1200*cdf0e10cSrcweir                 CComPtr<IAxWinAmbientDispatch> spDispatch;
1201*cdf0e10cSrcweir-                wnd.QueryHost(&spDispatch);
1202*cdf0e10cSrcweir+                wnd.QueryHost(IID_IAxWinAmbientDispatch, (void**)&spDispatch);
1203*cdf0e10cSrcweir                 if (spDispatch != NULL)
1204*cdf0e10cSrcweir                         spDispatch->put_BackColor((OLE_COLOR)l);
1205*cdf0e10cSrcweir                 return TRUE;
1206*cdf0e10cSrcweir@@ -1458,10 +1465,10 @@
1207*cdf0e10cSrcweir         }
1208*cdf0e10cSrcweir         HWND Create(HWND hWndParent, RECT& /*rcPos*/, LPARAM dwInitParam = NULL)
1209*cdf0e10cSrcweir         {
1210*cdf0e10cSrcweir-                CComControl< T, CAxDialogImpl< T > >::Create(hWndParent, dwInitParam);
1211*cdf0e10cSrcweir+                this->Create(hWndParent, dwInitParam);
1212*cdf0e10cSrcweir                 SetBackgroundColorFromAmbient();
1213*cdf0e10cSrcweir                 if (m_hWnd != NULL)
1214*cdf0e10cSrcweir-                        ShowWindow(SW_SHOWNOACTIVATE);
1215*cdf0e10cSrcweir+                        this->ShowWindow(SW_SHOWNOACTIVATE);
1216*cdf0e10cSrcweir                 return m_hWnd;
1217*cdf0e10cSrcweir         }
1218*cdf0e10cSrcweir         BOOL CalcExtent(SIZE& size)
1219*cdf0e10cSrcweir@@ -1488,7 +1495,7 @@
1220*cdf0e10cSrcweir                         return FALSE;
1221*cdf0e10cSrcweir                 // find a direct child of the dialog from the window that has focus
1222*cdf0e10cSrcweir                 HWND hWndCtl = ::GetFocus();
1223*cdf0e10cSrcweir-                if (IsChild(hWndCtl) && ::GetParent(hWndCtl) != m_hWnd)
1224*cdf0e10cSrcweir+                if (this->IsChild(hWndCtl) && ::GetParent(hWndCtl) != m_hWnd)
1225*cdf0e10cSrcweir                 {
1226*cdf0e10cSrcweir                         do
1227*cdf0e10cSrcweir                         {
1228*cdf0e10cSrcweir@@ -1546,7 +1553,7 @@
1229*cdf0e10cSrcweir                         break;
1230*cdf0e10cSrcweir                 }
1231*cdf0e10cSrcweir
1232*cdf0e10cSrcweir-                return IsDialogMessage(pMsg);
1233*cdf0e10cSrcweir+                return this->IsDialogMessage(pMsg);
1234*cdf0e10cSrcweir         }
1235*cdf0e10cSrcweir         HRESULT IOleInPlaceObject_InPlaceDeactivate(void)
1236*cdf0e10cSrcweir         {
1237*cdf0e10cSrcweir@@ -1563,7 +1570,7 @@
1238*cdf0e10cSrcweir         }
1239*cdf0e10cSrcweir         virtual HRESULT OnDraw(ATL_DRAWINFO& di)
1240*cdf0e10cSrcweir         {
1241*cdf0e10cSrcweir-                if(!m_bInPlaceActive)
1242*cdf0e10cSrcweir+                if(!this->m_bInPlaceActive)
1243*cdf0e10cSrcweir                 {
1244*cdf0e10cSrcweir                         HPEN hPen = (HPEN)::GetStockObject(BLACK_PEN);
1245*cdf0e10cSrcweir                         HBRUSH hBrush = (HBRUSH)::GetStockObject(GRAY_BRUSH);
1246*cdf0e10cSrcweir@@ -1626,7 +1633,7 @@
1247*cdf0e10cSrcweir         }
1248*cdf0e10cSrcweir         STDMETHOD(OnAmbientPropertyChange)(DISPID dispid)
1249*cdf0e10cSrcweir         {
1250*cdf0e10cSrcweir-                dispid;
1251*cdf0e10cSrcweir+                (void)dispid;
1252*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("IOleControlImpl::OnAmbientPropertyChange\n"));
1253*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T(" -- DISPID = %d (%d)\n"), dispid);
1254*cdf0e10cSrcweir                 return S_OK;
1255*cdf0e10cSrcweir@@ -2905,7 +2912,7 @@
1256*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("~CBindStatusCallback\n"));
1257*cdf0e10cSrcweir         }
1258*cdf0e10cSrcweir
1259*cdf0e10cSrcweir-        STDMETHOD(OnStartBinding)(DWORD dwReserved, IBinding *pBinding)
1260*cdf0e10cSrcweir+        STDMETHOD(OnStartBinding)(DWORD /*dwReserved*/, IBinding *pBinding)
1261*cdf0e10cSrcweir         {
1262*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("CBindStatusCallback::OnStartBinding\n"));
1263*cdf0e10cSrcweir                 m_spBinding = pBinding;
1264*cdf0e10cSrcweir@@ -2923,19 +2930,19 @@
1265*cdf0e10cSrcweir                 return S_OK;
1266*cdf0e10cSrcweir         }
1267*cdf0e10cSrcweir
1268*cdf0e10cSrcweir-        STDMETHOD(OnLowResource)(DWORD reserved)
1269*cdf0e10cSrcweir+        STDMETHOD(OnLowResource)(DWORD /*reserved*/)
1270*cdf0e10cSrcweir         {
1271*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("CBindStatusCallback::OnLowResource"));
1272*cdf0e10cSrcweir                 return S_OK;
1273*cdf0e10cSrcweir         }
1274*cdf0e10cSrcweir
1275*cdf0e10cSrcweir-        STDMETHOD(OnProgress)(ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
1276*cdf0e10cSrcweir+        STDMETHOD(OnProgress)(ULONG /*ulProgress*/, ULONG /*ulProgressMax*/, ULONG /*ulStatusCode*/, LPCWSTR /*szStatusText*/)
1277*cdf0e10cSrcweir         {
1278*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("CBindStatusCallback::OnProgress"));
1279*cdf0e10cSrcweir                 return S_OK;
1280*cdf0e10cSrcweir         }
1281*cdf0e10cSrcweir
1282*cdf0e10cSrcweir-        STDMETHOD(OnStopBinding)(HRESULT hresult, LPCWSTR szError)
1283*cdf0e10cSrcweir+        STDMETHOD(OnStopBinding)(HRESULT /*hresult*/, LPCWSTR /*szError*/)
1284*cdf0e10cSrcweir         {
1285*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("CBindStatusCallback::OnStopBinding\n"));
1286*cdf0e10cSrcweir                 (m_pT->*m_pFunc)(this, NULL, 0);
1287*cdf0e10cSrcweir@@ -2962,7 +2969,7 @@
1288*cdf0e10cSrcweir                 return S_OK;
1289*cdf0e10cSrcweir         }
1290*cdf0e10cSrcweir
1291*cdf0e10cSrcweir-        STDMETHOD(OnDataAvailable)(DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
1292*cdf0e10cSrcweir+        STDMETHOD(OnDataAvailable)(DWORD grfBSCF, DWORD dwSize, FORMATETC */*pformatetc*/, STGMEDIUM *pstgmed)
1293*cdf0e10cSrcweir         {
1294*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("CBindStatusCallback::OnDataAvailable\n"));
1295*cdf0e10cSrcweir                 HRESULT hr = S_OK;
1296*cdf0e10cSrcweir@@ -3005,7 +3012,7 @@
1297*cdf0e10cSrcweir                 return hr;
1298*cdf0e10cSrcweir         }
1299*cdf0e10cSrcweir
1300*cdf0e10cSrcweir-        STDMETHOD(OnObjectAvailable)(REFIID riid, IUnknown *punk)
1301*cdf0e10cSrcweir+        STDMETHOD(OnObjectAvailable)(REFIID /*riid*/, IUnknown */*punk*/)
1302*cdf0e10cSrcweir         {
1303*cdf0e10cSrcweir                 ATLTRACE2(atlTraceControls,2,_T("CBindStatusCallback::OnObjectAvailable"));
1304*cdf0e10cSrcweir                 return S_OK;
1305*cdf0e10cSrcweir--- include/atl/atlwin.h.orig	2005-04-14 17:54:32.000000000 +0900
1306*cdf0e10cSrcweir+++ include/atl/atlwin.h	2007-12-31 07:29:28.525375000 +0900
1307*cdf0e10cSrcweir@@ -10,6 +10,9 @@
1308*cdf0e10cSrcweir
1309*cdf0e10cSrcweir #ifndef __ATLWIN_H__
1310*cdf0e10cSrcweir #define __ATLWIN_H__
1311*cdf0e10cSrcweir+#if __GNUC__ >=3
1312*cdf0e10cSrcweir+#pragma GCC system_header
1313*cdf0e10cSrcweir+#endif
1314*cdf0e10cSrcweir
1315*cdf0e10cSrcweir #ifndef __cplusplus
1316*cdf0e10cSrcweir         #error ATL requires C++ compilation (use a .cpp suffix)
1317*cdf0e10cSrcweir@@ -99,6 +102,8 @@
1318*cdf0e10cSrcweir #else
1319*cdf0e10cSrcweir #define CWndClassInfo CWndClassInfoA
1320*cdf0e10cSrcweir #endif
1321*cdf0e10cSrcweir+template <DWORD t_dwStyle = 0, DWORD t_dwExStyle = 0> class CWinTraits;
1322*cdf0e10cSrcweir+typedef CWinTraits<WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0>                                        CControlWinTraits;
1323*cdf0e10cSrcweir template <class T, class TBase = CWindow, class TWinTraits = CControlWinTraits> class CWindowImpl;
1324*cdf0e10cSrcweir template <class T, class TBase = CWindow> class CDialogImpl;
1325*cdf0e10cSrcweir #ifndef _ATL_NO_HOSTING
1326*cdf0e10cSrcweir@@ -658,6 +663,13 @@
1327*cdf0e10cSrcweir                 ATLASSERT(::IsWindow(m_hWnd));
1328*cdf0e10cSrcweir                 return ::GetDlgItemText(m_hWnd, nID, lpStr, nMaxCount);
1329*cdf0e10cSrcweir         }
1330*cdf0e10cSrcweir+
1331*cdf0e10cSrcweir+        HWND GetDlgItem(int nID) const
1332*cdf0e10cSrcweir+        {
1333*cdf0e10cSrcweir+                ATLASSERT(::IsWindow(m_hWnd));
1334*cdf0e10cSrcweir+                return ::GetDlgItem(m_hWnd, nID);
1335*cdf0e10cSrcweir+        }
1336*cdf0e10cSrcweir+
1337*cdf0e10cSrcweir         BOOL GetDlgItemText(int nID, BSTR& bstrText) const
1338*cdf0e10cSrcweir         {
1339*cdf0e10cSrcweir                 ATLASSERT(::IsWindow(m_hWnd));
1340*cdf0e10cSrcweir@@ -847,12 +859,6 @@
1341*cdf0e10cSrcweir                 return (int)::SetWindowLong(m_hWnd, GWL_ID, nID);
1342*cdf0e10cSrcweir         }
1343*cdf0e10cSrcweir
1344*cdf0e10cSrcweir-        HWND GetDlgItem(int nID) const
1345*cdf0e10cSrcweir-        {
1346*cdf0e10cSrcweir-                ATLASSERT(::IsWindow(m_hWnd));
1347*cdf0e10cSrcweir-                return ::GetDlgItem(m_hWnd, nID);
1348*cdf0e10cSrcweir-        }
1349*cdf0e10cSrcweir-
1350*cdf0e10cSrcweir // Alert Functions
1351*cdf0e10cSrcweir
1352*cdf0e10cSrcweir         BOOL FlashWindow(BOOL bInvert)
1353*cdf0e10cSrcweir@@ -1319,7 +1325,9 @@
1354*cdf0e10cSrcweir         }
1355*cdf0e10cSrcweir };
1356*cdf0e10cSrcweir
1357*cdf0e10cSrcweir-_declspec(selectany) RECT CWindow::rcDefault = { CW_USEDEFAULT, CW_USEDEFAULT, 0, 0 };
1358*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
1359*cdf0e10cSrcweir+RECT CWindow::rcDefault = { CW_USEDEFAULT, CW_USEDEFAULT, 0, 0 };
1360*cdf0e10cSrcweir+#endif
1361*cdf0e10cSrcweir
1362*cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////
1363*cdf0e10cSrcweir // CAxWindow - client side for an ActiveX host window
1364*cdf0e10cSrcweir@@ -1330,6 +1338,7 @@
1365*cdf0e10cSrcweir class CAxWindowT : public TBase
1366*cdf0e10cSrcweir {
1367*cdf0e10cSrcweir public:
1368*cdf0e10cSrcweir+        using TBase::m_hWnd;
1369*cdf0e10cSrcweir // Constructors
1370*cdf0e10cSrcweir         CAxWindowT(HWND hWnd = NULL) : TBase(hWnd)
1371*cdf0e10cSrcweir         { }
1372*cdf0e10cSrcweir@@ -1439,11 +1448,13 @@
1373*cdf0e10cSrcweir                         hr = spUnk->QueryInterface(iid, ppUnk);
1374*cdf0e10cSrcweir                 return hr;
1375*cdf0e10cSrcweir         }
1376*cdf0e10cSrcweir+#if 0
1377*cdf0e10cSrcweir         template <class Q>
1378*cdf0e10cSrcweir         HRESULT QueryHost(Q** ppUnk)
1379*cdf0e10cSrcweir         {
1380*cdf0e10cSrcweir                 return QueryHost(__uuidof(Q), (void**)ppUnk);
1381*cdf0e10cSrcweir         }
1382*cdf0e10cSrcweir+#endif
1383*cdf0e10cSrcweir         HRESULT QueryControl(REFIID iid, void** ppUnk)
1384*cdf0e10cSrcweir         {
1385*cdf0e10cSrcweir                 ATLASSERT(ppUnk != NULL);
1386*cdf0e10cSrcweir@@ -1459,11 +1470,13 @@
1387*cdf0e10cSrcweir                         hr = spUnk->QueryInterface(iid, ppUnk);
1388*cdf0e10cSrcweir                 return hr;
1389*cdf0e10cSrcweir         }
1390*cdf0e10cSrcweir+#if 0
1391*cdf0e10cSrcweir         template <class Q>
1392*cdf0e10cSrcweir         HRESULT QueryControl(Q** ppUnk)
1393*cdf0e10cSrcweir         {
1394*cdf0e10cSrcweir                 return QueryControl(__uuidof(Q), (void**)ppUnk);
1395*cdf0e10cSrcweir         }
1396*cdf0e10cSrcweir+#endif
1397*cdf0e10cSrcweir         HRESULT SetExternalDispatch(IDispatch* pDisp)
1398*cdf0e10cSrcweir         {
1399*cdf0e10cSrcweir                 HRESULT hr;
1400*cdf0e10cSrcweir@@ -1521,12 +1534,12 @@
1401*cdf0e10cSrcweir         BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID = 0) \
1402*cdf0e10cSrcweir         { \
1403*cdf0e10cSrcweir                 BOOL bHandled = TRUE; \
1404*cdf0e10cSrcweir-                hWnd; \
1405*cdf0e10cSrcweir-                uMsg; \
1406*cdf0e10cSrcweir-                wParam; \
1407*cdf0e10cSrcweir-                lParam; \
1408*cdf0e10cSrcweir-                lResult; \
1409*cdf0e10cSrcweir-                bHandled; \
1410*cdf0e10cSrcweir+                (void)hWnd; \
1411*cdf0e10cSrcweir+                (void)uMsg; \
1412*cdf0e10cSrcweir+                (void)wParam; \
1413*cdf0e10cSrcweir+                (void)lParam; \
1414*cdf0e10cSrcweir+                (void)lResult; \
1415*cdf0e10cSrcweir+                (void)bHandled; \
1416*cdf0e10cSrcweir                 switch(dwMsgMapID) \
1417*cdf0e10cSrcweir                 { \
1418*cdf0e10cSrcweir                 case 0:
1419*cdf0e10cSrcweir@@ -1750,7 +1763,7 @@
1420*cdf0e10cSrcweir
1421*cdf0e10cSrcweir         // search for an empty one
1422*cdf0e10cSrcweir
1423*cdf0e10cSrcweir-                for(i = 0; i < m_aChainEntry.GetSize(); i++)
1424*cdf0e10cSrcweir+                for(int i = 0; i < m_aChainEntry.GetSize(); i++)
1425*cdf0e10cSrcweir                 {
1426*cdf0e10cSrcweir                         if(m_aChainEntry[i] == NULL)
1427*cdf0e10cSrcweir                         {
1428*cdf0e10cSrcweir@@ -1841,7 +1854,7 @@
1429*cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////
1430*cdf0e10cSrcweir // CWinTraits - Defines various default values for a window
1431*cdf0e10cSrcweir
1432*cdf0e10cSrcweir-template <DWORD t_dwStyle = 0, DWORD t_dwExStyle = 0>
1433*cdf0e10cSrcweir+template <DWORD t_dwStyle, DWORD t_dwExStyle>
1434*cdf0e10cSrcweir class CWinTraits
1435*cdf0e10cSrcweir {
1436*cdf0e10cSrcweir public:
1437*cdf0e10cSrcweir@@ -1855,7 +1868,7 @@
1438*cdf0e10cSrcweir         }
1439*cdf0e10cSrcweir };
1440*cdf0e10cSrcweir
1441*cdf0e10cSrcweir-typedef CWinTraits<WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0>                                        CControlWinTraits;
1442*cdf0e10cSrcweir+//typedef CWinTraits<WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0>                                        CControlWinTraits;
1443*cdf0e10cSrcweir typedef CWinTraits<WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE>                CFrameWinTraits;
1444*cdf0e10cSrcweir typedef CWinTraits<WS_OVERLAPPEDWINDOW | WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_MDICHILD>        CMDIChildWinTraits;
1445*cdf0e10cSrcweir
1446*cdf0e10cSrcweir@@ -1882,6 +1895,7 @@
1447*cdf0e10cSrcweir class ATL_NO_VTABLE CWindowImplRoot : public TBase, public CMessageMap
1448*cdf0e10cSrcweir {
1449*cdf0e10cSrcweir public:
1450*cdf0e10cSrcweir+        using TBase::GetDlgItem;
1451*cdf0e10cSrcweir         CWndProcThunk m_thunk;
1452*cdf0e10cSrcweir         const MSG* m_pCurrentMsg;
1453*cdf0e10cSrcweir
1454*cdf0e10cSrcweir@@ -1892,7 +1906,7 @@
1455*cdf0e10cSrcweir         ~CWindowImplRoot()
1456*cdf0e10cSrcweir         {
1457*cdf0e10cSrcweir #ifdef _DEBUG
1458*cdf0e10cSrcweir-                if(m_hWnd != NULL)        // should be cleared in WindowProc
1459*cdf0e10cSrcweir+                if(this->m_hWnd != NULL)        // should be cleared in WindowProc
1460*cdf0e10cSrcweir                 {
1461*cdf0e10cSrcweir                         ATLTRACE2(atlTraceWindowing, 0, _T("ERROR - Object deleted before window was destroyed\n"));
1462*cdf0e10cSrcweir                         ATLASSERT(FALSE);
1463*cdf0e10cSrcweir@@ -2017,6 +2031,8 @@
1464*cdf0e10cSrcweir class ATL_NO_VTABLE CWindowImplBaseT : public CWindowImplRoot< TBase >
1465*cdf0e10cSrcweir {
1466*cdf0e10cSrcweir public:
1467*cdf0e10cSrcweir+        using CWindowImplRoot< TBase >::m_hWnd;
1468*cdf0e10cSrcweir+        using CWindowImplRoot< TBase >::m_thunk;
1469*cdf0e10cSrcweir         WNDPROC m_pfnSuperWindowProc;
1470*cdf0e10cSrcweir
1471*cdf0e10cSrcweir         CWindowImplBaseT() : m_pfnSuperWindowProc(::DefWindowProc)
1472*cdf0e10cSrcweir@@ -2049,7 +2065,7 @@
1473*cdf0e10cSrcweir
1474*cdf0e10cSrcweir         LRESULT DefWindowProc()
1475*cdf0e10cSrcweir         {
1476*cdf0e10cSrcweir-                const MSG* pMsg = m_pCurrentMsg;
1477*cdf0e10cSrcweir+                const MSG* pMsg = this->m_pCurrentMsg;
1478*cdf0e10cSrcweir                 LRESULT lRes = 0;
1479*cdf0e10cSrcweir                 if (pMsg != NULL)
1480*cdf0e10cSrcweir                         lRes = DefWindowProc(pMsg->message, pMsg->wParam, pMsg->lParam);
1481*cdf0e10cSrcweir@@ -2091,7 +2107,7 @@
1482*cdf0e10cSrcweir         if(pOldProc != StartWindowProc)
1483*cdf0e10cSrcweir                 ATLTRACE2(atlTraceWindowing, 0, _T("Subclassing through a hook discarded.\n"));
1484*cdf0e10cSrcweir #else
1485*cdf0e10cSrcweir-        pOldProc;        // avoid unused warning
1486*cdf0e10cSrcweir+        (void)pOldProc;        // avoid unused warning
1487*cdf0e10cSrcweir #endif
1488*cdf0e10cSrcweir         return pProc(hWnd, uMsg, wParam, lParam);
1489*cdf0e10cSrcweir }
1490*cdf0e10cSrcweir@@ -2219,6 +2235,7 @@
1491*cdf0e10cSrcweir class ATL_NO_VTABLE CWindowImpl : public CWindowImplBaseT< TBase, TWinTraits >
1492*cdf0e10cSrcweir {
1493*cdf0e10cSrcweir public:
1494*cdf0e10cSrcweir+        using CWindowImplBaseT< TBase, TWinTraits >::StartWindowProc;
1495*cdf0e10cSrcweir         DECLARE_WND_CLASS(NULL)
1496*cdf0e10cSrcweir
1497*cdf0e10cSrcweir         HWND Create(HWND hWndParent, RECT& rcPos, LPCTSTR szWindowName = NULL,
1498*cdf0e10cSrcweir@@ -2226,8 +2243,8 @@
1499*cdf0e10cSrcweir                         UINT nID = 0, LPVOID lpCreateParam = NULL)
1500*cdf0e10cSrcweir         {
1501*cdf0e10cSrcweir                 if (T::GetWndClassInfo().m_lpszOrigName == NULL)
1502*cdf0e10cSrcweir-                        T::GetWndClassInfo().m_lpszOrigName = GetWndClassName();
1503*cdf0e10cSrcweir-                ATOM atom = T::GetWndClassInfo().Register(&m_pfnSuperWindowProc);
1504*cdf0e10cSrcweir+                        T::GetWndClassInfo().m_lpszOrigName = this->GetWndClassName();
1505*cdf0e10cSrcweir+                ATOM atom = T::GetWndClassInfo().Register(&(this->m_pfnSuperWindowProc));
1506*cdf0e10cSrcweir
1507*cdf0e10cSrcweir                 dwStyle = T::GetWndStyle(dwStyle);
1508*cdf0e10cSrcweir                 dwExStyle = T::GetWndExStyle(dwExStyle);
1509*cdf0e10cSrcweir@@ -2244,6 +2261,7 @@
1510*cdf0e10cSrcweir class ATL_NO_VTABLE CDialogImplBaseT : public CWindowImplRoot< TBase >
1511*cdf0e10cSrcweir {
1512*cdf0e10cSrcweir public:
1513*cdf0e10cSrcweir+        using CWindowImplRoot< TBase >::m_hWnd;
1514*cdf0e10cSrcweir 	virtual DLGPROC GetDialogProc()
1515*cdf0e10cSrcweir 	{
1516*cdf0e10cSrcweir 		return DialogProc;
1517*cdf0e10cSrcweir@@ -2344,6 +2362,9 @@
1518*cdf0e10cSrcweir class ATL_NO_VTABLE CDialogImpl : public CDialogImplBaseT< TBase >
1519*cdf0e10cSrcweir {
1520*cdf0e10cSrcweir public:
1521*cdf0e10cSrcweir+        using CDialogImplBaseT< TBase >::m_hWnd;
1522*cdf0e10cSrcweir+        using CDialogImplBaseT< TBase >::m_thunk;
1523*cdf0e10cSrcweir+        typedef CDialogImplBaseT< TBase > CDialogImplBase_Class;
1524*cdf0e10cSrcweir #ifdef _DEBUG
1525*cdf0e10cSrcweir         bool m_bModal;
1526*cdf0e10cSrcweir         CDialogImpl() : m_bModal(false) { }
1527*cdf0e10cSrcweir@@ -2422,6 +2443,8 @@
1528*cdf0e10cSrcweir class ATL_NO_VTABLE CAxDialogImpl : public CDialogImplBaseT< TBase >
1529*cdf0e10cSrcweir {
1530*cdf0e10cSrcweir public:
1531*cdf0e10cSrcweir+        using CDialogImplBaseT< TBase >::m_hWnd;
1532*cdf0e10cSrcweir+        using CDialogImplBaseT< TBase >::m_thunk;
1533*cdf0e10cSrcweir #ifdef _DEBUG
1534*cdf0e10cSrcweir         bool m_bModal;
1535*cdf0e10cSrcweir         CAxDialogImpl() : m_bModal(false) { }
1536*cdf0e10cSrcweir@@ -2515,6 +2538,8 @@
1537*cdf0e10cSrcweir class CContainedWindowT : public TBase
1538*cdf0e10cSrcweir {
1539*cdf0e10cSrcweir public:
1540*cdf0e10cSrcweir+        using TBase::m_hWnd;
1541*cdf0e10cSrcweir+        using TBase::GetWndClassName;
1542*cdf0e10cSrcweir         CWndProcThunk m_thunk;
1543*cdf0e10cSrcweir         LPCTSTR m_lpszClassName;
1544*cdf0e10cSrcweir         WNDPROC m_pfnSuperWindowProc;
1545*cdf0e10cSrcweir@@ -2536,7 +2561,7 @@
1546*cdf0e10cSrcweir         { }
1547*cdf0e10cSrcweir
1548*cdf0e10cSrcweir         CContainedWindowT(CMessageMap* pObject, DWORD dwMsgMapID = 0)
1549*cdf0e10cSrcweir-                : m_lpszClassName(TBase::GetWndClassName()),
1550*cdf0e10cSrcweir+                : m_lpszClassName(GetWndClassName()),
1551*cdf0e10cSrcweir                 m_pfnSuperWindowProc(::DefWindowProc),
1552*cdf0e10cSrcweir                 m_pObject(pObject), m_dwMsgMapID(dwMsgMapID),
1553*cdf0e10cSrcweir                 m_pCurrentMsg(NULL)
1554*cdf0e10cSrcweir@@ -2666,7 +2691,7 @@
1555*cdf0e10cSrcweir                 LPCTSTR szWindowName = NULL, DWORD dwStyle = 0, DWORD dwExStyle = 0,
1556*cdf0e10cSrcweir                 UINT nID = 0, LPVOID lpCreateParam = NULL)
1557*cdf0e10cSrcweir         {
1558*cdf0e10cSrcweir-                m_lpszClassName = TBase::GetWndClassName();
1559*cdf0e10cSrcweir+                m_lpszClassName = GetWndClassName();
1560*cdf0e10cSrcweir                 m_pfnSuperWindowProc = ::DefWindowProc;
1561*cdf0e10cSrcweir                 m_pObject = pObject;
1562*cdf0e10cSrcweir                 m_dwMsgMapID = dwMsgMapID;
1563*cdf0e10cSrcweir@@ -2959,8 +2984,11 @@
1564*cdf0e10cSrcweir         {
1565*cdf0e10cSrcweir
1566*cdf0e10cSrcweir                 ::EnterCriticalSection(&pM->m_csWindowCreate);
1567*cdf0e10cSrcweir-                __try
1568*cdf0e10cSrcweir+                jmp_buf _sejmpbuf;
1569*cdf0e10cSrcweir+                __SEHandler _sehandler;
1570*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0)
1571*cdf0e10cSrcweir                 {
1572*cdf0e10cSrcweir+                        _sehandler.Set(_sejmpbuf, &pM->m_csWindowCreate, EXCEPTION_CONTINUE_SEARCH, NULL, atlfinalleavecriticalsection);
1573*cdf0e10cSrcweir                         if(p->m_atom == 0)
1574*cdf0e10cSrcweir                         {
1575*cdf0e10cSrcweir                                 HINSTANCE hInst = pM->m_hInst;
1576*cdf0e10cSrcweir@@ -2979,7 +3007,7 @@
1577*cdf0e10cSrcweir                                                 if(!::GetClassInfoExA(_Module.GetModuleInstance(), p->m_lpszOrigName, &wc))
1578*cdf0e10cSrcweir                                                 {
1579*cdf0e10cSrcweir                                                         fFail = TRUE;
1580*cdf0e10cSrcweir-                                                        __leave;
1581*cdf0e10cSrcweir+                                                        __builtin_longjmp(_sejmpbuf, 1);
1582*cdf0e10cSrcweir                                                 }
1583*cdf0e10cSrcweir                                         }
1584*cdf0e10cSrcweir                                         memcpy(&p->m_wc, &wc, sizeof(WNDCLASSEX));
1585*cdf0e10cSrcweir@@ -3011,10 +3039,7 @@
1586*cdf0e10cSrcweir                                         p->m_atom = ::RegisterClassExA(&p->m_wc);
1587*cdf0e10cSrcweir                         }
1588*cdf0e10cSrcweir                 }
1589*cdf0e10cSrcweir-                __finally
1590*cdf0e10cSrcweir-                {
1591*cdf0e10cSrcweir-                        ::LeaveCriticalSection(&pM->m_csWindowCreate);
1592*cdf0e10cSrcweir-                }
1593*cdf0e10cSrcweir+                _sehandler.Reset();
1594*cdf0e10cSrcweir         }
1595*cdf0e10cSrcweir
1596*cdf0e10cSrcweir         if (fFail)
1597*cdf0e10cSrcweir@@ -3038,8 +3063,11 @@
1598*cdf0e10cSrcweir         if (p->m_atom == 0)
1599*cdf0e10cSrcweir         {
1600*cdf0e10cSrcweir                 ::EnterCriticalSection(&pM->m_csWindowCreate);
1601*cdf0e10cSrcweir-                __try
1602*cdf0e10cSrcweir+                jmp_buf _sejmpbuf;
1603*cdf0e10cSrcweir+                __SEHandler _sehandler;
1604*cdf0e10cSrcweir+                if (__builtin_setjmp(_sejmpbuf) == 0)
1605*cdf0e10cSrcweir                 {
1606*cdf0e10cSrcweir+                        _sehandler.Set(_sejmpbuf, &pM->m_csWindowCreate, EXCEPTION_CONTINUE_SEARCH, NULL, atlfinalleavecriticalsection);
1607*cdf0e10cSrcweir                         if(p->m_atom == 0)
1608*cdf0e10cSrcweir                         {
1609*cdf0e10cSrcweir                                 HINSTANCE hInst = pM->m_hInst;
1610*cdf0e10cSrcweir@@ -3058,7 +3086,7 @@
1611*cdf0e10cSrcweir                                                 if(!::GetClassInfoExW(_Module.GetModuleInstance(), p->m_lpszOrigName, &wc))
1612*cdf0e10cSrcweir                                                 {
1613*cdf0e10cSrcweir                                                         fFail = TRUE;
1614*cdf0e10cSrcweir-                                                        __leave;
1615*cdf0e10cSrcweir+                                                        __builtin_longjmp(_sejmpbuf, -1);
1616*cdf0e10cSrcweir                                                 }
1617*cdf0e10cSrcweir                                         }
1618*cdf0e10cSrcweir                                         memcpy(&p->m_wc, &wc, sizeof(WNDCLASSEX));
1619*cdf0e10cSrcweir@@ -3090,10 +3118,7 @@
1620*cdf0e10cSrcweir                                         p->m_atom = ::RegisterClassExW(&p->m_wc);
1621*cdf0e10cSrcweir                         }
1622*cdf0e10cSrcweir                 }
1623*cdf0e10cSrcweir-                __finally
1624*cdf0e10cSrcweir-                {
1625*cdf0e10cSrcweir-                        ::LeaveCriticalSection(&pM->m_csWindowCreate);
1626*cdf0e10cSrcweir-                }
1627*cdf0e10cSrcweir+                _sehandler.Reset();
1628*cdf0e10cSrcweir         }
1629*cdf0e10cSrcweir
1630*cdf0e10cSrcweir         if (fFail)
1631*cdf0e10cSrcweir--- include/atl/statreg.h.orig	2005-04-14 17:54:34.000000000 +0900
1632*cdf0e10cSrcweir+++ include/atl/statreg.h	2006-09-18 20:05:01.468750000 +0900
1633*cdf0e10cSrcweir@@ -573,15 +573,16 @@
1634*cdf0e10cSrcweir         return hRes;
1635*cdf0e10cSrcweir }
1636*cdf0e10cSrcweir
1637*cdf0e10cSrcweir-__declspec(selectany) LPCTSTR CRegParser::rgszNeverDelete[] = //Component Catagories
1638*cdf0e10cSrcweir+#ifdef _INIT_ATL_COMMON_VARS
1639*cdf0e10cSrcweir+LPCTSTR CRegParser::rgszNeverDelete[] = //Component Catagories
1640*cdf0e10cSrcweir {
1641*cdf0e10cSrcweir         _T("CLSID"), _T("TYPELIB")
1642*cdf0e10cSrcweir };
1643*cdf0e10cSrcweir
1644*cdf0e10cSrcweir-__declspec(selectany) const int CRegParser::cbNeverDelete = sizeof(rgszNeverDelete) / sizeof(LPCTSTR*);
1645*cdf0e10cSrcweir-__declspec(selectany) const int CRegParser::MAX_VALUE=4096;
1646*cdf0e10cSrcweir-__declspec(selectany) const int CRegParser::MAX_TYPE=MAX_VALUE;
1647*cdf0e10cSrcweir-
1648*cdf0e10cSrcweir+const int CRegParser::cbNeverDelete = sizeof(rgszNeverDelete) / sizeof(LPCTSTR*);
1649*cdf0e10cSrcweir+const int CRegParser::MAX_VALUE=4096;
1650*cdf0e10cSrcweir+const int CRegParser::MAX_TYPE=MAX_VALUE;
1651*cdf0e10cSrcweir+#endif
1652*cdf0e10cSrcweir
1653*cdf0e10cSrcweir inline BOOL CRegParser::VTFromRegType(LPCTSTR szValueType, VARTYPE& vt)
1654*cdf0e10cSrcweir {
1655