<trclass="memdesc:a810ad9941bedba543bf60507c31c55da"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Starts a Crashpad handler process, performing any necessary handshake to configure it. <ahref="#a810ad9941bedba543bf60507c31c55da">More...</a><br/></td></tr>
<trclass="memdesc:a89f34445eca859e6c0d1876e8e171c25"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the process’crash handler to a Mach service registered with the bootstrap server. <ahref="#a89f34445eca859e6c0d1876e8e171c25">More...</a><br/></td></tr>
<trclass="memdesc:a35e9ce1b1771a597aa3276ec28de28a7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the process’crash handler to a Mach port. <ahref="#a35e9ce1b1771a597aa3276ec28de28a7">More...</a><br/></td></tr>
<trclass="memdesc:a9f1d5d38e9b4f5781e3821551dcc39d5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the IPC pipe of a presumably-running Crashpad handler process which was started with <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> or by other compatible means and does an IPC message exchange to register this process with the handler. Crashes will be serviced once this method returns. <ahref="#a9f1d5d38e9b4f5781e3821551dcc39d5">More...</a><br/></td></tr>
<trclass="memdesc:a2fc86d3d5bc6dcc9c9456e487f516c4d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Retrieves the IPC pipe name used to register with the Crashpad handler. <ahref="#a2fc86d3d5bc6dcc9c9456e487f516c4d">More...</a><br/></td></tr>
<trclass="memitem:a0377d4e93ac77453f57f3c1fcae09e14"><tdclass="memItemLeft"align="right"valign="top">bool </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcrashpad_1_1CrashpadClient.html#a0377d4e93ac77453f57f3c1fcae09e14">WaitForHandlerStart</a> (unsigned int timeout_ms)</td></tr>
<trclass="memdesc:a0377d4e93ac77453f57f3c1fcae09e14"><tdclass="mdescLeft"> </td><tdclass="mdescRight">When <code>asynchronous_start</code> is used with <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a>, this method can be used to block until the handler launch has been completed to retrieve status information. <ahref="#a0377d4e93ac77453f57f3c1fcae09e14">More...</a><br/></td></tr>
<trclass="memdesc:a0b795ac1d4e01ba03e4085954249edfc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Requests that the handler capture a dump of a different process. <ahref="#a0b795ac1d4e01ba03e4085954249edfc">More...</a><br/></td></tr>
<trclass="memdesc:a8ac211aa3a8cf278eb10f4058a7776fb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Requests that the handler capture a dump even though there hasn't been a crash. <ahref="#a8ac211aa3a8cf278eb10f4058a7776fb">More...</a><br/></td></tr>
<trclass="memdesc:a87d1fa142b0bf7094fc66fef3135a64a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Requests that the handler capture a dump using the given <em>exception_pointers</em> to get the <code>EXCEPTION_RECORD</code> and <code>CONTEXT</code>. <ahref="#a87d1fa142b0bf7094fc66fef3135a64a">More...</a><br/></td></tr>
<trclass="memdesc:a1a6a1e62d90a67db782664b1fe5a952f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Configures the process to direct its crashes to the default handler for the operating system. <ahref="#a1a6a1e62d90a67db782664b1fe5a952f">More...</a><br/></td></tr>
<tr><thcolspan="2">Enumerator</th></tr><tr><tdclass="fieldname"><aid="ae46278158517f37dab44a72652dfd20ca193286f9cde3032e18a06a4e6452e660"></a>kTriggeredExceptionCode </td><tdclass="fielddoc"><p>The exception code (roughly "Client called") used when <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a0b795ac1d4e01ba03e4085954249edfc"title="Requests that the handler capture a dump of a different process. ">DumpAndCrashTargetProcess()</a> triggers an exception in a target process. </p>
<dlclass="section note"><dt>Note</dt><dd>This value does not have any bits of the top nibble set, to avoid confusion with real exception codes which tend to have those bits set. </dd></dl>
</td></tr>
</table>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Requests that the handler capture a dump using the given <em>exception_pointers</em> to get the <code>EXCEPTION_RECORD</code> and <code>CONTEXT</code>. </p>
<p>This function is not necessary in general usage as an unhandled exception filter is installed by <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> or <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a9f1d5d38e9b4f5781e3821551dcc39d5"title="Sets the IPC pipe of a presumably-running Crashpad handler process which was started with StartHandle...">SetHandlerIPCPipe()</a>.</p>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">exception_pointers</td><td>An <code>EXCEPTION_POINTERS</code>, as would generally passed to an unhandled exception filter. </td></tr>
<p>Requests that the handler capture a dump of a different process. </p>
<p>The target process must be an already-registered Crashpad client. An exception will be triggered in the target process, and the regular dump mechanism used. This function will block until the exception in the target process has been handled by the Crashpad handler.</p>
<p>This function is unavailable when running on Windows XP and will return <code>false</code>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">process</td><td>A <code>HANDLE</code> identifying the process to be dumped. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">blame_thread</td><td>If non-null, a <code>HANDLE</code> valid in the caller's process, referring to a thread in the target process. If this is supplied, instead of the exception referring to the location where the exception was injected, an exception record will be fabricated that refers to the current location of the given thread. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">exception_code</td><td>If <em>blame_thread</em> is non-null, this will be used as the exception code in the exception record.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><code>true</code> if the exception was triggered successfully. </dd></dl>
<p>Requests that the handler capture a dump even though there hasn't been a crash. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">context</td><td>A <code>CONTEXT</code>, generally captured by <aclass="el"href="namespacecrashpad.html#ac25486c6b4c38fc7c7868e978094edcf"title="Saves the CPU context. ">CaptureContext()</a> or similar. </td></tr>
<p>This method retrieves the IPC pipe name set by <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a9f1d5d38e9b4f5781e3821551dcc39d5"title="Sets the IPC pipe of a presumably-running Crashpad handler process which was started with StartHandle...">SetHandlerIPCPipe()</a>, or a suitable IPC pipe name chosen by <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a>. It is intended to be used to obtain the IPC pipe name so that it may be passed to other processes, so that they may register with an existing Crashpad handler by calling <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a9f1d5d38e9b4f5781e3821551dcc39d5"title="Sets the IPC pipe of a presumably-running Crashpad handler process which was started with StartHandle...">SetHandlerIPCPipe()</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>The full name of the crash handler IPC pipe, a string of the form <code>"\\.\pipe\NAME"</code>. </dd></dl>
<p>Sets the IPC pipe of a presumably-running Crashpad handler process which was started with <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> or by other compatible means and does an IPC message exchange to register this process with the handler. Crashes will be serviced once this method returns. </p>
<p>This method sets the unhandled exception handler to a local function that when reached will "signal and wait" for the crash handler process to create the dump.</p>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">ipc_pipe</td><td>The full name of the crash handler IPC pipe. This is a string of the form <code>"\\.\pipe\NAME"</code>.</td></tr>
<p>See <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> for more detail on how the port and handler are configured.</p>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">exception_port</td><td>An <code>exception_port_t</code> corresponding to a Crashpad exception handler service.</td></tr>
<p>See <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> for more detail on how the port and handler are configured.</p>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">service_name</td><td>The service name of a Crashpad exception handler service previously registered with the bootstrap server.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><code>true</code> on success, <code>false</code> on failure with a message logged. </dd></dl>
<p>This method directs crashes to the Crashpad handler. On macOS, this is applicable to this process and all subsequent child processes. On Windows, child processes must also register by using <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a9f1d5d38e9b4f5781e3821551dcc39d5"title="Sets the IPC pipe of a presumably-running Crashpad handler process which was started with StartHandle...">SetHandlerIPCPipe()</a>.</p>
<p>On macOS, this method starts a Crashpad handler and obtains a Mach send right corresponding to a receive right held by the handler process. The handler process runs an exception server on this port. This method sets the task’s exception port for <code>EXC_CRASH</code>, <code>EXC_RESOURCE</code>, and <code>EXC_GUARD</code> exceptions to the Mach send right obtained. The handler will be installed with behavior <code>EXCEPTION_STATE_IDENTITY | MACH_EXCEPTION_CODES</code> and thread state flavor <code>MACHINE_THREAD_STATE</code>. Exception ports are inherited, so a Crashpad handler started here will remain the handler for any child processes created after <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> is called. These child processes do not need to call <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> or be aware of Crashpad in any way. The Crashpad handler will receive crashes from child processes that have inherited it as their exception handler even after the process that called <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a> exits.</p>
<p>On Windows, if <em>asynchronous_start</em> is <code>true</code>, this function will not directly call <code>CreateProcess()</code>, making it suitable for use in a <code>DllMain()</code>. In that case, the handler is started from a background thread, deferring the handler's startup. Nevertheless, regardless of the value of <em>asynchronous_start</em>, after calling this method, the global unhandled exception filter is set up, and all crashes will be handled by Crashpad. Optionally, use <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a0377d4e93ac77453f57f3c1fcae09e14"title="When asynchronous_start is used with StartHandler(), this method can be used to block until the handl...">WaitForHandlerStart()</a> to join with the background thread and retrieve the status of handler startup.</p>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">handler</td><td>The path to a Crashpad handler executable. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">database</td><td>The path to a Crashpad database. The handler will be started with this path as its <code>--database</code> argument. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">metrics_dir</td><td>The path to an already existing directory where metrics files can be stored. The handler will be started with this path as its <code>--metrics-dir</code> argument. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">url</td><td>The URL of an upload server. The handler will be started with this URL as its <code>--url</code> argument. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">annotations</td><td>Process annotations to set in each crash report. The handler will be started with an <code>--annotation</code> argument for each element in this map. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">arguments</td><td>Additional arguments to pass to the Crashpad handler. Arguments passed in other parameters and arguments required to perform the handshake are the responsibility of this method, and must not be specified in this parameter. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">restartable</td><td>If <code>true</code>, the handler will be restarted if it dies, if this behavior is supported. This option is not available on all platforms, and does not function on all OS versions. If it is not supported, it will be ignored. </td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">asynchronous_start</td><td>If <code>true</code>, the handler will be started from a background thread. Optionally, <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a0377d4e93ac77453f57f3c1fcae09e14"title="When asynchronous_start is used with StartHandler(), this method can be used to block until the handl...">WaitForHandlerStart()</a> can be used at a suitable time to retreive the result of background startup. This option is only used on Windows.</td></tr>
<p>On macOS, this sets the task’s exception port as in <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a35e9ce1b1771a597aa3276ec28de28a7"title="Sets the process’crash handler to a Mach port. ">SetHandlerMachPort()</a>, but the exception handler used is obtained from <aclass="el"href="namespacecrashpad.html#a47204f3a62646651e8f393cac2a6316b"title="Obtains the system’s default Mach exception handler for crash-type exceptions. ">SystemCrashReporterHandler()</a>. If the system’s crash reporter handler cannot be determined or set, the task’s exception ports for crash-type exceptions are cleared.</p>
<p>Use of this function is strongly discouraged.</p>
<dlclass="section warning"><dt>Warning</dt><dd>After a call to this function, Crashpad will no longer monitor the process for crashes until a subsequent call to <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a35e9ce1b1771a597aa3276ec28de28a7"title="Sets the process’crash handler to a Mach port. ">SetHandlerMachPort()</a>.</dd></dl>
<dlclass="section note"><dt>Note</dt><dd>This is provided as a static function to allow it to be used in situations where a <aclass="el"href="classcrashpad_1_1CrashpadClient.html"title="The primary interface for an application to have Crashpad monitor it for crashes. ...">CrashpadClient</a> object is not otherwise available. This may be useful when a child process inherits its parent’s Crashpad handler, but wants to sever this tie. </dd></dl>
<p>When <code>asynchronous_start</code> is used with <aclass="el"href="classcrashpad_1_1CrashpadClient.html#a810ad9941bedba543bf60507c31c55da"title="Starts a Crashpad handler process, performing any necessary handshake to configure it...">StartHandler()</a>, this method can be used to block until the handler launch has been completed to retrieve status information. </p>
<p>This method should not be used unless <code>asynchronous_start</code> was <code>true</code>.</p>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">timeout_ms</td><td>The number of milliseconds to wait for a result from the background launch, or <code>0xffffffff</code> to block indefinitely.</td></tr>
<dlclass="section return"><dt>Returns</dt><dd><code>true</code> if the hander startup succeeded, <code>false</code> otherwise, and an error message will have been logged. </dd></dl>