Skip to content

Latest commit

 

History

History
187 lines (112 loc) · 6.58 KB

nf-dbgeng-idebugclient5-createprocessandattach2wide.md

File metadata and controls

187 lines (112 loc) · 6.58 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:dbgeng.IDebugClient5.CreateProcessAndAttach2Wide
IDebugClient5::CreateProcessAndAttach2Wide (dbgeng.h)
The CreateProcessAndAttach2Wide method creates a process from a specified command line, then attach to that process or another user-mode process.
debugger\createprocessandattach2wide.htm
debugger
05/03/2018
IDebugClient5::CreateProcessAndAttach2Wide
CreateProcessAndAttach2Wide, CreateProcessAndAttach2Wide method [Windows Debugging], CreateProcessAndAttach2Wide method [Windows Debugging],IDebugClient5 interface, IDebugClient5 interface [Windows Debugging],CreateProcessAndAttach2Wide method, IDebugClient5.CreateProcessAndAttach2Wide, IDebugClient5::CreateProcessAndAttach2Wide, dbgeng/IDebugClient5::CreateProcessAndAttach2Wide, debugger.createprocessandattach2wide
dbgeng.h
Dbgeng.h
Desktop
Windows
IDebugClient5::CreateProcessAndAttach2Wide
dbgeng/IDebugClient5::CreateProcessAndAttach2Wide
APIRef
kbSyntax
COM
dbgeng.h
IDebugClient5::CreateProcessAndAttach2Wide

IDebugClient5::CreateProcessAndAttach2Wide

-description

The CreateProcessAndAttach2Wide method creates a process from a specified command line, then attach to that process or another user-mode process.

-parameters

-param Server [in]

Specifies the process server to use to attach to the process. If Server is zero, the engine will connect to the local process without using a process server.

-param CommandLine [in, optional]

Specifies the command line to execute to create the new process. If CommandLine is NULL, no process is created and these methods will use ProcessId to attach to an existing process.

-param OptionsBuffer [in]

Specifies the process creation options. OptionsBuffer is a pointer to a DEBUG_CREATE_PROCESS_OPTIONS structure.

-param OptionsBufferSize [in]

Specifies the size of the buffer OptionsBuffer. This should be set to sizeof(DEBUG_CREATE_PROCESS_OPTIONS).

-param InitialDirectory [in, optional]

Specifies the starting directory for the process. This parameter is used only if CommandLine is not NULL. If InitialDirectory is NULL, the current directory for the process server is used.

-param Environment [in, optional]

Specifies an environment block for the new process. An environment block consists of a null-terminated block of null-terminated strings. Each string is of the form:

name=value

Note that the last two characters of the environment block are both NULL: one to terminate the string and one to terminate the block.

If Environment is set to NULL, the new process inherits the environment block of the process server. If the DEBUG_CREATE_PROCESS_THROUGH_RTL flag is set in OptionsBuffer, then Environment must be NULL.

-param ProcessId [in]

Specifies the process ID of the target process to which the debugger will attach. If ProcessID is zero, the debugger will attach to the process it created from CommandLine.

-param AttachFlags [in]

Specifies the flags that control how the debugger attaches to the target process. For details on these flags, see DEBUG_ATTACH_XXX.

-returns

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

Return code Description
S_OK
The method was successful.
E_INVALIDARG
This is returned if CommandLine is NULL and ProcessId is zero.

-remarks

This method is available only for live user-mode debugging.

If CommandLine is not NULL and ProcessId is not zero, then the engine will create the process in a suspended state. The engine will resume this newly created process after it successfully connects to the process specified in ProcessId.

Note   The engine doesn't completely attach to the process until the WaitForEvent method has been called. Only after the process has generated an event -- for example, the create-process event -- does it become available in the debugger session.
 
For more information about creating and attaching to live user-mode targets, see Live User-Mode Targets.

-see-also

.attach (Attach to Process)

.create (Create Process)

AbandonCurrentProcess

AttachProcess

ConnectProcessServer

CreateProcess2

DetachCurrentProcess

GetRunningProcessDescription

GetRunningProcessSystemIds

IDebugClient5

TerminateCurrentProcess