IDebugPortEx2::LaunchSuspended

启动可执行文件。

语法

int LaunchSuspended( 
   string             pszExe,
   string             pszArgs,
   string             pszDir,
   string             bstrEnv,
   uint               hStdInput,
   uint               hStdOutput,
   uint               hStdError,
   out IDebugProcess2 ppPortProcess
);

参数

pszExe
[in]要启动的可执行文件的名称。 这可以是完整路径,也可以是相对于参数中指定的 pszDir 工作目录。

pszArgs
[in]要传递给可执行文件的参数。 如果没有参数,则为 null 值。

pszDir
[in]可执行文件使用的工作目录的名称。 如果不需要工作目录,则可为 null 值。

bstrEnv
[in]以 null 结尾的字符串的环境块,后跟一个额外的 NULL 终止符。

hStdInput
[in]备用输入流的句柄。 如果不需要重定向,则为 0。

hStdOutput
[in]备用输出流的句柄。 如果不需要重定向,则为 0。

hStdError
[in]处理备用错误输出流。 如果不需要重定向,则为 0。

ppPortProcess
[out]返回一个 IDebugPendingBreakpoint2 对象,该对象代表启动的进程。

返回值

如果成功,则返回 S_OK;否则,返回错误代码。

注解

此方法应启动进程,使其挂起且不运行任何代码。 调用 ResumeProcess 方法以恢复进程。

还可以从调试引擎启动程序。 有关详细信息,请参阅 启动程序

另请参阅