/*1* Copyright 2012 Stefan Leichter2*3* This library is free software; you can redistribute it and/or4* modify it under the terms of the GNU Lesser General Public5* License as published by the Free Software Foundation; either6* version 2.1 of the License, or (at your option) any later version.7*8* This library is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11* Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public14* License along with this library; if not, write to the Free Software15* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA16*/1718#include <stdarg.h>19#include <stdio.h>2021#define COBJMACROS2223#include "windef.h"24#include "winbase.h"25#include "winerror.h"26#include "winuser.h"27#include "atlbase.h"2829#include "wine/debug.h"3031WINE_DEFAULT_DEBUG_CHANNEL(atl);3233/***********************************************************************34* AtlRegisterTypeLib [atl80.18]35*/36HRESULT WINAPI AtlComModuleRegisterServer(_ATL_COM_MODULE *mod, BOOL bRegTypeLib, const CLSID *clsid)37{38const struct _ATL_CATMAP_ENTRY *catmap;39_ATL_OBJMAP_ENTRY **iter;40HRESULT hres;4142TRACE("(%p %x %s)\n", mod, bRegTypeLib, debugstr_guid(clsid));4344for(iter = mod->m_ppAutoObjMapFirst; iter < mod->m_ppAutoObjMapLast; iter++) {45if(!*iter || (clsid && !IsEqualCLSID((*iter)->pclsid, clsid)))46continue;4748TRACE("Registering clsid %s\n", debugstr_guid((*iter)->pclsid));49hres = (*iter)->pfnUpdateRegistry(TRUE);50if(FAILED(hres))51return hres;5253catmap = (*iter)->pfnGetCategoryMap();54if(catmap) {55hres = AtlRegisterClassCategoriesHelper((*iter)->pclsid, catmap, TRUE);56if(FAILED(hres))57return hres;58}59}6061if(bRegTypeLib) {62hres = AtlRegisterTypeLib(mod->m_hInstTypeLib, NULL);63if(FAILED(hres))64return hres;65}6667return S_OK;68}697071