The ExtKnownStructMethod callback method is called by the engine to format an instance of a structure for output on a single line.
typedef void ExtKnownStructMethod( [in] PCSTR TypeName, [in] ULONG Flags, [in] ULONG64 Offset );
- TypeName [in]
Specifies the name of the type of the structure pointed to by Offset. This is the same as the TypeName field of the ExtKnownStruct structure used to register this callback method.
- Flags [in]
Specifies bit flags that indicate how the output should be formatted. Currently, this is set to DEBUG_KNOWN_STRUCT_GET_SINGLE_LINE_OUTPUT, which indicates that the output should be formatted for output on a single line.
- Offset [in]
Specifies the location in the target's memory of the instance of the structure to be formatted for output.
The debugger engine expects the output to be formatted for printing on a single line, hence it does not expect the formatted structure to have any line breaks.
The formatted output from this method should be placed in the buffer m_AppendBuffer -- a member of ExtExtension.
Instances of this callback method are registered with the engine by using an instance of the ExtKnownStruct structure that is placed into the array m_KnownStructs (a member of ExtExtension) by the Initialize method. The ExtKnownStruct structure also specifies the name of the type of structure this method formats.
When the debugger engine calls a known structure method, it wraps the call in a try / except block. This protects the engine from some types of bugs in the extension code; but, because the extension calls are executed in the same thread as the engine, they can still cause it to crash.