<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:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></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="WordSection1">
<p class="MsoNormal">I want to expose the values of ‘NumMsiMsgGranted’ and ‘NumMsiMsgGranted’in the NVMe driver in the registry as read-only for validation purposes (by eyeball or by code I have which can go get any registry key asked).
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I thought just using <i>ZwCreateKey() </i>or <i>RtlWriteRegistryValue()</i> could serve my purpose. However, I see that registry entries like ‘Device Entries’ are defined in nvme.inf and then accessed by the
<i>NVMeFetchRegistry() </i>method. Since I assumed ‘NumMsiMsgGranted’ and ‘NumMsiMsgGranted’ would be set upon driver load, I thought
<i>NVMeFetchRegistry()</i> could write the values to new registry entries via:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> memcpy((PVOID)pBuf, (PVOID)(&pAE->ResMapTbl.NumMsiMsgGranted),<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;mso-highlight:white">sizeof</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white">(ULONG));<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> NVMeWriteRegistry(pAE, NUMMSIMSGGRANTED,
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> Type, pBuf,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;mso-highlight:white"> Len);</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">With those registry entries defined in the .inf file so they are already created:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#7030A0">HKR, Parameters\Device, NumMsiMsgGranted, %REG_DWORD%, 0x00000000 ; Number of MSI messages granted in system. RO entry.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#7030A0">HKR, Parameters\Device, NumActiveCores, %REG_DWORD%, 0x00000000 ; Number of active cores in system. This would be a RO entry.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, it does not seem to be the case as I still see 0’s.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is there a recommended way of creating registry values to expose NVMe variables for state-validating purposes?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
</div>
</body>
</html>