/// <summary>
        /// Gets a value that indicates whether any managed callbacks are currently queued for
        /// the specified thread.
        /// </summary>
        /// <param name="thread">Specifies the thread to query.</param>
        /// <param name="bQueuedRef">
        /// A value indicating whether any managed callbacks are currently queued for the specified
        /// thread (or for any thread if <see paramref="thread" /> is <see langword="null" />).
        /// </param>
        /// <remarks>
        /// Callbacks will be dispatched one at a time, each time <see cref="Continue(bool)" /> is
        /// called. The debugger can check this flag if it wants to report multiple debugging
        /// events that occur simultaneously.
        ///
        /// When debugging events are queued, they have already occurred, so the debugger must
        /// drain the entire queue to be sure of the state of the debuggee. (Call
        /// <see cref="Continue(bool)" /> to drain the queue.) For example, if the queue contains
        /// two debugging events on thread X, and the debugger suspends thread X after the first
        /// debugging event and then calls <see cref="Continue(bool)" />, the second debugging
        /// event for thread X will be dispatched although the thread has been suspended.
        /// </remarks>
        public int HasQueuedCallbacks(CorDebugThread thread, out bool bQueuedRef)
        {
            using var pThread = thread?.AcquirePointer();
            int pbQueuedRef = default;
            int result      = Calli(_this, This[0]->HasQueuedCallbacks, (void *)pThread, &pbQueuedRef);

            bQueuedRef = pbQueuedRef.FromNativeBool();
            return(result);
        }
 /// <summary>
 /// Sets the debug state of all managed threads in the process.
 /// </summary>
 /// <param name="state">
 /// A value of the that specifies the target state of the thread for debugging.
 /// </param>
 /// <param name="exceptThisThread">
 /// The thread that should be exempted from the debug state setting. If this value
 /// is <see langword="null" />, no thread is exempted.
 /// </param>
 /// <remarks>
 /// This method may affect threads that are not visible via <see cref="EnumerateThreads(out CorDebugEnum{CorDebugThread})" />,
 /// so threads that were suspended with this method will need to be resumed.
 /// </remarks>
 public int SetAllThreadsDebugState(CorDebugThreadState state, CorDebugThread exceptThisThread)
 {
     using var pExceptThisThread = exceptThisThread?.AcquirePointer();
     return(Calli(_this, This[0]->SetAllThreadsDebugState, (int)state, pExceptThisThread));
 }