DXGKDDI_COLLECTDBGINFO2 callback function (d3dkmddi.h)

The DxgkDdiCollectDbgInfo2 function outputs driver information for a debug report.

Syntax

DXGKDDI_COLLECTDBGINFO2 DxgkddiCollectdbginfo2;

NTSTATUS DxgkddiCollectdbginfo2(
  IN_CONST_HANDLE hAdapter,
  INOUT_PDXGKARG_COLLECTDBGINFO2 pCollectDbgInfo2
)
{...}

Parameters

hAdapter

[in] A handle to a context block that is associated with a display adapter. The display miniport (KMD) previously provided this handle to Dxgkrnl in the MiniportDeviceContext output parameter of DxgkDdiAddDevice.

pCollectDbgInfo2

[in/out] A pointer to a DXGKARG_COLLECTDBGINFO2 structure that contains information for the debug report.

Return value

DxgkDdiCollectDbgInfo2 returns one of the following values:

Return code Description
STATUS_SUCCESS DxgkDdiCollectDbgInfo2 successfully output driver information for a debug report; OR, the OS ignored the content in the buffer that pBuffer points to and didn't add information from DxgkDdiCollectDbgInfo2 to the debug report.
STATUS_NO_MEMORY DxgkDdiCollectDbgInfo2 couldn't allocate memory that was required for it to complete.
STATUS_UNSUCCESSFUL Another error prevented the driver from collecting valid debug information.

Remarks

Dxgkrnl calls KMD's DxgkDdiCollectDbgInfo2 function whenever the OS is about to generate a driver-related debug report. DxgkDdiCollectDbgInfo2 might be called either immediately before Timeout Detection and Recovery (TDR) work or immediately before the OS bug checks. While DxgkDdiCollectDbgInfo2 should return as quickly as possible, there is no system-defined maximum amount of time that the driver can spend in this function.

DxgkDdiCollectDbgInfo2 receives more detailed information about the root cause of the TDR than DxgkDdiCollectDbgInfo does. KMD can save state that is relevant to the part of the GPU responsible for the TDR.

  • A WDDM 3.2 driver isn't required to implement DxgkddiCollectDbgInfo2, in which case the OS calls DxgkddiCollectDbgInfo.

KMD should collect debug information. When DxgkDdiCollectDbgInfo2 is called, the driver receives a bug-check code in pCollectDbgInfo2->Reason that indicates the type of information required for the debug report. The driver copies the required debug information into the buffer that pCollectDbgInfo2->pBuffer points to. The maximum number of bytes of information that the driver can copy is specified by pCollectDbgInfo2->BufferSize.

DxgkDdiCollectDbgInfo generally runs at an undefined IRQL. However, if pCollectDbgInfo2->Reason is set to VIDEO_TDR_TIMEOUT_DETECTED (to indicate an adapter-wide reset) or VIDEO_ENGINE_TIMEOUT_DETECTED (available starting with Windows 8 to indicate a reset of one or more nodes within a physical adapter), the driver must ensure that DxgkDdiCollectDbgInfo2 is pageable, runs at IRQL = PASSIVE_LEVEL, and supports synchronization zero level.

For more information, see TDR debuggability improvements.

Requirements

Requirement Value
Minimum supported client Windows 11, version 24H2 (WDDM 3.2)
Header d3dkmddi.h
IRQL PASSIVE_LEVEL (See Remarks)

See also

DXGKARG_COLLECTDBGINFO2

DxgkDdiCollectDbgInfo