private SimpleEventHandler(DebugUtilities debugUtilities)
 {
     _installed         = false;
     _utilities         = debugUtilities;
     SessionIsActive    = false;
     ExecutionStatus    = 0;
     _previousCallbacks = IntPtr.Zero;
     _breakpointHandler = null;
 }
            public static int Install(DebugUtilities debugUtilities, out SimpleEventHandler eventCallbacks, BREAKPOINT_HANDLER breakpointHandler = null)
            {
                var ec = new SimpleEventHandler(debugUtilities);

                if (breakpointHandler != null)
                {
                    ec._breakpointHandler = breakpointHandler;
                }
                IDebugEventCallbacks idec = ec;
                IntPtr unknownPtr         = Marshal.GetIUnknownForObject(idec);
                IntPtr idecPtr;
                Guid   guid = typeof(IDebugEventCallbacks).GUID;
                int    hr   = Marshal.QueryInterface(unknownPtr, ref guid, out idecPtr);

                if (FAILED(hr))
                {
                    ec.Dispose();
                    eventCallbacks = null;
                    return(hr);
                }

                debugUtilities.DebugClient.GetEventCallbacks(out ec._previousCallbacks); /* We will need to release this */
                hr = debugUtilities.DebugClient.SetEventCallbacks(idecPtr);
                if (FAILED(hr))
                {
                    ec.Dispose();
                    eventCallbacks = null;
                    return(hr);
                }

                ec._installed  = true;
                eventCallbacks = ec;
                return(hr);
            }
 public void RemoveBreakpointHandler()
 {
     _breakpointHandler = null;
 }
 public void SetBreakpointHandler(BREAKPOINT_HANDLER handler)
 {
     _breakpointHandler = handler;
 }