shlwapi: implement IConnectionPoint_SimpleInvoke

Andrey Turkin andrey.turkin at gmail.com
Mon Apr 23 15:13:18 CDT 2007


-------------- next part --------------
--- wine-0.9.35-orig/dlls/shlwapi/ordinal.c	2007-04-13 19:47:52.000000000 +0400
+++ wine-0.9.35/dlls/shlwapi/ordinal.c	2007-04-23 17:42:30.000000000 +0400
@@ -2856,17 +2856,60 @@ HRESULT WINAPI SHPackDispParams(LPVOID w
 }
 
 /*************************************************************************
+ *      IConnectionPoint_SimpleInvokeByIID
+ *
+ * Call IDispatch::Invoke for each sink which implements iid or IDispatch.
+ *
+ */
+HRESULT IConnectionPoint_SimpleInvokeByIID(
+        IConnectionPoint* iCP,
+        REFIID iid,
+        DISPID dispId,
+        DISPPARAMS* dispParams)
+{
+  IEnumConnections *enumerator;
+  CONNECTDATA rgcd;
+
+  HRESULT result = IConnectionPoint_EnumConnections(iCP, &enumerator);
+  if (FAILED(result))
+    return result;
+
+  while(IEnumConnections_Next(enumerator, 1, &rgcd, NULL)==S_OK)
+  {
+    IDispatch *dispIface;
+    if (SUCCEEDED(IUnknown_QueryInterface(rgcd.pUnk, iid, (LPVOID*)&dispIface)) ||
+        SUCCEEDED(IUnknown_QueryInterface(rgcd.pUnk, &IID_IDispatch, (LPVOID*)&dispIface)))
+    {
+      IDispatch_Invoke(dispIface, dispId, &IID_NULL, 0, DISPATCH_METHOD, dispParams, NULL, NULL, NULL);
+      IDispatch_Release(dispIface);
+    }
+  }
+
+  IEnumConnections_Release(enumerator);
+
+  return S_OK;
+}
+
+/*************************************************************************
  *      @	[SHLWAPI.284]
  *
- * _IConnectionPoint_SimpleInvoke
+ *  IConnectionPoint_SimpleInvoke
  */
-DWORD WINAPI IConnectionPoint_SimpleInvoke(
-	LPVOID x,
-	LPVOID y,
-	LPVOID z)
+HRESULT WINAPI IConnectionPoint_SimpleInvoke(
+        IConnectionPoint* iCP,
+        DISPID dispId,
+        DISPPARAMS* dispParams)
 {
-        FIXME("(%p %p %p) stub\n",x,y,z);
-	return 0;
+  IID iid;
+  HRESULT result;
+
+  TRACE("(%p)->(0x%x %p)\n",iCP,dispId,dispParams);
+
+  result = IConnectionPoint_GetConnectionInterface(iCP, &iid);
+  if (SUCCEEDED(result))
+    result = IConnectionPoint_SimpleInvokeByIID(iCP, &iid, dispId, dispParams);
+
+  return result;
 }
 
 /*************************************************************************
--- wine-0.9.35-orig/dlls/shlwapi/shlwapi.spec	2007-04-13 19:47:52.000000000 +0400
+++ wine-0.9.35/dlls/shlwapi/shlwapi.spec	2007-04-23 17:43:28.000000000 +0400
@@ -281,7 +281,7 @@
 281 stdcall -noname SHPackDispParamsV(ptr ptr ptr ptr)
 282 stdcall -noname SHPackDispParams(ptr ptr ptr ptr)
 283 stub -noname IConnectionPoint_InvokeWithCancel
-284 stdcall -noname IConnectionPoint_SimpleInvoke(ptr ptr ptr)
+284 stdcall -noname IConnectionPoint_SimpleInvoke(ptr long ptr)
 285 stdcall -noname IConnectionPoint_OnChanged(ptr long)
 286 stub -noname IUnknown_CPContainerInvokeParam
 287 stdcall -noname IUnknown_CPContainerOnChanged(ptr long)


More information about the wine-patches mailing list