Index: lib/atl/atlcom.h =================================================================== --- lib/atl/atlcom.h (revision 58787) +++ lib/atl/atlcom.h (working copy) @@ -2,6 +2,7 @@ * ReactOS ATL * * Copyright 2009 Andrew Hill + * Copyright 2013 Katayama Hirofumi MZ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -134,39 +135,26 @@ virtual ~CComObject() { - CComObject *pThis; - - pThis = reinterpret_cast *>(this); - pThis->FinalRelease(); + this->FinalRelease(); _pAtlModule->Unlock(); } STDMETHOD_(ULONG, AddRef)() { - CComObject *pThis; - - pThis = reinterpret_cast *>(this); - return pThis->InternalAddRef(); + return this->InternalAddRef(); } STDMETHOD_(ULONG, Release)() { - CComObject *pThis; - ULONG l; - - pThis = reinterpret_cast *>(this); - l = pThis->InternalRelease(); - if (l == 0) + ULONG ul = this->InternalRelease(); + if (ul == 0) delete this; - return l; + return ul; } STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject) { - CComObject *pThis; - - pThis = reinterpret_cast *>(this); - return pThis->_InternalQueryInterface(iid, ppvObject); + return this->_InternalQueryInterface(iid, ppvObject); } static HRESULT WINAPI CreateInstance(CComObject **pp) @@ -283,36 +271,25 @@ STDMETHOD_(ULONG, AddRef)() { - CComObjectCached *pThis; - ULONG newRefCount; - - pThis = reinterpret_cast*>(this); - newRefCount = pThis->InternalAddRef(); - if (newRefCount == 2) + ULONG ul = this->InternalAddRef(); + if (ul == 2) _pAtlModule->Lock(); - return newRefCount; + return ul; } STDMETHOD_(ULONG, Release)() { - CComObjectCached *pThis; - ULONG newRefCount; - - pThis = reinterpret_cast*>(this); - newRefCount = pThis->InternalRelease(); - if (newRefCount == 0) + ULONG ul = this->InternalRelease(); + if (ul == 0) delete this; - else if (newRefCount == 1) + else if (ul == 1) _pAtlModule->Unlock(); - return newRefCount; + return ul; } STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject) { - CComObjectCached *pThis; - - pThis = reinterpret_cast*>(this); - return pThis->_InternalQueryInterface(iid, ppvObject); + return this->_InternalQueryInterface(iid, ppvObject); } }; @@ -436,6 +413,11 @@ { public: _ATL_CREATORFUNC *m_pfnCreateInstance; + + virtual ~CComClassFactory() + { + } + public: STDMETHOD(CreateInstance)(LPUNKNOWN pUnkOuter, REFIID riid, void **ppvObj) { Index: lib/atl/statreg.h =================================================================== --- lib/atl/statreg.h (revision 58787) +++ lib/atl/statreg.h (working copy) @@ -60,9 +60,9 @@ ~CRegObject() { HRESULT hResult; - hResult = ClearReplacements(); ATLASSERT(SUCCEEDED(hResult)); + hResult = hResult; } HRESULT STDMETHODCALLTYPE QueryInterface(const IID & /* riid */, void ** /* ppvObject */ )