<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
        {mso-style-priority:99;
        mso-style-link:"E-mail Signature Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-mailSignatureChar
        {mso-style-name:"E-mail Signature Char";
        mso-style-priority:99;
        mso-style-link:"E-mail Signature";
        font-family:"Times New Roman","serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>In testul pentru scriere si apoi citire vad se asteapta 2 page
fault-uri la scriere. Nu inteleg de ce? Eu am facut ca la citire sa setez <span
style='font-size:10.0pt;font-family:"Courier New";color:#060006'>PAGE_READONLY
si la scriere PAGE_READWRITE </span>intr-un singur PF si a mers bine pana am
rulat testul :P.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>static</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'>void</span> <span
style='color:#060006'>WriteRead</span> (<span style='color:#060006'>DWORD</span>
<span style='color:#060006'>pageId</span>, <span style='color:blue'>int</span> <span
style='color:#060006'>expected</span>, <span style='color:#060006'>DWORD</span>
<span style='color:#060006'>pageOffset</span>)<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>{<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>DWORD</span> <span style='color:#060006'>memoryValue</span>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:blue'>int</span> <span style='color:#060006'>expectedHandlerVar</span>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:green'>/* write - two faults */<o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>gpfHandlerVar</span> = 0;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>expectedHandlerVar</span> = (<span style='color:#060006'>expected</span>
== <span style='color:#060006'>PAGE_FAULT</span>) ? 2 : 0;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>memoryValue</span> = <span style='color:#060006'>pageId</span>
&lt;&lt; 16 | <span style='color:#060006'>pageOffset</span>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * (<span
style='color:#060006'>PDWORD</span>) ((<span style='color:#060006'>PBYTE</span>)
<span style='color:#060006'>baseAddress</span> + <span style='color:#060006'>pageId</span>
* <span style='color:#060006'>pageSize</span> + <span style='color:#060006'>pageOffset</span>)
= <span style='color:#060006'>memoryValue</span>;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:blue'>if</span> (<span style='color:#060006'>expected</span> != <span
style='color:#060006'>NO_CHECK</span>)<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>test</span> (<span style='color:#A31515'>&quot;Access_&quot;</span>,
<span style='color:#060006'>gpfHandlerVar</span> == <span style='color:#060006'>expectedHandlerVar</span>);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:green'>/* read - no faults */<o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>gpfHandlerVar</span> = 0;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>expectedHandlerVar</span> = 0;<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>memoryValue</span> = * (<span style='color:#060006'>PDWORD</span>)
((<span style='color:#060006'>PBYTE</span>) <span style='color:#060006'>baseAddress</span>
+ <span style='color:#060006'>pageId</span> * <span style='color:#060006'>pageSize</span>
+ <span style='color:#060006'>pageOffset</span>);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:blue'>if</span> (<span style='color:#060006'>expected</span> != <span
style='color:#060006'>NO_CHECK</span>)<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
style='color:#060006'>test</span> (<span style='color:#A31515'>&quot;Access&quot;</span>,
<span style='color:#060006'>gpfHandlerVar</span> == <span style='color:#060006'>expectedHandlerVar</span>);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>}</span>
<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoAutoSig><b><i>Dragan Stefan<o:p></o:p></i></b></p>

<p class=MsoAutoSig>0723060629<o:p></o:p></p>

<p class=MsoNormal><a href="http://ph0enix1810.lx.ro/">http://ph0enix1810.lx.ro</a><o:p></o:p></p>

<p class=MsoNormal><span style='font-size:8.0pt'>Desteapta-te romane!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:8.0pt'>Salveaza capra vecinului!<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>