private SimpleOutputHandler2(DebugUtilities executionUtilities, DebugUtilities passthroughUtilities, OUTPUT_FILTER outputFilter, bool wantsDml, bool passThrough, bool passThroughOnly)
        {
            ExecutionUtilities   = executionUtilities;
            PassthroughUtilities = passthroughUtilities;
            Installed            = false;
            PreviousCallbacks    = IntPtr.Zero;
            if (passThroughOnly == false)
            {
                DataBuffer = new DbgStringBuilder(executionUtilities, 1024);
            }
            passthroughUtilities.OutputMaskSave();
            passthroughUtilities.OutputMaskDisableAll();
            //LineBuffer = new DbgStringBuilder(executionUtilities, 1024);
            OutputFilter    = outputFilter;
            PassThrough     = passThrough;
            PassThroughOnly = passThroughOnly;
            InterestMask    = wantsDml ? DEBUG_OUTCBI.DML : DEBUG_OUTCBI.TEXT;

            executionUtilities.DebugClient.GetOutputCallbacks(out PreviousCallbacks); /* We will need to release this */

            ThisIDebugOutputCallbacksPtr = Marshal.GetComInterfaceForObject(this, typeof(IDebugOutputCallbacks2));
            InstallationHRESULT          = executionUtilities.DebugClient.SetOutputCallbacks(ThisIDebugOutputCallbacksPtr);
            if (SUCCEEDED(InstallationHRESULT))
            {
                Installed         = true;
                InstalledThreadId = Thread.CurrentThread.ManagedThreadId;
                BufferedOutput    = new List <BufferLine>(1024);
            }
            else
            {
                Dispose();
            }
        }
        private AdvancedOutputHandler(DebugUtilities executionUtilities, DebugUtilities passthroughUtilities, OUTPUT_FILTER outputFilter, bool wantsDml)
        {
            if (_installed == true)
            {
                Revert();
                throw new Exception("Can not install an Output Handler more than once.");
            }

            _executionUtilities   = executionUtilities;
            _passthroughUtilities = passthroughUtilities;
            _previousCallbacks    = IntPtr.Zero;

            passthroughUtilities.OutputMaskSave();
            passthroughUtilities.OutputMaskDisableAll();
            passthroughUtilities.DebugClient.FlushCallbacks();
            executionUtilities.DebugClient.FlushCallbacks();
            _outputFilter = outputFilter;

            _interestMask = wantsDml ? DEBUG_OUTCBI.DML : DEBUG_OUTCBI.TEXT;

            executionUtilities.DebugClient.GetOutputCallbacks(out _previousCallbacks); /* We will need to release this */

            _thisIDebugOutputCallbacksPtr = Marshal.GetComInterfaceForObject(this, typeof(IDebugOutputCallbacks2));
            _installationHresult          = executionUtilities.DebugClient.SetOutputCallbacks(_thisIDebugOutputCallbacksPtr);
            if (SUCCEEDED(_installationHresult))
            {
                _installed         = true;
                _installedThreadId = Thread.CurrentThread.ManagedThreadId;
                _bufferedOutput    = new List <CallbackData>(128);
            }
            else
            {
                Dispose();
            }
        }
Example #3
0
 int IDebugOutputCallbacks2.GetInterestMask(out DEBUG_OUTCBI Mask)
 {
     return(GetInterestMask(out Mask));
 }
Example #4
0
 /// <summary>
 /// Implements IDebugOutputCallbacks2::GetInterestMask
 /// </summary>
 public int GetInterestMask(out DEBUG_OUTCBI Mask)
 {
     Mask = InterestMask;
     return(S_OK);
 }
Example #5
0
 public int GetInterestMask(out DEBUG_OUTCBI Mask)
 {
     Mask = DEBUG_OUTCBI.ANY_FORMAT;
     return(HResult.Ok);
 }
Example #6
0
 public int GetInterestMask(out DEBUG_OUTCBI Mask)
 {
     Mask = DEBUG_OUTCBI.TEXT;
     return(0);
 }
Example #7
0
 int IDebugOutputCallbacks2.GetInterestMask(out DEBUG_OUTCBI Mask)
 {
     return GetInterestMask(out Mask);
 }
Example #8
0
 /// <summary>
 /// Implements IDebugOutputCallbacks2::GetInterestMask
 /// </summary>
 public int GetInterestMask(out DEBUG_OUTCBI Mask)
 {
     Mask = InterestMask;
     return S_OK;
 }