modperl branch collapsed back to MAIN trunk, man!
[www.jankratochvil.net.git] / project / captive / apiref / captive-apiref-mm.html
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>mm</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 {
4             background: #eeeeee;
5             border: solid 1px #aaaaaa;
6             padding: 0.5em;
7         }
8         .programlisting {
9             background: #eeeeff;
10             border: solid 1px #aaaaff;
11             padding: 0.5em;
12         }
13         .variablelist {
14             padding: 4px;
15             margin-left: 3em;
16         }
17         .navigation {
18             background: #ffeeee;
19             border: solid 1px #ffaaaa;
20             margin-top: 0.5em;
21             margin-bottom: 0.5em;
22         }
23         .navigation a {
24             color: #770000;
25         }
26         .navigation a:visited {
27             color: #550000;
28         }
29         .navigation .title {
30             font-size: 200%;
31         }
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-macros.html" title="macros"><link rel="next" href="captive-apiref-ps-reactos.html" title="ps_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-macros.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-ps-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-mm"></a><div class="titlepage"></div><div class="refnamediv"><h2>mm</h2><p>mm &#8212; </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
33
34
35
36 gint        <a href="captive-apiref-mm.html#captive-flProtect-to-mmap-prot">captive_flProtect_to_mmap_prot</a>  (ULONG flProtect);
37 gboolean    <a href="captive-apiref-mm.html#captive-mmap-map-new">captive_mmap_map_new</a>            (gconstpointer addr,
38                                              size_t len,
39                                              int mmap_prot);
40 gint        <a href="captive-apiref-mm.html#captive-mmap-map-get">captive_mmap_map_get</a>            (gconstpointer addr);
41 gboolean    <a href="captive-apiref-mm.html#captive-mmap-map-set">captive_mmap_map_set</a>            (gconstpointer addr,
42                                              int mmap_prot);
43 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
44
45 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="captive-flProtect-to-mmap-prot"></a>captive_flProtect_to_mmap_prot ()</h3><pre class="programlisting">gint        captive_flProtect_to_mmap_prot  (ULONG flProtect);</pre><p>
46 Map reactos flProtect to mprotect(2)-compatible &quot;prot&quot; argument.</p><p>
47
48 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>flProtect</tt></i> :</span></td><td> reactos compatible constant such as <tt>PAGE_READWRITE</tt>.
49 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> mmap(2) compatible <i><tt>prot</tt></i> argument.
50 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="captive-mmap-map-new"></a>captive_mmap_map_new ()</h3><pre class="programlisting">gboolean    captive_mmap_map_new            (gconstpointer addr,
51                                              size_t len,
52                                              int mmap_prot);</pre><p>
53 Initialize the protection map for the specified memory block.
54 Any existing protections in the specified block are forbidden.
55 </p><p>
56 This function does not do any mprotect(2) style, it just stores
57 the settings for the later <tt>OR</tt> operations by MmSetPageProtect().
58 Caller is responsibel to set the same protections as the given <i><tt>mmap_prot</tt></i>.</p><p>
59
60 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>addr</tt></i> :</span></td><td> <tt>PAGE_SIZE</tt> aligned address of memory block.
61 <tt>NULL</tt> value is forbidden.
62 </td></tr><tr><td><span class="term"><i><tt>len</tt></i> :</span></td><td> <tt>PAGE_SIZE</tt> aligned  length of memory block.
63 Value <tt>0</tt> is permitted. Value <tt>-1</tt> is forbidden.
64 </td></tr><tr><td><span class="term"><i><tt>mmap_prot</tt></i> :</span></td><td> Protections for the memory block as specified by <i><tt>prot</tt></i> of mprotect(2).
65 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt>TRUE</tt> if the protection storage was successful.
66 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="captive-mmap-map-get"></a>captive_mmap_map_get ()</h3><pre class="programlisting">gint        captive_mmap_map_get            (gconstpointer addr);</pre><p>
67 Query the protection settings at <i><tt>addr</tt></i> address.
68 The given <i><tt>addr</tt></i> block of <tt>PAGE_SIZE</tt> must be already initialized
69 by <a href="captive-apiref-mm.html#captive-mmap-map-new">captive_mmap_map_new</a>().</p><p>
70
71 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>addr</tt></i> :</span></td><td> <tt>PAGE_SIZE</tt> aligned address of memory block.
72 <tt>NULL</tt> value is forbidden.
73 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> Protections of the page as specified by <i><tt>prot</tt></i> of mprotect(2)
74 if successful. Value <tt>-1</tt> if failed.
75 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="captive-mmap-map-set"></a>captive_mmap_map_set ()</h3><pre class="programlisting">gboolean    captive_mmap_map_set            (gconstpointer addr,
76                                              int mmap_prot);</pre><p>
77 Set the protection settings at <i><tt>addr</tt></i> address.
78 The given <i><tt>addr</tt></i> block of <tt>PAGE_SIZE</tt> must be already initialized
79 by <a href="captive-apiref-mm.html#captive-mmap-map-new">captive_mmap_map_new</a>().</p><p>
80
81 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>addr</tt></i> :</span></td><td> <tt>PAGE_SIZE</tt> aligned address of memory block.
82 <tt>NULL</tt> value is forbidden.
83 </td></tr><tr><td><span class="term"><i><tt>mmap_prot</tt></i> :</span></td><td> Protections for the memory block as specified by <i><tt>prot</tt></i> of mprotect(2).
84 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt>TRUE</tt> if the protections were successfuly set.
85 </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-macros.html"><b>&lt;&lt; macros</b></a></td><td align="right"><a accesskey="n" href="captive-apiref-ps-reactos.html"><b>ps_reactos &gt;&gt;</b></a></td></tr></table></body></html>