mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 05:28:14 +00:00
[ATL100]
* Sync with Wine 1.7.1. svn path=/trunk/; revision=60087
This commit is contained in:
parent
1a0744c854
commit
e4852d7c49
6 changed files with 677 additions and 32 deletions
|
@ -1,5 +1,7 @@
|
|||
|
||||
add_definitions(-D__WINESRC__)
|
||||
add_definitions(
|
||||
-D__WINESRC__
|
||||
-D_ATL_VER=_ATL_VER_100)
|
||||
|
||||
remove_definitions(-D_WIN32_WINNT=0x502)
|
||||
add_definitions(-D_WIN32_WINNT=0x600)
|
||||
|
@ -18,6 +20,5 @@ list(APPEND SOURCE
|
|||
add_library(atl100 SHARED ${SOURCE})
|
||||
set_module_type(atl100 win32dll)
|
||||
target_link_libraries(atl100 uuid wine)
|
||||
|
||||
add_importlibs(atl100 ole32 oleaut32 user32 gdi32 advapi32 msvcrt kernel32 ntdll)
|
||||
add_cd_file(TARGET atl100 DESTINATION reactos/system32 FOR all)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright 2012 Stefan Leichter
|
||||
* Copyright 2012 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -25,22 +26,58 @@
|
|||
#include <stdarg.h>
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winreg.h>
|
||||
#include <wingdi.h>
|
||||
#include <objbase.h>
|
||||
#include <oleauto.h>
|
||||
|
||||
#include <atlbase.h>
|
||||
#include <wine/atlbase.h>
|
||||
#include <wine/unicode.h>
|
||||
|
||||
#include <wine/debug.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(atl);
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(atl100);
|
||||
|
||||
typedef unsigned char cpp_bool;
|
||||
|
||||
static inline void *heap_alloc(size_t len)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), 0, len);
|
||||
}
|
||||
|
||||
static inline BOOL heap_free(void *mem)
|
||||
{
|
||||
return HeapFree(GetProcessHeap(), 0, mem);
|
||||
}
|
||||
|
||||
static ICatRegister *catreg;
|
||||
|
||||
/***********************************************************************
|
||||
* AtlAdvise [atl100.@]
|
||||
*/
|
||||
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, LPDWORD pdw)
|
||||
HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, DWORD *pdw)
|
||||
{
|
||||
FIXME("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw);
|
||||
return E_FAIL;
|
||||
IConnectionPointContainer *container;
|
||||
IConnectionPoint *cp;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("%p %p %p %p\n", pUnkCP, pUnk, iid, pdw);
|
||||
|
||||
if(!pUnkCP)
|
||||
return E_INVALIDARG;
|
||||
|
||||
hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IConnectionPointContainer_FindConnectionPoint(container, iid, &cp);
|
||||
IConnectionPointContainer_Release(container);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IConnectionPoint_Advise(cp, pUnk, pdw);
|
||||
IConnectionPoint_Release(cp);
|
||||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -48,8 +85,27 @@ HRESULT WINAPI AtlAdvise(IUnknown *pUnkCP, IUnknown *pUnk, const IID *iid, LPDWO
|
|||
*/
|
||||
HRESULT WINAPI AtlUnadvise(IUnknown *pUnkCP, const IID *iid, DWORD dw)
|
||||
{
|
||||
FIXME("%p %p %d\n", pUnkCP, iid, dw);
|
||||
return S_OK;
|
||||
IConnectionPointContainer *container;
|
||||
IConnectionPoint *cp;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("%p %p %d\n", pUnkCP, iid, dw);
|
||||
|
||||
if(!pUnkCP)
|
||||
return E_INVALIDARG;
|
||||
|
||||
hres = IUnknown_QueryInterface(pUnkCP, &IID_IConnectionPointContainer, (void**)&container);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IConnectionPointContainer_FindConnectionPoint(container, iid, &cp);
|
||||
IConnectionPointContainer_Release(container);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IConnectionPoint_Unadvise(cp, dw);
|
||||
IConnectionPoint_Release(cp);
|
||||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -236,10 +292,526 @@ HRESULT WINAPI AtlIPersistStreamInit_Save(LPSTREAM pStm, BOOL fClearDirty,
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlIPersistPropertyBag_Load [atl100.@]
|
||||
*/
|
||||
HRESULT WINAPI AtlIPersistPropertyBag_Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErrorLog,
|
||||
ATL_PROPMAP_ENTRY *pMap, void *pThis,
|
||||
IUnknown *pUnk)
|
||||
{
|
||||
FIXME("(%p, %p, %p, %p, %p)\n", pPropBag, pErrorLog, pMap, pThis, pUnk);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlModuleAddTermFunc [atl100.@]
|
||||
*/
|
||||
HRESULT WINAPI AtlModuleAddTermFunc(_ATL_MODULE *pM, _ATL_TERMFUNC *pFunc, DWORD_PTR 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;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlCallTermFunc [atl100.@]
|
||||
*/
|
||||
void WINAPI AtlCallTermFunc(_ATL_MODULE *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);
|
||||
}
|
||||
|
||||
pM->m_pTermFuncs = NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlLoadTypeLib [atl100.56]
|
||||
*/
|
||||
HRESULT WINAPI AtlLoadTypeLib(HINSTANCE inst, LPCOLESTR lpszIndex,
|
||||
BSTR *pbstrPath, ITypeLib **ppTypeLib)
|
||||
{
|
||||
size_t path_len, index_len;
|
||||
ITypeLib *typelib = NULL;
|
||||
WCHAR *path;
|
||||
HRESULT hres;
|
||||
|
||||
static const WCHAR tlb_extW[] = {'.','t','l','b',0};
|
||||
|
||||
TRACE("(%p %s %p %p)\n", inst, debugstr_w(lpszIndex), pbstrPath, ppTypeLib);
|
||||
|
||||
index_len = lpszIndex ? strlenW(lpszIndex) : 0;
|
||||
path = heap_alloc((MAX_PATH+index_len)*sizeof(WCHAR) + sizeof(tlb_extW));
|
||||
if(!path)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
path_len = GetModuleFileNameW(inst, path, MAX_PATH);
|
||||
if(!path_len) {
|
||||
heap_free(path);
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
}
|
||||
|
||||
if(index_len)
|
||||
memcpy(path+path_len, lpszIndex, (index_len+1)*sizeof(WCHAR));
|
||||
|
||||
hres = LoadTypeLib(path, &typelib);
|
||||
if(FAILED(hres)) {
|
||||
WCHAR *ptr;
|
||||
|
||||
for(ptr = path+path_len-1; ptr > path && *ptr != '\\' && *ptr != '.'; ptr--);
|
||||
if(*ptr != '.')
|
||||
ptr = path+path_len;
|
||||
memcpy(ptr, tlb_extW, sizeof(tlb_extW));
|
||||
hres = LoadTypeLib(path, &typelib);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(hres)) {
|
||||
*pbstrPath = SysAllocString(path);
|
||||
if(!*pbstrPath) {
|
||||
ITypeLib_Release(typelib);
|
||||
hres = E_OUTOFMEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
heap_free(path);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
*ppTypeLib = typelib;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlWinModuleInit [atl100.65]
|
||||
*/
|
||||
HRESULT WINAPI AtlWinModuleInit(_ATL_WIN_MODULE *winmod)
|
||||
{
|
||||
TRACE("(%p\n", winmod);
|
||||
|
||||
if(winmod->cbSize != sizeof(*winmod))
|
||||
return E_INVALIDARG;
|
||||
|
||||
InitializeCriticalSection(&winmod->m_csWindowCreate);
|
||||
winmod->m_pCreateWndList = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlWinModuleAddCreateWndData [atl100.43]
|
||||
*/
|
||||
void WINAPI AtlWinModuleAddCreateWndData(_ATL_WIN_MODULE *pM, _AtlCreateWndData *pData, void *pvObject)
|
||||
{
|
||||
TRACE("(%p, %p, %p)\n", pM, pData, pvObject);
|
||||
|
||||
pData->m_pThis = pvObject;
|
||||
pData->m_dwThreadID = GetCurrentThreadId();
|
||||
|
||||
EnterCriticalSection(&pM->m_csWindowCreate);
|
||||
pData->m_pNext = pM->m_pCreateWndList;
|
||||
pM->m_pCreateWndList = pData;
|
||||
LeaveCriticalSection(&pM->m_csWindowCreate);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlWinModuleExtractCreateWndData [atl100.44]
|
||||
*/
|
||||
void* WINAPI AtlWinModuleExtractCreateWndData(_ATL_WIN_MODULE *winmod)
|
||||
{
|
||||
_AtlCreateWndData *iter, *prev = NULL;
|
||||
DWORD thread_id;
|
||||
|
||||
TRACE("(%p)\n", winmod);
|
||||
|
||||
thread_id = GetCurrentThreadId();
|
||||
|
||||
EnterCriticalSection(&winmod->m_csWindowCreate);
|
||||
|
||||
for(iter = winmod->m_pCreateWndList; iter && iter->m_dwThreadID != thread_id; iter = iter->m_pNext)
|
||||
prev = iter;
|
||||
if(iter) {
|
||||
if(prev)
|
||||
prev->m_pNext = iter->m_pNext;
|
||||
else
|
||||
winmod->m_pCreateWndList = iter->m_pNext;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&winmod->m_csWindowCreate);
|
||||
|
||||
return iter ? iter->m_pThis : NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlComModuleGetClassObject [atl100.15]
|
||||
*/
|
||||
HRESULT WINAPI AtlComModuleGetClassObject(_ATL_COM_MODULE *pm, REFCLSID rclsid, REFIID riid, void **ppv)
|
||||
{
|
||||
_ATL_OBJMAP_ENTRY **iter;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p %s %s %p)\n", pm, debugstr_guid(rclsid), debugstr_guid(riid), ppv);
|
||||
|
||||
if(!pm)
|
||||
return E_INVALIDARG;
|
||||
|
||||
for(iter = pm->m_ppAutoObjMapFirst; iter < pm->m_ppAutoObjMapLast; iter++) {
|
||||
if(IsEqualCLSID((*iter)->pclsid, rclsid) && (*iter)->pfnGetClassObject) {
|
||||
if(!(*iter)->pCF)
|
||||
hres = (*iter)->pfnGetClassObject((*iter)->pfnCreateInstance, &IID_IUnknown, (void**)&(*iter)->pCF);
|
||||
if((*iter)->pCF)
|
||||
hres = IUnknown_QueryInterface((*iter)->pCF, riid, ppv);
|
||||
TRACE("returning %p (%08x)\n", *ppv, hres);
|
||||
return hres;
|
||||
}
|
||||
}
|
||||
|
||||
WARN("Class %s not found\n", debugstr_guid(rclsid));
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlComModuleRegisterClassObjects [atl100.17]
|
||||
*/
|
||||
HRESULT WINAPI AtlComModuleRegisterClassObjects(_ATL_COM_MODULE *module, DWORD context, DWORD flags)
|
||||
{
|
||||
_ATL_OBJMAP_ENTRY **iter;
|
||||
IUnknown *unk;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p %x %x)\n", module, context, flags);
|
||||
|
||||
if(!module)
|
||||
return E_INVALIDARG;
|
||||
|
||||
for(iter = module->m_ppAutoObjMapFirst; iter < module->m_ppAutoObjMapLast; iter++) {
|
||||
if(!(*iter)->pfnGetClassObject)
|
||||
continue;
|
||||
|
||||
hres = (*iter)->pfnGetClassObject((*iter)->pfnCreateInstance, &IID_IUnknown, (void**)&unk);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = CoRegisterClassObject((*iter)->pclsid, unk, context, flags, &(*iter)->dwRegister);
|
||||
IUnknown_Release(unk);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlComModuleUnregisterServer [atl100.22]
|
||||
*/
|
||||
HRESULT WINAPI AtlComModuleUnregisterServer(_ATL_COM_MODULE *mod, BOOL bRegTypeLib, const CLSID *clsid)
|
||||
{
|
||||
const struct _ATL_CATMAP_ENTRY *catmap;
|
||||
_ATL_OBJMAP_ENTRY **iter;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p %x %s)\n", mod, bRegTypeLib, debugstr_guid(clsid));
|
||||
|
||||
for(iter = mod->m_ppAutoObjMapFirst; iter < mod->m_ppAutoObjMapLast; iter++) {
|
||||
if(!*iter || (clsid && !IsEqualCLSID((*iter)->pclsid, clsid)))
|
||||
continue;
|
||||
|
||||
TRACE("Unregistering clsid %s\n", debugstr_guid((*iter)->pclsid));
|
||||
|
||||
catmap = (*iter)->pfnGetCategoryMap();
|
||||
if(catmap) {
|
||||
hres = AtlRegisterClassCategoriesHelper((*iter)->pclsid, catmap, FALSE);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
hres = (*iter)->pfnUpdateRegistry(FALSE);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
if(bRegTypeLib) {
|
||||
ITypeLib *typelib;
|
||||
TLIBATTR *attr;
|
||||
BSTR path;
|
||||
|
||||
hres = AtlLoadTypeLib(mod->m_hInstTypeLib, NULL, &path, &typelib);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
SysFreeString(path);
|
||||
hres = ITypeLib_GetLibAttr(typelib, &attr);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = UnRegisterTypeLib(&attr->guid, attr->wMajorVerNum, attr->wMinorVerNum, attr->lcid, attr->syskind);
|
||||
ITypeLib_ReleaseTLibAttr(typelib, attr);
|
||||
}
|
||||
ITypeLib_Release(typelib);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlRegisterClassCategoriesHelper [atl100.49]
|
||||
*/
|
||||
HRESULT WINAPI AtlRegisterClassCategoriesHelper(REFCLSID clsid, const struct _ATL_CATMAP_ENTRY *catmap, BOOL reg)
|
||||
{
|
||||
const struct _ATL_CATMAP_ENTRY *iter;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%s %p %x)\n", debugstr_guid(clsid), catmap, reg);
|
||||
|
||||
if(!catmap)
|
||||
return S_OK;
|
||||
|
||||
if(!catreg) {
|
||||
ICatRegister *new_catreg;
|
||||
|
||||
hres = CoCreateInstance(&CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER,
|
||||
&IID_ICatRegister, (void**)&new_catreg);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
if(InterlockedCompareExchangePointer((void**)&catreg, new_catreg, NULL))
|
||||
ICatRegister_Release(new_catreg);
|
||||
}
|
||||
|
||||
for(iter = catmap; iter->iType != _ATL_CATMAP_ENTRY_END; iter++) {
|
||||
CATID catid = *iter->pcatid; /* For stupid lack of const in ICatRegister declaration. */
|
||||
|
||||
if(iter->iType == _ATL_CATMAP_ENTRY_IMPLEMENTED) {
|
||||
if(reg)
|
||||
hres = ICatRegister_RegisterClassImplCategories(catreg, clsid, 1, &catid);
|
||||
else
|
||||
hres = ICatRegister_UnRegisterClassImplCategories(catreg, clsid, 1, &catid);
|
||||
}else {
|
||||
if(reg)
|
||||
hres = ICatRegister_RegisterClassReqCategories(catreg, clsid, 1, &catid);
|
||||
else
|
||||
hres = ICatRegister_UnRegisterClassReqCategories(catreg, clsid, 1, &catid);
|
||||
}
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
if(!reg) {
|
||||
WCHAR reg_path[256] = {'C','L','S','I','D','\\'}, *ptr = reg_path+6;
|
||||
|
||||
static const WCHAR implemented_catW[] =
|
||||
{'I','m','p','l','e','m','e','n','t','e','d',' ','C','a','t','e','g','o','r','i','e','s',0};
|
||||
static const WCHAR required_catW[] =
|
||||
{'R','e','q','u','i','r','e','d',' ','C','a','t','e','g','o','r','i','e','s',0};
|
||||
|
||||
ptr += StringFromGUID2(clsid, ptr, 64)-1;
|
||||
*ptr++ = '\\';
|
||||
|
||||
memcpy(ptr, implemented_catW, sizeof(implemented_catW));
|
||||
RegDeleteKeyW(HKEY_CLASSES_ROOT, reg_path);
|
||||
|
||||
memcpy(ptr, required_catW, sizeof(required_catW));
|
||||
RegDeleteKeyW(HKEY_CLASSES_ROOT, reg_path);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlWaitWithMessageLoop [atl100.24]
|
||||
*/
|
||||
BOOL WINAPI AtlWaitWithMessageLoop(HANDLE handle)
|
||||
{
|
||||
MSG msg;
|
||||
DWORD res;
|
||||
|
||||
TRACE("(%p)\n", handle);
|
||||
|
||||
while(1) {
|
||||
res = MsgWaitForMultipleObjects(1, &handle, FALSE, INFINITE, QS_ALLINPUT);
|
||||
switch(res) {
|
||||
case WAIT_OBJECT_0:
|
||||
return TRUE;
|
||||
case WAIT_OBJECT_0+1:
|
||||
if(GetMessageW(&msg, NULL, 0, 0) < 0)
|
||||
return FALSE;
|
||||
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessageW(&msg);
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT get_default_source(ITypeLib *typelib, const CLSID *clsid, IID *iid)
|
||||
{
|
||||
ITypeInfo *typeinfo, *src_typeinfo = NULL;
|
||||
TYPEATTR *attr;
|
||||
int type_flags;
|
||||
unsigned i;
|
||||
HRESULT hres;
|
||||
|
||||
hres = ITypeLib_GetTypeInfoOfGuid(typelib, clsid, &typeinfo);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = ITypeInfo_GetTypeAttr(typeinfo, &attr);
|
||||
if(FAILED(hres)) {
|
||||
ITypeInfo_Release(typeinfo);
|
||||
return hres;
|
||||
}
|
||||
|
||||
for(i=0; i < attr->cImplTypes; i++) {
|
||||
hres = ITypeInfo_GetImplTypeFlags(typeinfo, i, &type_flags);
|
||||
if(SUCCEEDED(hres) && type_flags == (IMPLTYPEFLAG_FSOURCE|IMPLTYPEFLAG_FDEFAULT)) {
|
||||
HREFTYPE ref;
|
||||
|
||||
hres = ITypeInfo_GetRefTypeOfImplType(typeinfo, i, &ref);
|
||||
if(SUCCEEDED(hres))
|
||||
hres = ITypeInfo_GetRefTypeInfo(typeinfo, ref, &src_typeinfo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ITypeInfo_ReleaseTypeAttr(typeinfo, attr);
|
||||
ITypeInfo_Release(typeinfo);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
if(!src_typeinfo) {
|
||||
*iid = IID_NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
hres = ITypeInfo_GetTypeAttr(src_typeinfo, &attr);
|
||||
if(SUCCEEDED(hres)) {
|
||||
*iid = attr->guid;
|
||||
ITypeInfo_ReleaseTypeAttr(src_typeinfo, attr);
|
||||
}
|
||||
ITypeInfo_Release(src_typeinfo);
|
||||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlGetObjectSourceInterface [atl100.54]
|
||||
*/
|
||||
HRESULT WINAPI AtlGetObjectSourceInterface(IUnknown *unk, GUID *libid, IID *iid, unsigned short *major, unsigned short *minor)
|
||||
{
|
||||
IProvideClassInfo2 *classinfo;
|
||||
ITypeInfo *typeinfo;
|
||||
ITypeLib *typelib;
|
||||
IPersist *persist;
|
||||
IDispatch *disp;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p %p %p %p %p)\n", unk, libid, iid, major, minor);
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IDispatch_GetTypeInfo(disp, 0, 0, &typeinfo);
|
||||
IDispatch_Release(disp);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = ITypeInfo_GetContainingTypeLib(typeinfo, &typelib, 0);
|
||||
ITypeInfo_Release(typeinfo);
|
||||
if(SUCCEEDED(hres)) {
|
||||
TLIBATTR *attr;
|
||||
|
||||
hres = ITypeLib_GetLibAttr(typelib, &attr);
|
||||
if(SUCCEEDED(hres)) {
|
||||
*libid = attr->guid;
|
||||
*major = attr->wMajorVerNum;
|
||||
*minor = attr->wMinorVerNum;
|
||||
ITypeLib_ReleaseTLibAttr(typelib, attr);
|
||||
}else {
|
||||
ITypeLib_Release(typelib);
|
||||
}
|
||||
}
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IProvideClassInfo2, (void**)&classinfo);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IProvideClassInfo2_GetGUID(classinfo, GUIDKIND_DEFAULT_SOURCE_DISP_IID, iid);
|
||||
IProvideClassInfo2_Release(classinfo);
|
||||
ITypeLib_Release(typelib);
|
||||
return hres;
|
||||
}
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IPersist, (void**)&persist);
|
||||
if(SUCCEEDED(hres)) {
|
||||
CLSID clsid;
|
||||
|
||||
hres = IPersist_GetClassID(persist, &clsid);
|
||||
if(SUCCEEDED(hres))
|
||||
hres = get_default_source(typelib, &clsid, iid);
|
||||
IPersist_Release(persist);
|
||||
}
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlSetPerUserRegistration [atl100.67]
|
||||
*/
|
||||
HRESULT WINAPI AtlSetPerUserRegistration(cpp_bool bEnable)
|
||||
{
|
||||
FIXME("stub: bEnable: %d\n", bEnable);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlGetPerUserRegistration [atl100.68]
|
||||
*/
|
||||
HRESULT WINAPI AtlGetPerUserRegistration(cpp_bool *pbEnabled)
|
||||
{
|
||||
FIXME("stub: returning false\n");
|
||||
*pbEnabled = 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlGetVersion [atl100.@]
|
||||
*/
|
||||
DWORD WINAPI AtlGetVersion(void *pReserved)
|
||||
{
|
||||
return 0x0a00;
|
||||
return _ATL_VER;
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
|
||||
|
||||
switch(fdwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hinstDLL);
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
if (lpvReserved) break;
|
||||
if(catreg)
|
||||
ICatRegister_Release(catreg);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
12 stdcall AtlFreeMarshalStream(ptr)
|
||||
13 stdcall AtlMarshalPtrInProc(ptr ptr ptr)
|
||||
14 stdcall AtlUnmarshalPtr(ptr ptr ptr)
|
||||
15 stub AtlComModuleGetClassObject
|
||||
17 stub AtlComModuleRegisterClassObjects
|
||||
15 stdcall AtlComModuleGetClassObject(ptr ptr ptr ptr)
|
||||
17 stdcall AtlComModuleRegisterClassObjects(ptr long long)
|
||||
20 stub AtlComModuleRevokeClassObjects
|
||||
22 stub AtlComModuleUnregisterServer
|
||||
23 stub AtlUpdateRegistryFromResourceD
|
||||
24 stub AtlWaitWithMessageLoop
|
||||
22 stdcall AtlComModuleUnregisterServer(ptr long ptr)
|
||||
23 stdcall AtlUpdateRegistryFromResourceD(long wstr long ptr ptr)
|
||||
24 stdcall AtlWaitWithMessageLoop(long)
|
||||
25 stub AtlSetErrorInfo
|
||||
26 stdcall AtlCreateTargetDC(long ptr)
|
||||
27 stdcall AtlHiMetricToPixel(ptr ptr)
|
||||
|
@ -18,35 +18,35 @@
|
|||
31 stdcall AtlComQIPtrAssign(ptr ptr ptr)
|
||||
32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr)
|
||||
34 stdcall AtlGetVersion(ptr)
|
||||
35 stub AtlAxDialogBoxW
|
||||
36 stub AtlAxDialogBoxA
|
||||
35 stdcall AtlAxDialogBoxW(long wstr long ptr long)
|
||||
36 stdcall AtlAxDialogBoxA(long str long ptr long)
|
||||
37 stdcall AtlAxCreateDialogW(long wstr long ptr long)
|
||||
38 stdcall AtlAxCreateDialogA(long str long ptr long)
|
||||
39 stdcall AtlAxCreateControl(ptr ptr ptr ptr)
|
||||
40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr)
|
||||
41 stdcall AtlAxAttachControl(ptr ptr ptr)
|
||||
42 stdcall AtlAxWinInit()
|
||||
43 stub AtlWinModuleAddCreateWndData
|
||||
44 stub AtlWinModuleExtractCreateWndData
|
||||
43 stdcall AtlWinModuleAddCreateWndData(ptr ptr ptr)
|
||||
44 stdcall AtlWinModuleExtractCreateWndData(ptr)
|
||||
45 stub AtlWinModuleRegisterWndClassInfoW
|
||||
46 stub AtlWinModuleRegisterWndClassInfoA
|
||||
47 stdcall AtlAxGetControl(long ptr)
|
||||
48 stdcall AtlAxGetHost(long ptr)
|
||||
49 stub AtlRegisterClassCategoriesHelper
|
||||
49 stdcall AtlRegisterClassCategoriesHelper(ptr ptr long)
|
||||
50 stdcall AtlIPersistStreamInit_Load(ptr ptr ptr ptr)
|
||||
51 stdcall AtlIPersistStreamInit_Save(ptr long ptr ptr ptr)
|
||||
52 stub AtlIPersistPropertyBag_Load
|
||||
52 stdcall AtlIPersistPropertyBag_Load(ptr ptr ptr ptr ptr)
|
||||
53 stub AtlIPersistPropertyBag_Save
|
||||
54 stub AtlGetObjectSourceInterface
|
||||
56 stub AtlLoadTypeLib
|
||||
58 stub AtlModuleAddTermFunc
|
||||
54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr)
|
||||
56 stdcall AtlLoadTypeLib(long wstr ptr ptr)
|
||||
58 stdcall AtlModuleAddTermFunc(ptr ptr long)
|
||||
59 stub AtlAxCreateControlLic
|
||||
60 stub AtlAxCreateControlLicEx
|
||||
61 stdcall AtlCreateRegistrar(ptr)
|
||||
62 stub AtlWinModuleRegisterClassExW
|
||||
63 stub AtlWinModuleRegisterClassExA
|
||||
64 stub AtlCallTermFunc
|
||||
65 stub AtlWinModuleInit
|
||||
64 stdcall AtlCallTermFunc(ptr)
|
||||
65 stdcall AtlWinModuleInit(ptr)
|
||||
66 stub AtlWinModuleTerm
|
||||
67 stub AtlSetPerUserRegistration
|
||||
68 stub AtlGetPerUserRegistration
|
||||
67 stdcall AtlSetPerUserRegistration(long)
|
||||
68 stdcall AtlGetPerUserRegistration(ptr)
|
||||
|
|
|
@ -90,7 +90,8 @@ static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, L
|
|||
BOOL WINAPI AtlAxWinInit(void)
|
||||
{
|
||||
WNDCLASSEXW wcex;
|
||||
const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n',0};
|
||||
const WCHAR AtlAxWin100[] = {'A','t','l','A','x','W','i','n','1','0','0',0};
|
||||
const WCHAR AtlAxWinLic100[] = {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0};
|
||||
|
||||
FIXME("semi-stub\n");
|
||||
|
||||
|
@ -98,7 +99,7 @@ BOOL WINAPI AtlAxWinInit(void)
|
|||
return FALSE;
|
||||
|
||||
wcex.cbSize = sizeof(wcex);
|
||||
wcex.style = 0;
|
||||
wcex.style = CS_GLOBALCLASS | CS_DBLCLKS;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = GetModuleHandleW( NULL );
|
||||
|
@ -109,7 +110,11 @@ BOOL WINAPI AtlAxWinInit(void)
|
|||
wcex.hIconSm = 0;
|
||||
|
||||
wcex.lpfnWndProc = AtlAxWin_wndproc;
|
||||
wcex.lpszClassName = AtlAxWin;
|
||||
wcex.lpszClassName = AtlAxWin100;
|
||||
if ( !RegisterClassExW( &wcex ) )
|
||||
return FALSE;
|
||||
|
||||
wcex.lpszClassName = AtlAxWinLic100;
|
||||
if ( !RegisterClassExW( &wcex ) )
|
||||
return FALSE;
|
||||
|
||||
|
@ -1354,3 +1359,25 @@ HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk)
|
|||
|
||||
return IOleObject_QueryInterface( This->control, &IID_IUnknown, (void**) pUnk );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlAxDialogBoxW [atl100.35]
|
||||
*
|
||||
*/
|
||||
INT_PTR WINAPI AtlAxDialogBoxW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc,
|
||||
LPARAM dwInitParam)
|
||||
{
|
||||
FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_w(lpTemplateName), hWndParent, lpDialogProc, dwInitParam);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* AtlAxDialogBoxA [atl100.36]
|
||||
*
|
||||
*/
|
||||
INT_PTR WINAPI AtlAxDialogBoxA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc,
|
||||
LPARAM dwInitParam)
|
||||
{
|
||||
FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_a(lpTemplateName), hWndParent, lpDialogProc, dwInitParam);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -712,3 +712,48 @@ HRESULT WINAPI AtlCreateRegistrar(IRegistrar **ret)
|
|||
*ret = ®istrar->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(®istrar);
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ reactos/dll/win32/activeds # Synced to Wine-1.1.43?
|
|||
reactos/dll/win32/actxprxy # Synced to Wine-1.5.26
|
||||
reactos/dll/win32/advpack # Synced to Wine-1.7.1
|
||||
reactos/dll/win32/atl # Synced to Wine-1.5.19
|
||||
reactos/dll/win32/atl100 # Synced to Wine-1.5.19
|
||||
reactos/dll/win32/atl100 # Synced to Wine-1.7.1
|
||||
reactos/dll/win32/avifil32 # Synced to Wine-1.5.26
|
||||
reactos/dll/win32/bcrypt # Synced to Wine-1.5.26
|
||||
reactos/dll/win32/browseui # Out of sync
|
||||
|
|
Loading…
Reference in a new issue