// video.h
typedef struct _VIDEO_PORT_DEBUG_REPORT_INTERFACE
{
IN USHORT Size;
IN USHORT Version;
OUT PVOID Context;
OUT PINTERFACE_REFERENCE InterfaceReference;
OUT PINTERFACE_DEREFERENCE InterfaceDereference;
OUT
PVIDEO_DEBUG_REPORT
(*DbgReportCreate)(
IN PVOID HwDeviceExtension,
IN ULONG ulCode,
IN ULONG_PTR ulpArg1,
IN ULONG_PTR ulpArg2,
IN ULONG_PTR ulpArg3,
IN ULONG_PTR ulpArg4
);
OUT
BOOLEAN
(*DbgReportSecondaryData)(
IN OUT PVIDEO_DEBUG_REPORT pReport,
IN PVOID pvData,
IN ULONG ulDataSize
);
OUT
VOID
(*DbgReportComplete)(
IN OUT PVIDEO_DEBUG_REPORT pReport
);
} VIDEO_PORT_DEBUG_REPORT_INTERFACE, *PVIDEO_PORT_DEBUG_REPORT_INTERFACE;
View the official Windows Driver Kit DDI referenceNo description available.
The VIDEO_PORT_DEBUG_REPORT_INTERFACE structure holds pointers to the Debug Report functions, which are implemented by the video port driver.
SizeSpecifies the size, in bytes, of this structure.
VersionSpecifies the version of the interface returned by the video port driver. Currently, the only supported version is VIDEO_PORT_DEBUG_REPORT_INTERFACE_VERSION_1.
ContextPointer to a context that is provided by the video port driver.
InterfaceReferencePointer to an interface reference function that is implemented by the video port driver.
InterfaceDereferencePointer to an interface dereference function that is implemented by the video port driver.
typedef struct _VIDEO_PORT_DEBUG_REPORT_INTERFACE
{
IN USHORT Size;
IN USHORT Version;
OUT PVOID Context;
OUT PINTERFACE_REFERENCE InterfaceReference;
OUT PINTERFACE_DEREFERENCE InterfaceDereference;
OUT
PVIDEO_DEBUG_REPORT
(*DbgReportCreate)(
IN PVOID HwDeviceExtension,
IN ULONG ulCode,
IN ULONG_PTR ulpArg1,
IN ULONG_PTR ulpArg2,
IN ULONG_PTR ulpArg3,
IN ULONG_PTR ulpArg4
);
OUT
BOOLEAN
(*DbgReportSecondaryData)(
IN OUT PVIDEO_DEBUG_REPORT pReport,
IN PVOID pvData,
IN ULONG ulDataSize
);
OUT
VOID
(*DbgReportComplete)(
IN OUT PVIDEO_DEBUG_REPORT pReport
);
} VIDEO_PORT_DEBUG_REPORT_INTERFACE, *PVIDEO_PORT_DEBUG_REPORT_INTERFACE;
The video miniport driver supplies the Size and Version members of this structure, and then calls VideoPortQueryServices, which initializes its remaining members.
If your video miniport driver detects a failure and then recovers from it, you can create an error report that can later be used for debugging by calling the callback function members of VIDEO_PORT_DEBUG_REPORT_INTERFACE as follows:
The error report is saved in a file and scheduled to be sent to Microsoft when the computer is rebooted. The error report contains an error code and four arguments. The error code and the first three arguments are provided by the caller of DbgReportCreate. The fourth argument in the report is provided by the operating system and indicates the number of reports generated since the computer was started. For example, if the value of ulpArg4 is 5, this means that four previous error reports were generated by the display miniport driver since the computer was last started. Only the fifth report is saved because each report overwrites the previous one.
The VIDEO_DEBUG_REPORT structure returned by DbgReportCreate and subsequently passed to DbgReportSecondaryData and DbgReportComplete is opaque. Do not attempt to access its members directly.
The following sections describe these callback functions in detail. These callbacks must be called at IRQL = PASSIVE_LEVEL.
DbgReportCreate creates an initial error report. It creates an entry in the system event log and displays a dialog box that informs the user of the failure and presents the opportunity to upload an error report to Microsoft. DbgReportCreate returns a pointer to an opaque VIDEO_DEBUG_REPORT structure that represents a handle to the newly created debug report.
The DbgReportSecondaryData function appends data to an initial error report that was previously created by DbgReportCreate. If DbgReportSecondaryData succeeds, it returns TRUE. Otherwise, it returns FALSE.
Call DbgReportSecondaryData to add data to an initial report that was created by a previous call to DbgReportCreate. You can call DbgReportSecondaryData several times, but with each call, the data written to the report overwrites the data written by the previous call. The following steps give a good strategy for incrementally adding data to the report.
When you have finished adding data to the report, close the report by calling DbgReportComplete. If the computer stops responding before you call DbgReportComplete, the data added to the report by the most recent successful call to DbgReportSecondaryData is saved and then sent to Microsoft when the computer is rebooted.
The DbgReportComplete function closes an error report and frees any resources associated with the report.
DbgReportComplete creates an entry in the system event log and displays a dialog box that informs the user of the failure and the opportunity to upload an error report to Microsoft.