/// <summary> /// Send an event to SDM. /// </summary> /// <param name="server"> Server. Using NULL. </param> /// <param name="port"> The IDebugPort2 port. </param> /// <param name="process"> The IDebugProcess2 process. </param> /// <param name="program"> The IDebugProgram2 program. Using NULL. </param> /// <param name="ev"> The event. It can be: AD7ProcessDestroyEvent or AD7ProcessCreateEvent. </param> /// <param name="iid"> The event GUID. </param> private void SendEvent(IDebugCoreServer2 server, IDebugPort2 port, IDebugProcess2 process, IDebugProgram2 program, IDebugEvent2 ev, Guid iid) { foreach (var eventSink in m_eventSinks) { IDebugPortEvents2 events = eventSink as IDebugPortEvents2; if (events != null) { events.Event(server, port, process, program, ev, ref iid); } } }
// Token: 0x06000207 RID: 519 RVA: 0x000070EC File Offset: 0x000052EC public void Advise(object pUnkSink, out int pdwCookie) { IDebugPortEvents2 debugPortEvents = pUnkSink as IDebugPortEvents2; if (debugPortEvents != null) { this.sinks.Add(debugPortEvents); pdwCookie = this.sinks.Count; return; } throw new ArgumentException(); }
void IConnectionPoint.Advise(object sinkInterface, out uint cookie) { IDebugPortEvents2 eventCallback = sinkInterface as IDebugPortEvents2; if (eventCallback == null) { throw new ArgumentOutOfRangeException("sinkIterface"); } lock (_lock) { _lastCallbackCookie++; if (_lastCallbackCookie == 0) { _lastCallbackCookie++; } _eventCallbacks.Add(_lastCallbackCookie, eventCallback); cookie = _lastCallbackCookie; } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void Advise(object pUnkSink, out int pdwCookie) { // // Establishes an advisory connection between the connection point and the caller's sink object. // LoggingUtils.PrintFunction(); try { IDebugPortEvents2 portEvent = (IDebugPortEvents2)pUnkSink; m_eventConnectionPoints.Add(m_eventConnectionPointCookie, portEvent); pdwCookie = m_eventConnectionPointCookie++; } catch (Exception e) { LoggingUtils.HandleException(e); pdwCookie = 0; } }
public void Advise(object pUnkSink, out uint pdwCookie) { portEvents = (IDebugPortEvents2)pUnkSink; pdwCookie = 0; }