Windows Tools

Gflags.exe: Dialog Box Operation

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

By using the Gflags dialog box, you can perform all Gflags functions from a user interface that lists all flags by name. There is no need to look up flag abbreviations or hexadecimal values. Instead, you can set and clear flags by selecting and clearing the named flag check boxes.

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

This section includes the following topics.

Gflags Dialog Box

The Gflags dialog box in System Registry mode.

Gflags Dialog Box

To open the dialog box

Use one of the following methods:

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

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 ? (any single character) and * (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 + 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.
  3. Click Verify Start or Verify End:
    • Verify End causes a system stop when a program tries to access tagged memory beyond its memory allocation.
    • Verify Start causes a system stop when a program tries to access tagged memory preceding its memory allocation.
  4. Click Apply.
  5. To disable kernel special pool, delete the text or hexadecimal value from the Kernel Special Pool Tag box, and then click Apply.

Note