From 131d9964b7a5be574177ca9393d00240575840a1 Mon Sep 17 00:00:00 2001 From: Andrey Turkin Date: Sat, 11 Nov 2006 00:08:11 +0300 Subject: [PATCH] atl: Implement AtlModuleRegisterServer. --- dlls/atl/atl_main.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 7195f135284..c64ef46ecfa 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -257,7 +257,34 @@ HRESULT WINAPI AtlInternalQueryInterface(LPVOID this, const _ATL_INTMAP_ENTRY* p */ HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID* clsid) { - FIXME("%p %d %s\n", pM, bRegTypeLib, debugstr_guid(clsid)); + int i; + HRESULT hRes; + + TRACE("%p %d %s\n", pM, bRegTypeLib, debugstr_guid(clsid)); + + if (pM == NULL) + return E_INVALIDARG; + + for (i = 0; pM->m_pObjMap[i].pclsid != NULL; i++) /* register CLSIDs */ + { + if (!clsid || IsEqualCLSID(pM->m_pObjMap[i].pclsid, clsid)) + { + const _ATL_OBJMAP_ENTRYW *obj = &pM->m_pObjMap[i]; + + TRACE("Registering clsid %s\n", debugstr_guid(obj->pclsid)); + hRes = obj->pfnUpdateRegistry(TRUE); /* register */ + if (FAILED(hRes)) + return hRes; + } + } + + if (bRegTypeLib) + { + hRes = AtlModuleRegisterTypeLib(pM, NULL); + if (FAILED(hRes)) + return hRes; + } + return S_OK; }