ATL: Added AtlModuleAddTermFunc implementation

Jacek Caban jack at itma.pwr.wroc.pl
Wed Oct 5 17:12:25 CDT 2005


This patch should fix bug 2266

Changelog:
    Added AtlModuleAddTermFunc implementation
-------------- next part --------------
Index: dlls/atl/atl.spec
===================================================================
RCS file: /home/wine/wine/dlls/atl/atl.spec,v
retrieving revision 1.10
diff -u -p -r1.10 atl.spec
--- dlls/atl/atl.spec	8 Aug 2005 17:35:29 -0000	1.10
+++ dlls/atl/atl.spec	5 Oct 2005 22:06:12 -0000
@@ -49,4 +49,4 @@
 55 stub AtlModuleUnRegisterTypeLib
 56 stub AtlModuleLoadTypeLib
 57 stdcall AtlModuleUnregisterServerEx(ptr long ptr)
-58 stub AtlModuleAddTermFunc
+58 stdcall AtlModuleAddTermFunc(ptr ptr long)
Index: dlls/atl/atl_main.c
===================================================================
RCS file: /home/wine/wine/dlls/atl/atl_main.c,v
retrieving revision 1.13
diff -u -p -r1.13 atl_main.c
--- dlls/atl/atl_main.c	24 Aug 2005 18:13:24 -0000	1.13
+++ dlls/atl/atl_main.c	5 Oct 2005 22:06:12 -0000
@@ -91,7 +91,35 @@ HRESULT WINAPI AtlModuleInit(_ATL_MODULE
 
 HRESULT WINAPI AtlModuleTerm(_ATL_MODULEA* pM)
 {
+    _ATL_TERMFUNC_ELEM *iter = pM->m_pTermFuncs, *tmp;
+
+    TRACE("(%p)\n", pM);
+
+    while(iter) {
+        iter->pFunc(iter->dw);
+        tmp = iter;
+        iter = iter->pNext;
+        HeapFree(GetProcessHeap(), 0, tmp);
+    }
+
     HeapFree(GetProcessHeap(), 0, pM);
+
+    return S_OK;
+}
+
+HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULEW *pM, _ATL_TERMFUNC pFunc, DWORD dw)
+{
+    _ATL_TERMFUNC_ELEM *termfunc_elem;
+
+    TRACE("(%p %p %ld)\n", pM, pFunc, dw);
+
+    termfunc_elem = HeapAlloc(GetProcessHeap(), 0, sizeof(_ATL_TERMFUNC_ELEM));
+    termfunc_elem->pFunc = pFunc;
+    termfunc_elem->dw = dw;
+    termfunc_elem->pNext = pM->m_pTermFuncs;
+
+    pM->m_pTermFuncs = termfunc_elem;
+
     return S_OK;
 }
 
Index: dlls/atl/atlbase.h
===================================================================
RCS file: /home/wine/wine/dlls/atl/atlbase.h,v
retrieving revision 1.4
diff -u -p -r1.4 atlbase.h
--- dlls/atl/atlbase.h	22 Jun 2005 12:00:12 -0000	1.4
+++ dlls/atl/atlbase.h	5 Oct 2005 22:06:12 -0000
@@ -145,6 +145,7 @@ HRESULT WINAPI AtlAdvise(IUnknown *pUnkC
 HRESULT WINAPI AtlFreeMarshalStream(IStream *pStream);
 HRESULT WINAPI AtlInternalQueryInterface(LPVOID pThis, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, LPVOID* ppvObject);
 HRESULT WINAPI AtlMarshalPtrInProc(IUnknown *pUnk, const IID *iid, IStream **ppStream);
+HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULEW *pM, _ATL_TERMFUNC pFunc, DWORD dw);
 HRESULT WINAPI AtlModuleInit(_ATL_MODULEA* pM, _ATL_OBJMAP_ENTRYA* p, HINSTANCE h);
 HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEA* pM, DWORD dwClsContext, DWORD dwFlags);
 HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* pCLSID);


More information about the wine-patches mailing list