<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>Rob Shearman <robertshearman <at> gmail.com> writes:<br><br>Hi Rob, i think i got the test ready now, i'll send it when the defenitions are<br>in place in ctxtcall.idl. Now still strugling how to fix the bug.<br><br> I fixed up the patch below, also by looking how things are done in similar<br>places in wine-code. With patch applied I can see that<br>ContextCallback_ContextCallback and ContextCallback_Release are called from the<br>application (tested with NASA WorldWind), and the simple stubs are enough to let<br>the app
continue fine. But i'm not sure if everything is 100% ok. Is this what<br>you more or less meant in your first comment?<br><br>diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c<br>index 37907ec..a1f41fd 100644<br>--- a/dlls/ole32/compobj.c<br>+++ b/dlls/ole32/compobj.c<br>@@ -55,6 +55,7 @@<br> #include "objbase.h"<br> #include "ole2.h"<br> #include "ole2ver.h"<br>+#include "ctxtcall.h"<br> <br> #include "compobj_private.h"<br> <br>@@ -3615,25 +3616,39 @@ HRESULT WINAPI CoRegisterChannelHook(REFGUID guidExtension, IChannelHook *pChann<br> typedef struct Context<br> {<br> const IComThreadingInfoVtbl *lpVtbl;<br>+ const IContextCallback *lpVtblIContextCallback;<br> LONG refs;<br> APTTYPE apttype;<br> } Context;<br> <br>+static inline Context *impl_from_Context(IComThreadingInfo
*iface)<br>+{<br>+ return (Context *)((char*)iface - FIELD_OFFSET(Context, lpVtbl));<br>+}<br>+<br> static HRESULT WINAPI Context_QueryInterface(IComThreadingInfo *iface, REFIID riid, LPVOID *ppv)<br> {<br>+ Context* This=impl_from_Context((IComThreadingInfo*) iface);<br> *ppv = NULL;<br> <br> if (IsEqualIID(riid, &IID_IComThreadingInfo) ||<br> IsEqualIID(riid, &IID_IUnknown))<br> {<br> *ppv = iface;<br>- IUnknown_AddRef(iface);<br>- return S_OK;<br> }<br>+ else if(IsEqualIID(riid, &IID_IContextCallback))<br>+ {<br>+
*ppv = &This->lpVtblIContextCallback;<br>+ }<br>+ else<br>+ {<br>+ FIXME("interface not implemented %s\n", debugstr_guid(riid));<br>+ return E_NOINTERFACE;<br>+ }<br> <br>- FIXME("interface not implemented %s\n", debugstr_guid(riid));<br>- return E_NOINTERFACE;<br>-}<br>+ IUnknown_AddRef(iface);<br>+ return S_OK;<br>+} <br> <br> static ULONG WINAPI Context_AddRef(IComThreadingInfo *iface)<br> {<br>@@ -3691,6 +3706,31 @@ static HRESULT WINAPI Context_SetCurrentLogicalThreadId(IComThreadingInfo *iface<br> return E_NOTIMPL;<br> }<br> <br>+<br>+static HRESULT WINAPI
ContextCallback_QueryInterface(IContextCallback *iface, REFIID riid, LPVOID *ppv)<br>+{<br>+ FIXME("\n");<br>+ return E_NOTIMPL;<br>+}<br>+<br>+static ULONG WINAPI ContextCallback_AddRef(IContextCallback *iface)<br>+{<br>+ FIXME("\n");<br>+ return E_NOTIMPL;<br>+}<br>+<br>+static ULONG WINAPI ContextCallback_Release(IContextCallback *iface)<br>+{<br>+ FIXME("\n");<br>+ return E_NOTIMPL;<br>+}<br>+<br>+static HRESULT WINAPI ContextCallback_ContextCallback(IContextCallback *iface, PFNCONTEXTCALL pfnCallback, ComCallData* pParam, REFIID riid, int iMethod, IUnknown* pUnk)<br>+{<br>+ FIXME("not implemented yet\n");<br>+ return E_NOTIMPL;<br>+}<br>+<br> static const IComThreadingInfoVtbl Context_Threading_Vtbl =<br> {<br> Context_QueryInterface,<br>@@ -3702,6 +3742,14 @@ static
const IComThreadingInfoVtbl Context_Threading_Vtbl =<br> Context_SetCurrentLogicalThreadId<br> };<br> <br>+static const IContextCallbackVtbl Context_Callback_Vtbl =<br>+{<br>+ ContextCallback_QueryInterface,<br>+ ContextCallback_AddRef,<br>+ ContextCallback_Release,<br>+ ContextCallback_ContextCallback<br>+};<br>+<br> /***********************************************************************<br> * CoGetObjectContext [OLE32.@]<br> *<br>@@ -3735,6 +3783,7 @@ HRESULT WINAPI CoGetObjectContext(REFIID riid, void **ppv)<br> return E_OUTOFMEMORY;<br> <br> context->lpVtbl = &Context_Threading_Vtbl;<br>+
context->lpVtblIContextCallback=(IContextCallback*)&Context_Callback_Vtbl;<br> context->refs = 1;<br> if (apt->multi_threaded)<br> context->apttype = APTTYPE_MTA;</div></div><br>
</div></div></div><br>
</body></html>