Debugging Tools for Windows

Execute

The Execute and ExecuteWide methods execute the specified debugger commands.

HRESULT
  IDebugControl::Execute(
    IN ULONG  OutputControl,
    IN PCSTR  Command,
    IN ULONG  Flags
    );

HRESULT
  IDebugControl4::ExecuteWide(
    IN ULONG  OutputControl,
    IN PCWSTR  Command,
    IN ULONG  Flags
    );

#ifdef UNICODE
#define ExecuteT ExecuteWide
#else
#define ExecuteT Execute
#endif

Parameters

OutputControl
Specifies the output control to use while executing the command. For possible values, see DEBUG_OUTCTL_XXX. For more information about output, see Input and Output.
Command
Specifies the command string to execute. The command is interpreted like those typed into a debugger command window. This command string can contain multiple commands for the engine to execute. See Debugger Commands for the command reference.
Flags
Specifies a bit field of execution options for the command. The default options are to log the command but to not send it to the output. The following table lists the bits that can be set.
Value Description
DEBUG_EXECUTE_ECHO The command string is sent to the output.
DEBUG_EXECUTE_NOT_LOGGED The command string is not logged. This is overridden by DEBUG_EXECUTE_ECHO.
DEBUG_EXECUTE_NO_REPEAT If Command is an empty string, do not repeat the last command, and do not save the current command string for repeat execution later.

Return Value

S_OK
The method was successful.

This method can also return error values. See Return Values for more details.

Interface Version

Execute is available in all versions of IDebugControl. ExecuteWide is available in IDebugControl4 and later versions.

Comments

These methods execute the given command string. If the string has multiple commands, these methods will not return until all of the commands have been executed. This may involve waiting for the target to execute, so these methods can take an arbitrary amount of time to complete.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

ExecuteCommandFile

Build machine: CAPEBUILD