Commit a97a6676 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

atl100: Added AtlUpdateRegistryFromResourceD implementation (based on…

atl100: Added AtlUpdateRegistryFromResourceD implementation (based on AtlModuleUpdateRegistryFromResourceD).
parent 9b4e92a6
......@@ -7,7 +7,7 @@
17 stub AtlComModuleRegisterClassObjects
20 stub AtlComModuleRevokeClassObjects
22 stub AtlComModuleUnregisterServer
23 stub AtlUpdateRegistryFromResourceD
23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr)
24 stub AtlWaitWithMessageLoop
25 stub AtlSetErrorInfo
26 stdcall AtlCreateTargetDC(long ptr)
......
......@@ -702,3 +702,48 @@ HRESULT WINAPI AtlCreateRegistrar(IRegistrar **ret)
*ret = &registrar->IRegistrar_iface;
return S_OK;
}
/***********************************************************************
* AtlUpdateRegistryFromResourceD [atl100.@]
*/
HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE inst, LPCOLESTR res,
BOOL bRegister, struct _ATL_REGMAP_ENTRY *pMapEntries, IRegistrar *pReg)
{
const struct _ATL_REGMAP_ENTRY *iter;
WCHAR module_name[MAX_PATH];
IRegistrar *registrar;
HRESULT hres;
static const WCHAR moduleW[] = {'M','O','D','U','L','E',0};
static const WCHAR registryW[] = {'R','E','G','I','S','T','R','Y',0};
if(!GetModuleFileNameW(inst, module_name, MAX_PATH)) {
FIXME("hinst %p: did not get module name\n", inst);
return E_FAIL;
}
TRACE("%p (%s), %s, %d, %p, %p\n", inst, debugstr_w(module_name),
debugstr_w(res), bRegister, pMapEntries, pReg);
if(pReg) {
registrar = pReg;
}else {
hres = AtlCreateRegistrar(&registrar);
if(FAILED(hres))
return hres;
}
IRegistrar_AddReplacement(registrar, moduleW, module_name);
for (iter = pMapEntries; iter && iter->szKey; iter++)
IRegistrar_AddReplacement(registrar, iter->szKey, iter->szData);
if(bRegister)
hres = IRegistrar_ResourceRegisterSz(registrar, module_name, res, registryW);
else
hres = IRegistrar_ResourceUnregisterSz(registrar, module_name, res, registryW);
if(registrar != pReg)
IRegistrar_Release(registrar);
return hres;
}
......@@ -210,5 +210,6 @@ HRESULT WINAPI AtlModuleTerm(_ATL_MODULEW* pM);
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID * iid, DWORD dw);
HRESULT WINAPI AtlUnmarshalPtr(IStream *pStream, const IID *iid, IUnknown **ppUnk);
HRESULT WINAPI AtlCreateRegistrar(IRegistrar**);
HRESULT WINAPI AtlUpdateRegistryFromResourceD(HINSTANCE,LPCOLESTR,BOOL,struct _ATL_REGMAP_ENTRY*,IRegistrar*);
#endif /* __WINE_ATLBASE_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment