Windows Tools

Gflags Syntax

Overview | Notes | Syntax | UI | Examples | Flags | Related Tools Run Tool Open Command Prompt

One Step gflags [/r [flag [flag...]] [maxdepth StackSize]] | [/k [flag [flag...]] | [/i ImageFile [flag][flag...]]

Parameters

flag
A three-letter abbreviation (flag-abbr) or hexadecimal value (flag-hex) that represents a debugging feature. The abbreviations and hexadecimal values are listed in the Global Flags Table.

Use one of the following flag formats:

Format Description
{+ | -}flag-abbr Sets (+) or clears (-) the flag represented by the flag abbreviation. Without a plus (+) or minus (-) symbol, the command has no effect.
[+ | -]flag-hex Adds (+) or subtracts (-) the hexadecimal value of a flag. A flag is set when its value is included in the sum. Add (+) is the default. Enter a hexadecimal value (without 0x) that represents a single flag or enter the sum of hexadecimal values for multiple flags.
/r [flag [flag...]] [maxdepth StackSize]]
Registry. View and change systemwide debugging settings stored in the registry. These settings take effect when you restart the system and remain effective until you change them.
Parameter Description
None Displays the systemwide flags set in the registry.
flag Sets or clears systemwide flags stored in the registry.
maxdepth StackSize Specifies the maximum size of the stack trace in decimal units. The default is 16.
/k [flag [flag...]
Kernel mode settings. View and change debugging settings for this session. These settings are effective immediately, but are lost when the system stops. The settings affect processes started after this command completes.
Parameter Description
None Displays flags set for the current session.
flag Sets or clears flags for the current session.
/i ImageFile [flag [flag...]
Image file settings. View and change debugging settings for a particular process. These settings are stored in the registry. These settings are effective for all new instances of this process. They remain effective until you change them.
Parameter Description
None Displays the flags for the specified image file.
flag Sets or clears flags for the specified image file.

Global Flags Table

The following table lists the flags that Gflags changes, the hexadecimal value and abbreviation for each flag, and the destination (R for registry, K for kernel, I for image file) in which the flag is valid.

For a detailed description of each flag, see the Gflags Flag Reference.

Caution

Description Symbolic name Hexadecimal Value Abbreviation Destination
Buffer DbgPrint output FLG_DISABLE_DBGPRINT 0x08000000 ddp R,K
Create kernel mode stack trace database FLG_KERNEL_STACK_TRACE_DB 0x2000 kst R, K
Create user mode stack trace database FLG_USER_STACK_TRACE_DB 0x1000 ust R,K,I
Debug initial command FLG_DEBUG_INITIAL_COMMAND 0x4 dic R,K
Debug WINLOGON FLG_DEBUG_INITIAL_COMMAND_EX 0x04000000 dwl R, K
Disable heap coalesce on free FLG_HEAP_DISABLE_COALESCING 0x00200000 dhc R,K,I
Disable paging of kernel stacks FLG_DISABLE_PAGE_KERNEL_STACKS 0x80000 dps R,K
Disable protected DLL verification FLG_DISABLE_PROTDLLS 0x80000000 dpd R,K,I
Disable stack extension FLG_DISABLE_STACK_EXTENSION 0x10000 dse I
Early critical section event creation FLG_CRITSEC_EVENT_CREATION 0x10000000 cse R,K,I
Enable application verifier FLG_APPLICATION_VERIFIER 0x100 vrf R,K,I
Enable bad handles detection FLG_ENABLE_HANDLE_EXCEPTIONS 0x40000000 bhd R,K
Enable close exception FLG_ENABLE_CLOSE_EXCEPTIONS 0x00400000 ece R,K
Enable debugging of Win32 subsystem FLG_ENABLE_CSRDEBUG 0x20000 d32 R,K
Enable exception logging FLG_ENABLE_EXCEPTION_LOGGING 0x00800000 eel R,K
Enable heap free checking FLG_HEAP_ENABLE_FREE_CHECK 0x20 hfc R,K,I
Enable heap parameter checking FLG_HEAP_VALIDATE_PARAMETERS 0x40 hpc R,K,I
Enable heap tagging FLG_HEAP_ENABLE_TAGGING 0x800 htg R,K,I
Enable heap tagging by DLL FLG_HEAP_ENABLE_TAG_BY_DLL 0x8000 htd R,K,I
Enable heap tail checking FLG_HEAP_ENABLE_TAIL_CHECK 0x10 htc R,K,I
Enable heap validation on call FLG_HEAP_VALIDATE_ALL 0x80 hvc R,K,I
Enable loading of kernel debugger symbols FLG_ENABLE_KDEBUG_SYMBOL_LOAD 0x40000 ksl R,K
Enable object handle type tagging FLG_ENABLE_HANDLE_TYPE_TAGGING 0x01000000 eot R,K
Enable page heap FLG_HEAP_PAGE_ALLOCS 0x02000000 hpa R,K,I
Enable pool tagging FLG_POOL_ENABLE_TAGGING 0x400 ptg R,K
Enable system critical breaks FLG_ENABLE_SYSTEM_CRIT_BREAKS 0x100000 scb R, K, I
Load DLLs top-down (Win64 only) FLG_LDR_TOP_DOWN 0x20000000 ltd R, K, I
Maintain a list of objects for each type FLG_MAINTAIN_OBJECT_TYPELIST 0x4000 otl R,K
Show loader snaps FLG_SHOW_LDR_SNAPS 0x2 sls R,K,I
Stop on exception FLG_STOP_ON_EXCEPTION 0x1 soe R,K,I
Stop on hung GUI FLG_STOP_ON_HUNG_GUI 0x8 shg K