diff --git a/reactos/dll/win32/ole32/ole2.c b/reactos/dll/win32/ole32/ole2.c index f570167bcf2..a9a488594cc 100644 --- a/reactos/dll/win32/ole32/ole2.c +++ b/reactos/dll/win32/ole32/ole2.c @@ -409,6 +409,7 @@ HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget) HRESULT hr; IStream *stream; HANDLE map; + IUnknown *unk; TRACE("(%p,%p)\n", hwnd, pDropTarget); @@ -449,7 +450,15 @@ HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget) hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); if(FAILED(hr)) return hr; - hr = CoMarshalInterface(stream, &IID_IDropTarget, (IUnknown*)pDropTarget, MSHCTX_LOCAL, NULL, MSHLFLAGS_TABLESTRONG); + hr = IDropTarget_QueryInterface(pDropTarget, &IID_IUnknown, (void**)&unk); + if(FAILED(hr)) + { + IStream_Release(stream); + return hr; + } + hr = CoMarshalInterface(stream, &IID_IDropTarget, unk, MSHCTX_LOCAL, NULL, MSHLFLAGS_TABLESTRONG); + IUnknown_Release(unk); + if(SUCCEEDED(hr)) { hr = create_map_from_stream(stream, &map); diff --git a/reactos/dll/win32/oleaut32/oleaut32.spec b/reactos/dll/win32/oleaut32/oleaut32.spec index 7b764ef96b6..a86486fecac 100644 --- a/reactos/dll/win32/oleaut32/oleaut32.spec +++ b/reactos/dll/win32/oleaut32/oleaut32.spec @@ -410,6 +410,8 @@ 439 stdcall VarUI8FromUI2(long ptr) 440 stdcall VarUI8FromUI4(long ptr) 441 stdcall VarUI8FromDec(long ptr) +442 stdcall RegisterTypeLibForUser(ptr wstr wstr) +443 stdcall UnRegisterTypeLibForUser(ptr long long long long) @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) diff --git a/reactos/dll/win32/oleaut32/typelib.c b/reactos/dll/win32/oleaut32/typelib.c index 7fac0398955..46c0d284be0 100644 --- a/reactos/dll/win32/oleaut32/typelib.c +++ b/reactos/dll/win32/oleaut32/typelib.c @@ -903,6 +903,49 @@ end: return result; } +/****************************************************************************** + * RegisterTypeLibForUser [OLEAUT32.442] + * Adds information about a type library to the user registry + * NOTES + * Docs: ITypeLib FAR * ptlib + * Docs: OLECHAR FAR* szFullPath + * Docs: OLECHAR FAR* szHelpDir + * + * RETURNS + * Success: S_OK + * Failure: Status + */ +HRESULT WINAPI RegisterTypeLibForUser( + ITypeLib * ptlib, /* [in] Pointer to the library*/ + OLECHAR * szFullPath, /* [in] full Path of the library*/ + OLECHAR * szHelpDir) /* [in] dir to the helpfile for the library, + may be NULL*/ +{ + FIXME("(%p, %s, %s) registering the typelib system-wide\n", ptlib, + debugstr_w(szFullPath), debugstr_w(szHelpDir)); + return RegisterTypeLib(ptlib, szFullPath, szHelpDir); +} + +/****************************************************************************** + * UnRegisterTypeLibForUser [OLEAUT32.443] + * Removes information about a type library from the user registry + * + * RETURNS + * Success: S_OK + * Failure: Status + */ +HRESULT WINAPI UnRegisterTypeLibForUser( + REFGUID libid, /* [in] GUID of the library */ + WORD wVerMajor, /* [in] major version */ + WORD wVerMinor, /* [in] minor version */ + LCID lcid, /* [in] locale id */ + SYSKIND syskind) +{ + FIXME("(%s, %u, %u, %u, %u) unregistering the typelib system-wide\n", + debugstr_guid(libid), wVerMajor, wVerMinor, lcid, syskind); + return UnRegisterTypeLib(libid, wVerMajor, wVerMinor, lcid, syskind); +} + /*======================= ITypeLib implementation =======================*/ typedef struct tagTLBCustData @@ -6017,13 +6060,13 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( unsigned int var_index; TYPEKIND type_kind; HRESULT hres; - const TLBFuncDesc *pFuncInfo = This->funclist; + const TLBFuncDesc *pFuncInfo; TRACE("(%p)(%p,id=%d,flags=0x%08x,%p,%p,%p,%p)\n", This,pIUnk,memid,wFlags,pDispParams,pVarResult,pExcepInfo,pArgErr ); - if( pFuncInfo->funcdesc.wFuncFlags == FUNCFLAG_FRESTRICTED ) + if( This->TypeAttr.wTypeFlags & TYPEFLAG_FRESTRICTED ) return DISP_E_MEMBERNOTFOUND; if (!pDispParams) @@ -6045,7 +6088,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( * FUNCDESC for dispinterfaces and we want the real function description */ for (pFuncInfo = This->funclist; pFuncInfo; pFuncInfo=pFuncInfo->next) if ((memid == pFuncInfo->funcdesc.memid) && - (wFlags & pFuncInfo->funcdesc.invkind)) + (wFlags & pFuncInfo->funcdesc.invkind) && + (pFuncInfo->funcdesc.wFuncFlags & FUNCFLAG_FRESTRICTED) == 0) break; if (pFuncInfo) { diff --git a/reactos/dll/win32/oleaut32/typelib2.c b/reactos/dll/win32/oleaut32/typelib2.c index 1096ea8ada6..92d4ab036d6 100644 --- a/reactos/dll/win32/oleaut32/typelib2.c +++ b/reactos/dll/win32/oleaut32/typelib2.c @@ -317,7 +317,7 @@ static int ctl2_find_guid( while (offset != -1) { guidentry = (MSFT_GuidEntry *)&This->typelib_segment_data[MSFT_SEG_GUID][offset]; - if (!memcmp(guidentry, guid, sizeof(GUID))) return offset; + if (IsEqualGUID(guidentry, guid)) return offset; offset = guidentry->next_hash; } @@ -1695,7 +1695,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnAddRefTypeInfo( impinfo.oGuid = guid_offset; *phRefType = ctl2_alloc_importinfo(This->typelib, &impinfo)+1; - if(!memcmp(&guid.guid, &IID_IDispatch, sizeof(GUID))) + if(IsEqualGUID(&guid.guid, &IID_IDispatch)) This->typelib->typelib_header.dispatchpos = *phRefType; } @@ -2469,7 +2469,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnLayOut( return hres; } - if(!memcmp(&typeattr->guid, &IID_IDispatch, sizeof(IDispatch))) + if(IsEqualGUID(&typeattr->guid, &IID_IDispatch)) This->typeinfo->flags |= TYPEFLAG_FDISPATCHABLE; This->typeinfo->datatype2 += (typeattr->cFuncs<<16) + 1;