crashpad/doc/generated/doxygen/get__function_8h.html
2016-11-08 14:26:59 -05:00

196 lines
13 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crashpad: util/win/get_function.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="crashpad_doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Crashpad
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_23ec12649285f9fabf3a6b7380226c28.html">util</a></li><li class="navelem"><a class="el" href="dir_04861af0646e74845232399e73d584d9.html">win</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">get_function.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;windows.h&gt;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespacecrashpad"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacecrashpad.html">crashpad</a></td></tr>
<tr class="memdesc:namespacecrashpad"><td class="mdescLeft">&#160;</td><td class="mdescRight">The main namespace. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespacecrashpad_1_1internal"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacecrashpad_1_1internal.html">crashpad::internal</a></td></tr>
<tr class="memdesc:namespacecrashpad_1_1internal"><td class="mdescLeft">&#160;</td><td class="mdescRight">The internal namespace, not for public use. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a0997574e7522725516242d78632ed686"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="get__function_8h.html#a0997574e7522725516242d78632ed686">GET_FUNCTION</a>(library, function)</td></tr>
<tr class="memdesc:a0997574e7522725516242d78632ed686"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a function pointer to a named function in a library without requiring that it be found. <a href="#a0997574e7522725516242d78632ed686">More...</a><br /></td></tr>
<tr class="separator:a0997574e7522725516242d78632ed686"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae87bc4c8800c7e6f35c06bf48cb636f3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="get__function_8h.html#ae87bc4c8800c7e6f35c06bf48cb636f3">GET_FUNCTION_REQUIRED</a>(library, function)</td></tr>
<tr class="memdesc:ae87bc4c8800c7e6f35c06bf48cb636f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a function pointer to a named function in a library, requiring that it be found. <a href="#ae87bc4c8800c7e6f35c06bf48cb636f3">More...</a><br /></td></tr>
<tr class="separator:ae87bc4c8800c7e6f35c06bf48cb636f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa982a8cad0e72cddf1989d135db3c338"><td class="memItemLeft" align="right" valign="top">FARPROC&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacecrashpad_1_1internal.html#aa982a8cad0e72cddf1989d135db3c338">crashpad::internal::GetFunctionInternal</a> (const wchar_t *library, const char *function, bool required)</td></tr>
<tr class="memdesc:aa982a8cad0e72cddf1989d135db3c338"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a function pointer to a named function in a library. <a href="namespacecrashpad_1_1internal.html#aa982a8cad0e72cddf1989d135db3c338">More...</a><br /></td></tr>
<tr class="separator:aa982a8cad0e72cddf1989d135db3c338"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a334a660002ce6e6f06432ccf7d3cc50f"><td class="memTemplParams" colspan="2">template&lt;typename FunctionType &gt; </td></tr>
<tr class="memitem:a334a660002ce6e6f06432ccf7d3cc50f"><td class="memTemplItemLeft" align="right" valign="top">FunctionType *&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacecrashpad_1_1internal.html#a334a660002ce6e6f06432ccf7d3cc50f">crashpad::internal::GetFunction</a> (const wchar_t *library, const char *function, bool required)</td></tr>
<tr class="memdesc:a334a660002ce6e6f06432ccf7d3cc50f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a function pointer to a named function in a library. <a href="namespacecrashpad_1_1internal.html#a334a660002ce6e6f06432ccf7d3cc50f">More...</a><br /></td></tr>
<tr class="separator:a334a660002ce6e6f06432ccf7d3cc50f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a0997574e7522725516242d78632ed686"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0997574e7522725516242d78632ed686">&sect;&nbsp;</a></span>GET_FUNCTION</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GET_FUNCTION</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">library, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">function&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">crashpad::internal::GetFunction&lt;decltype(function)&gt;( \</div><div class="line"> library, #<span class="keyword">function</span>, <span class="keyword">false</span>)</div></div><!-- fragment -->
<p>Returns a function pointer to a named function in a library without requiring that it be found. </p>
<p>If the library or function cannot be found, this will return <code>nullptr</code>. This macro is intended to be used to access functions that may not be available at runtime.</p>
<p>This macro returns a properly-typed function pointer. It is expected to be used in this way: </p><div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> get_named_pipe_client_process_id =</div><div class="line"> <a class="code" href="get__function_8h.html#a0997574e7522725516242d78632ed686">GET_FUNCTION</a>(L<span class="stringliteral">&quot;kernel32.dll&quot;</span>, ::GetNamedPipeClientProcessId);</div><div class="line"><span class="keywordflow">if</span> (get_named_pipe_client_process_id) {</div><div class="line"> BOOL rv = get_named_pipe_client_process_id(pipe, &amp;client_process_id);</div><div class="line">}</div></div><!-- fragment --><p>This accesses <em>library</em> by calling <code>LoadLibrary()</code> and is subject to the same restrictions as that function. Notably, it cant be used from a <code>DllMain()</code> entry point.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">library</td><td>The library to search in. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">function</td><td>The function to search for. A leading <code>::</code> is recommended when a wrapper function of the same name is present.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the requested function on success, or <code>nullptr</code> on failure.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="get__function_8h.html#ae87bc4c8800c7e6f35c06bf48cb636f3" title="Returns a function pointer to a named function in a library, requiring that it be found...">GET_FUNCTION_REQUIRED</a> </dd></dl>
</div>
</div>
<a id="ae87bc4c8800c7e6f35c06bf48cb636f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae87bc4c8800c7e6f35c06bf48cb636f3">&sect;&nbsp;</a></span>GET_FUNCTION_REQUIRED</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GET_FUNCTION_REQUIRED</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">library, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">function&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">crashpad::internal::GetFunction&lt;decltype(function)&gt;( \</div><div class="line"> library, #<span class="keyword">function</span>, <span class="keyword">true</span>)</div></div><!-- fragment -->
<p>Returns a function pointer to a named function in a library, requiring that it be found. </p>
<p>If the library or function cannot be found, this will trigger a <code>DCHECK</code> assertion. This macro is intended to be used to access functions that are always expected to be available at runtime but which are not present in any import library.</p>
<p>This macro returns a properly-typed function pointer. It is expected to be used in this way: </p><div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">auto</span> nt_query_object =</div><div class="line"> <a class="code" href="get__function_8h.html#ae87bc4c8800c7e6f35c06bf48cb636f3">GET_FUNCTION_REQUIRED</a>(L<span class="stringliteral">&quot;ntdll.dll&quot;</span>, ::NtQueryObject);</div><div class="line">NTSTATUS status =</div><div class="line"> nt_query_object(handle, type, &amp;info, info_length, &amp;return_length);</div></div><!-- fragment --><p>This accesses <em>library</em> by calling <code>LoadLibrary()</code> and is subject to the same restrictions as that function. Notably, it cant be used from a <code>DllMain()</code> entry point.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">library</td><td>The library to search in. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">function</td><td>The function to search for. A leading <code>::</code> is recommended when a wrapper function of the same name is present.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the requested function.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="get__function_8h.html#a0997574e7522725516242d78632ed686" title="Returns a function pointer to a named function in a library without requiring that it be found...">GET_FUNCTION</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>