共用方式為


IDebugPortEx2::LaunchSuspended

Launches an executable file.

HRESULT LaunchSuspended( 
   LPCOLESTR        pszExe,
   LPCOLESTR        pszArgs,
   LPCOLESTR        pszDir,
   BSTR             bstrEnv,
   DWORD            hStdInput,
   DWORD            hStdOutput,
   DWORD            hStdError,
   IDebugProcess2** ppPortProcess
);
int LaunchSuspended( 
   string             pszExe,
   string             pszArgs,
   string             pszDir,
   string             bstrEnv,
   uint               hStdInput,
   uint               hStdOutput,
   uint               hStdError,
   out IDebugProcess2 ppPortProcess
);

Parameters

  • pszExe
    [in] The name of the executable to be launched. This can be a full path or relative to the working directory specified in the pszDir parameter.

  • pszArgs
    [in] The arguments to pass to the executable. May be a null value if there are no arguments.

  • pszDir
    [in] The name of the working directory used by the executable. May be a null value if no working directory is required.

  • bstrEnv
    [in] Environment block of null-terminated strings, followed by an additional NULL terminator.

  • hStdInput
    [in] Handle to an alternate input stream. May be 0 if redirection is not required.

  • hStdOutput
    [in] Handle to an alternate output stream. May be 0 if redirection is not required.

  • hStdError
    [in] Handle to an alternate error output stream. May be 0 if redirection is not required.

  • ppPortProcess
    [out] Returns an IDebugPendingBreakpoint2 object that represents the launched process.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

This method should launch the process so that it is suspended and not running any code. The IDebugPortEx2::ResumeProcess method is called to resume the process.

A program can also be launched from a debug engine. For details, see Launching a Program.

See Also

Reference

IDebugPortEx2

IDebugPendingBreakpoint2

IDebugPortEx2::ResumeProcess

Concepts

Launching a Program