コード例 #1
0
        //FIX ME!!! This is a hack due to Win8:235420

        private void PassThroughLine(CallbackData cbd)
        {
            if (string.IsNullOrEmpty(cbd.Data?.ToString()))
            {
                return;
            }
            if (_reEnter == false)
            {
                _reEnter = true;

                if (cbd.Mask.HasFlag(DEBUG_OUTPUT.ADDR_TRANSLATE) && cbd.Mask.HasFlag(DEBUG_OUTPUT.NORMAL | DEBUG_OUTPUT.ERROR | DEBUG_OUTPUT.WARNING | DEBUG_OUTPUT.VERBOSE) == false)
                {
                    cbd.Mask = cbd.Mask | DEBUG_OUTPUT.NORMAL;
                }
                try
                {
                    if (_installedThreadId == Thread.CurrentThread.ManagedThreadId)
                    {
                        foreach (var bufferLine in _bufferedOutput)
                        {
                            bufferLine.Data.Insert(0, "BUFFERED ");
                            bufferLine.OutputLineMaskDisabled(_passthroughUtilities);
                        }
                        _bufferedOutput.Clear();
                        cbd.OutputLineMaskDisabled(_passthroughUtilities);
                    }
                    else
                    {
                        _bufferedOutput.Add(cbd);
                    }
                }
                catch
                {
                    DebugUtilities.CoUninitialize();
                    if (_installedThreadId == Thread.CurrentThread.ManagedThreadId)
                    {
                        cbd.OutputLineMaskDisabled(_passthroughUtilities);
                    }
                    else
                    {
                        _bufferedOutput.Add(cbd);
                    }
                }

                _reEnter = false;
            }
        }