/// <summary> /// Creates a new SimpleOutputHandler instances and sets it as the active handler for the debugger. /// </summary> /// <param name="debugUtilities">A DebugUtilities associated with the debugger.</param> /// <param name="outputCallbacks"> /// An out parameter to receive the new SimpleOutputHandler. CALL Revert AND/OR Dipose TO /// REMOVE! /// </param> /// <param name="filter">An optional filter object to process the output data.</param> /// <param name="wantsDml">Whether DML should be accepted.</param> /// <param name="passThrough"> /// Whether the output data should be passed to the previously installed output handler. Default /// is to cache locally only. /// </param> /// <param name="passThroughOnly"> /// Disables local caching of output data. Save memory and is more effient when the primary /// goes it to pass the output data to the previously installed output handled (normally WinDbg). /// </param> /// <returns>Last HRESULT of the install process.</returns> public static int Install(DebugUtilities debugUtilities, out SimpleOutputHandler2 outputCallbacks, OUTPUT_FILTER filter = null, bool wantsDml = true, bool passThrough = false, bool passThroughOnly = false) { var oc = new SimpleOutputHandler2(debugUtilities, debugUtilities, filter, wantsDml, passThrough, passThroughOnly); outputCallbacks = SUCCEEDED(oc.InstallationHRESULT) ? oc : null; return(oc.InstallationHRESULT); }
/// <summary> /// Creates a new SimpleOutputHandler instances and sets it as the active handler for the debugger. /// </summary> /// <param name="debugUtilities">A DebugUtilities associated with the debugger.</param> /// <param name="executionUtilities"> /// An utilities associated with the output handler. This interface should be used for all /// actions where output should be redirected to the output handler. /// </param> /// <param name="outputCallbacks"> /// An out parameter to receive the new SimpleOutputHandler. CALL Revert AND/OR Dipose TO /// REMOVE! /// </param> /// <param name="filter">An optional filter object to process the output data.</param> /// <param name="wantsDml">Whether DML should be accepted.</param> /// <param name="passThrough"> /// Whether the output data should be passed to the previously installed output handler. Default /// is to cache locally only. /// </param> /// <param name="passThroughOnly"> /// Disables local caching of output data. Save memory and is more effient when the primary /// goes it to pass the output data to the previously installed output handled (normally WinDbg). /// </param> /// <returns>Last HRESULT of the install process.</returns> public static int Install(DebugUtilities debugUtilities, out DebugUtilities executionUtilities, out SimpleOutputHandler2 outputCallbacks, OUTPUT_FILTER filter = null, bool wantsDml = true, bool passThrough = false, bool passThroughOnly = false) { IDebugClient executionClient; executionUtilities = new DebugUtilities(out executionClient); if (executionClient == null) { debugUtilities.OutputVerboseLine("SimpleOutputHandler.Install Failed creating a new debug client for execution"); outputCallbacks = null; executionUtilities = null; return(E_FAIL); } executionUtilities.IsFiltered = true; debugUtilities.IsFiltered = true; var oc = new SimpleOutputHandler2(executionUtilities, debugUtilities, filter, wantsDml, passThrough, passThroughOnly); outputCallbacks = SUCCEEDED(oc.InstallationHRESULT) ? oc : null; return(oc.InstallationHRESULT); }