uTools-Manuals/docs/php/win32_set_service_exit_code.html
2019-04-28 19:00:34 +08:00

87 lines
3.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Define or return the exit code for the current running service</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.win32-set-service-exit-code" class="refentry">
<div class="refnamediv">
<h1 class="refname">win32_set_service_exit_code</h1>
<p class="verinfo">(PECL win32service &gt;=0.4.0)</p><p class="refpurpose"><span class="refname">win32_set_service_exit_code</span> &mdash; <span class="dc-title">Define or return the exit code for the current running service</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.win32-set-service-exit-code-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>win32_set_service_exit_code</strong></span>
([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$exitCode</code><span class="initializer"> = 1</span></span>
] ) : <span class="type">int</span></div>
<p class="para rdfs-comment">
Change or return the exit code. The exit code is used only if the exit mode is not graceful.
If the value is not zero, the recovery configuration can be used after
service fail. See
<a href="https://docs.microsoft.com/en-us/windows/desktop/debug/system-error-codes" class="link external">&raquo;&nbsp;Microsoft system error codes</a>
for more details
</p>
<div class="caution"><strong class="caution">Caution</strong>
<p class="para">
This function work only in &quot;cli&quot; SAPI. On other SAPI
this function is disabled.
</p>
</div>
</div>
<div class="refsect1 parameters" id="refsect1-function.win32-set-service-exit-code-parameters">
<h3 class="title">参数</h3>
<dl>
<dt>
<code class="parameter">exitCode</code></dt>
<dd>
<p class="para">
The return code used on exit.
</p>
</dd>
</dl>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.win32-set-service-exit-code-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Return the current or old exit code.
</p>
</div>
<div class="refsect1 errors" id="refsect1-function.win32-set-service-exit-code-errors">
<h3 class="title">错误/异常</h3>
<p class="para">
If SAPI is not <em>&quot;cli&quot;</em>, this function emits an
<strong><code>E_ERROR</code></strong> level error.
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.win32-set-service-exit-code-seealso">
<h3 class="title">参见</h3>
<ul class="simplelist">
<li class="member"><span class="function"><a href="win32_start_service_ctrl_dispatcher.html" class="function" rel="rdfs-seeAlso">win32_start_service_ctrl_dispatcher()</a> - Registers the script with the SCM, so that it can act as the service with the given name</span></li>
<li class="member"><span class="function"><a href="win32_set_service_status.html" class="function" rel="rdfs-seeAlso">win32_set_service_status()</a> - Update the service status</span></li>
<li class="member"><span class="function"><a href="win32_set_service_exit_mode.html" class="function" rel="rdfs-seeAlso">win32_set_service_exit_mode()</a> - Define or return the exit mode for the current running service</span></li>
</ul>
</div>
</div></div></div></body></html>