WINDEBUGINFO

3.1

typedef struct tagWINDEBUGINFO {
    UINT    flags;
    DWORD   dwOptions;
    DWORD   dwFilter;
    char    achAllocModule[8];
    DWORD   dwAllocBreak;
    DWORD   dwAllocCount;
} WINDEBUGINFO;

The WINDEBUGINFO structure contains current system-debugging information for the debugging version of Windows 3.1.

Members

flags

Specifies which members of the WINDEBUGINFO structure are valid. This member can be one or more of the following values:

Value Meaning

WDI_OPTIONS dwOptions member is valid.
WDI_FILTER dwFilter member is valid.
WDI_ALLOCBREAK achAllocModule, dwAllocBreak, and dwAllocCount members are valid.

dwOptions

Specifies debugging options. This member is valid only if WDI_OPTIONS is specified in the flags member. It can be one or more of the following values:

Constant Value Meaning

DBO_CHECKHEAP 0x0001 Performs local heap checking after all calls to functions that manipulate local memory.
DBO_BUFFERFILL 0x0004 Fills buffers passed to API functions with 0xF9. This ensures that the supplied buffer is completely writable and helps detect overwrite problems when the supplied buffer size is not large enough.
DBO_DISABLEGPTRAPPING 0x0010 Disables hooking of the fault interrupt vectors. This option is not typically used by application developers, because parameter validation can cause many spurious traps that are not errors.
DBO_CHECKFREE 0x0020 Fills all freed local memory with 0xFB. All newly allocated memory is checked to ensure that it is still filled with 0xFB—this ensures that no application has written into a freed memory object. This option has no effect if DBO_CHECKHEAP is not specified.
DBO_INT3BREAK 0x0100 Breaks to the debugger with simple INT 3 rather than a call to the FatalExit function. This option does not generate a stack backtrace.
DBO_NOFATALBREAK 0x0400 Does not break with the “abort, break, ignore” prompt if a DBF_FATAL message occurs.
DBO_NOERRORBREAK 0x0800 Does not break with the “abort, break, ignore” prompt if a DBF_ERROR message occurs. This option also applies to invalid parameter errors.
DBO_WARNINGBREAK 0x1000 Breaks with the “abort, break, ignore” prompt if a DBF_WARNING message occurs. (Normally, DBF_WARNING messages are displayed but no break occurs). This option also applies to invalid parameter warnings.
DBO_TRACEBREAK 0x2000 Breaks with the “abort, break, ignore” on any DBF_TRACE message that matches the value specified in the dwFilter member.
DBO_SILENT 0x8000 Does not display warning, error, or fatal messages except in cases where a stack trace and “abort, break, ignore” prompt would occur.

dwFilter

Specifies filtering options for DBF_TRACE messages. (Normally, trace messages are not sent to the debug terminal.) This member can be one or more of the following values:

Constant Value Meaning

DBF_KRN_MEMMAN 0x0001 Enables KERNEL messages related to local and global memory management.
DBF_KRN_LOADMODULE 0x0002 Enables KERNEL messages related to module loading.
DBF_KRN_SEGMENTLOAD 0x0004 Enables KERNEL messages related to segment loading.
DBF_APPLICATION 0x0008 Enables trace messages originating from an application.
DBF_DRIVER 0x0010 Enables trace messages originating from device drivers.
DBF_PENWIN 0x0020 Enables trace messages originating from PENWIN.
DBF_MMSYSTEM 0x0040 Enables trace messages originating from MMSYSTEM.
DBF_GDI 0x0400 Enables trace messages originating from GDI.
DBF_USER 0x0800 Enables trace messages originating from USER.
DBF_KERNEL 0x1000 Enables any trace message originating from KERNEL. (This is a combination of DBF_KRN_MEMMAN, DBF_KRN_LOADMODULE, and DBF_KRN_SEGMENTLOAD.)

achAllocModule

Specifies the name of the application module. (This can be different from the name of the executable file.) This cannot be the name of a dynamic-link library (DLL). The name is limited to 8 characters.

dwAllocBreak

Specifies the number of global or local memory allocations to allow before failing allocation requests. When the count of allocations reaches the number specified in this member, that allocation and all subsequent allocations fail. If this member is zero, no allocation break is set, but the system counts allocations and reports the current count in the dwAllocCount member.

dwAllocCount

Current count of allocations. (This information is typically retrieved by calling the GetWinDebugInfo function.)

Comments

Developers can use the achAllocModule, dwAllocBreak, and dwAllocCount members to ensure that an application performs correctly in out-of-memory conditions. Because memory allocations made by the system fail once the break count is

reached, calls to functions such as CreateWindow, CreateBrush, and SelectObject will fail as well. Only allocations made within the context of the application specified by the achAllocModule member are affected by the allocation break count.

See Also

DebugOutput, GetWinDebugInfo, SetWinDebugInfo