1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>ldr_exports</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
3 .synopsis, .classsynopsis {
5 border: solid 1px #aaaaaa;
10 border: solid 1px #aaaaff;
19 border: solid 1px #ffaaaa;
26 .navigation a:visited {
32 </style><link rel="home" href="index.html" title="Operation Captive Reference Manual"><link rel="up" href="ch01.html" title="Operation Captive"><link rel="previous" href="captive-apiref-storage.html" title="storage"><link rel="next" href="captive-apiref-calltype-reactos.html" title="calltype_reactos"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="captive-apiref-storage.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">Operation Captive Reference Manual</th><td><a accesskey="n" href="captive-apiref-calltype-reactos.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="captive-apiref-ldr-exports"></a><div class="titlepage"></div><div class="refnamediv"><h2>ldr_exports</h2><p>ldr_exports — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
36 gboolean <a href="captive-apiref-ldr-exports.html#captive-kernel-exports">captive_kernel_exports</a> (void);
37 gboolean <a href="captive-apiref-ldr-exports.html#captive-kernel-patches">captive_kernel_patches</a> (void);
38 gboolean <a href="captive-apiref-ldr-exports.html#captive-ModuleList-add-builtin">captive_ModuleList_add_builtin</a> (const gchar *FullName_utf8,
40 gboolean <a href="captive-apiref-ldr-exports.html#captive-ModuleList-patch">captive_ModuleList_patch</a> (const gchar *FullName_utf8,
42 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
44 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="captive-kernel-exports"></a>captive_kernel_exports ()</h3><pre class="programlisting">gboolean captive_kernel_exports (void);</pre><p>
45 Export complete libcaptive modules to reactos. It is done by *.def files used
46 by dlltool(1) of Mingw32 compiler suite. We use native host OS compiler and
47 we also have just a limited set of functions over reactos itself.
48 We use our <a href="captive-apiref-ldr-exports.html#captive-ModuleList-add-builtin">captive_ModuleList_add_builtin</a>() to simulate PE headers exporting
49 our symbols; this export simulation is invocated from this function.
51 This function is generated automatically from exports.captivesym file
52 by captivesym.pl script.
54 Multiple calls of this function are forbidden. See also <a href="captive-apiref-ldr-exports.html#captive-kernel-patches">captive_kernel_patches</a>().</p><p>
56 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt>TRUE</tt> if the export was successful.
57 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="captive-kernel-patches"></a>captive_kernel_patches ()</h3><pre class="programlisting">gboolean captive_kernel_patches (void);</pre><p>
58 Patches W32 libraries by libcaptive functions. It is done by *.def files used
59 by dlltool(1) of Mingw32 compiler suite. We use native host OS compiler and
60 we also have just a limited set of functions over reactos itself.
61 We use our <a href="captive-apiref-ldr-exports.html#captive-ModuleList-patch">captive_ModuleList_patch</a>() to modify existing module function
62 tables generated from <a href="captive-apiref-ldr-exports.html#captive-ModuleList-add-builtin">captive_ModuleList_add_builtin</a>().
64 This function is generated automatically from exports.captivesym file
65 by captivesym.pl script.
67 Multiple calls of this function are forbidden. See also <a href="captive-apiref-ldr-exports.html#captive-kernel-exports">captive_kernel_exports</a>().</p><p>
69 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt>TRUE</tt> if the export was successful.
70 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="captive-ModuleList-add-builtin"></a>captive_ModuleList_add_builtin ()</h3><pre class="programlisting">gboolean captive_ModuleList_add_builtin (const gchar *FullName_utf8,
72 Adds simulated built-in module to ModuleListHead module list.
73 It can be used for the functionality of reactos/ntoskrnl/ldr/loader.c/LdrInitModuleManagement().
74 libcaptive does not support Ordinals - we just pretend liner (<tt>0</tt>-based)
75 Ordinal numbers of the functions in given @... stdargs order.</p><p>
77 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>FullName_utf8</tt></i> :</span></td><td> String to fill in PMODULE_OBJECT->FullName.
78 </td></tr><tr><td><span class="term"><i><tt>...</tt></i> :</span></td><td> (const gchar *sym_name,void *sym_val) symbol list terminated by <tt>NULL</tt>.
79 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt>TRUE</tt> if the module was successfuly added.
80 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="captive-ModuleList-patch"></a>captive_ModuleList_patch ()</h3><pre class="programlisting">gboolean captive_ModuleList_patch (const gchar *FullName_utf8,
82 Patches existing <i><tt>FullName_utf8</tt></i> module to use for function named sym_name
83 pointer to the handler sym_val. If patchpoint is not <tt>NULL</tt> it gets assigned the original
84 pointer value (used for <tt>pass</tt> keyword in exports.captivesym).
86 Put here 0xF4 'hlt' instead of 0xCC 'int $0x3; breakpoint'
87 as 'hlt' will generate handled SIGSEGV instead of SIGTRAP which
88 is used by gdb(1) during debugging.
89 See also libcaptive/ps/signal.c/ sigaction_SIGSEGV().</p><p>
91 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>FullName_utf8</tt></i> :</span></td><td> String to find PMODULE_OBJECT by FullName.
92 </td></tr><tr><td><span class="term"><i><tt>...</tt></i> :</span></td><td> (const gchar *sym_name,void (*sym_val)(void),struct captive_ModuleList_patchpoint *patchpoint) symbol list terminated by <tt>NULL</tt>.
93 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt>TRUE</tt> if the module was successfuly added.
94 </td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="captive-apiref-storage.html"><b><< storage</b></a></td><td align="right"><a accesskey="n" href="captive-apiref-calltype-reactos.html"><b>calltype_reactos >></b></a></td></tr></table></body></html>