Partager via


Gflags UI

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Gflags UI

By using the Gflags dialog box, you can set and clear global flags from a user interface that lists all flags by name. There is no need to look up flag abbreviations or hexadecimal values.

Also, the dialog box provides access to the following features that are not available from the command line:

  • Debugger. Specify that a particular program always runs in a debugger.

  • Launch. Run a program with the specified debugging settings.

  • Kernel Special Pool Tag. Detects kernel pool errors.

Important

  • Pool tagging is permanently enabled on all versions of Windows Server 2003. On these systems, the Enable pool tagging check box on the Gflags dialog box is dimmed and commands to enable or disable pool tagging fail.

This section includes the following topics.

Gflags dialog box

The Gflags dialog box in System Registry mode.

Art Image

To open the dialog box

Use one of the following methods:

  • At the command line, type gflags (without parameters).

  • In the Run dialog box, type gflags (without parameters).

To set and clear systemwide registry flags

Systemwide registry settings affect the entire system. They are saved in the registry and remain effective until you change them.

  1. In the Destination area, click System Registry.

  2. Set or clear a flag by selecting or clearing the check box associated with the flag.

  3. When you have selected or cleared all the flags you want, click Apply.

  4. Restart the system to make the changes effective.

To set and clear kernel mode flags

Kernel mode settings affect the entire system, but are effective only for the current session.

  1. In the Destination area, click Kernel Mode.

  2. Set or clear a flag by selecting or clearing the check box associated with the flag.

  3. When you have selected or cleared all the flags you want, click Apply.

To set and clear image file registry flags

Image file settings affect instances of the specified program that start after the command completes. They are saved in the registry and remain effective until you change them.

  1. In the Destination area, in the Image File Name box, type the name of the executable file or DLL, including the file name extension.

  2. Click Image File Options.

  3. Set or clear a flag by selecting or clearing the check box associated with the flag.

  4. When you have selected or cleared all the flags you want, click Apply.

To launch a program with flags

This feature runs a program once with the specified flags. These settings affect only the instance of the program launched by the instruction in the Command Line box. They are not saved in the registry.

  1. In the Destination area, in the Command Line box, type a command to start a program, including program parameters.

  2. Set or clear a flag by selecting or clearing the check box associated with the flag.

  3. When you have selected or cleared all the flags you want, click the Launch button.

Notes

  • Flags set in the registry do not affect the instance of the program that is launched.

  • Flags set in the dialog box are used for the launched instance even when they are not image file flags.

To run a program in a debugger

This feature configures the program so that it always runs in a debugger with the specified options. This setting is saved in the registry. It affects all new instances of the program and remains effective until you change it.

The flags settings in the dialog box do not affect the debugger run.

  1. In the Destination area, in the Image File Name box, type the name of the executable file, including the file name extension.

  2. Click Image File Options.

  3. In the Image Debugger Options area, click the Debugger check box.

  4. In the Debugger box, type the command to run the debugger, including the program name and parameters. For example, ntsd -d.

  5. Click Apply.

To configure kernel special pool

The kernel special pool feature uses the special pool for all allocations that have a specified tag or are within a specified size range. This feature helps you to detect and identify the source of errors in kernel pool use, such as writing beyond the allocated memory space, or referring to memory that has already been freed.

For information on using the special pool, see the Windows Driver Development Kit.

Kernel special pool settings are saved in the registry. They become effective when you restart the system and remain effective until you change them.

  1. In the Destination area, click System Registry.

  2. Choose one of the following methods:

    • To specify a pool tag in text format, click Text.

      Type a four-character pattern for the tag. The tag can include the ? (substitute for any single character) and * (substitute for multiple characters) wildcard characters. For example, Fat* or Av?4.

      Gflags converts the ASCII characters to their hexadecimal format, placing the leftmost character in the lowest order position. For example, if you type Tag1, Gflags sets the tag to 0x31676154.

    • To specify a pool tag in hexadecimal format, click Hex.

      Type a hexadecimal value for the tag.

      Gflags sets the tag to the same numeric value. For example, if you type 12345678, Gflags stores pool tag 0x12345678.

      Note

Enter a hexadecimal value that is greater than the page size of the system. Otherwise, the value is interpreted as indicating a size range.

  • To track kernel pool allocations of a specified size, click Hex.

    Allocations are organized into a range of pool block sizes. In 32-bit systems, pool blocks are divided into 8-byte ranges. In 64-bit systems, the range is 16 bytes.

    To indicate a range, type a hexadecimal number equal to the upper limit of the range plus 8 bytes for the pool header. For example, on a 32-bit system, to specify a pool block of between 9 and 16 bytes, type 18 to indicate 0x18.

    The following table shows the pattern of pool block ranges and the value you type to select that range for 32-bit systems.

    Size range (in bytes) Value

    0 - 8

    0x10 (16)

    9 - 16

    0x18 (24)

    17 - 24

    0x20 (32)

    25 - 32

    0x28 (40)

    ...

     

    The following table shows the pattern of pool block ranges and the value you type to select that range for 64-bit systems.

    Size range (in bytes) Value

    0 - 16

    0x18 (24)

    17 - 32

    0x28 (40)

    33 - 48

    0x38 (56)

    49 - 64

    0x46 (70)

    ...

     

    Note

The value for a size range must be equal to a multiple of 8 plus 8 (8x + 8) on 32-bit systems, or a multiple of 16 + 8 (16x + 8) on 64-bit systems. Also, the value must be smaller than the page size for the system. Otherwise, the value is interpreted as a hexadecimal tag.

  1. Click Verify Start or Verify End.

    • Verify Start causes a system stop when a program tries to access tagged memory preceding its memory allocation.

    • Verify End causes a system stop when a program tries to access tagged memory beyond its memory allocation.

  2. Click Apply.

  3. To disable kernel special pool, delete the text or hexadecimal value from the Kernel Special Pool Tag box, and then click Apply.

Note

  • The special pool can also be used for the memory pool allocations requested by a specific driver. This feature is activated by Driver Verifier (Verifier.exe), a tool included in the Windows\System32 directory in Windows 2000, Windows XP, and Windows Server 2003. For details, see the Driver Verifier documentation in the Windows Driver Development Kit (DDK).

See Also

Concepts

Gflags.exe
Gflags Remarks
Gflags Syntax
Gflags Examples
Gflags Flag Reference
Alphabetical List of Tools
Windiff Overview
Remote Overview
Poolmon Overview
Msizap Overview
Msicuu Overview
Memsnap Overview
Devcon Overview
Pviewer Overview
Exctrlst Overview
Devcon Overview
Apmstat Overview