failedQI MDA

Note

This article is specific to .NET Framework. It doesn't apply to newer implementations of .NET, including .NET 6 and later versions.

The failedQI managed debugging assistant (MDA) is activated when the runtime calls QueryInterface on a COM interface pointer on behalf of a runtime callable wrapper (RCW), and the QueryInterface call fails.

Symptoms

A cast on an RCW fails, or a call to COM from an RCW fails unexpectedly.

Cause

  • The call is made from the wrong context.

  • The registered proxy is failing the QueryInterface call because the call was attempted in the wrong context.

  • An OLE-owned proxy returned a failure HRESULT.

Resolution

See the MSDN documentation on COM rules.

Effect on the Runtime

If a QueryInterface call fails, the context is switched and the QueryInterface call is attempted again to see if an incorrect context was at fault.

Output

The managed name of the interface, the GUID of the interface, and the HRESULT of the failure.

Configuration

<mdaConfig>
  <assistants>
    <failedQI/>
  </assistants>
</mdaConfig>

See also