<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RegQueryValue Sample? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769845#M22022</link>
    <description>It's very late and I've spent the last many hours fighting with APIs again. Hopefully that is sufficient explaination for my incoherence........&lt;BR /&gt;&lt;BR /&gt;My first question is about APIs that retrieve the system and user name. The usage that works is&lt;BR /&gt;Call GetComputerName( Text, Loc(i) )&lt;BR /&gt;rather than as it appears in the CVF samples&lt;BR /&gt;Call GetComputerName( Text, i )&lt;BR /&gt;&lt;BR /&gt;Is this a bug, an erratum, or am I missing something fundamental?&lt;BR /&gt;&lt;BR /&gt;Since I have that working now, the more important question is about querying Registry Keys. I want to &lt;BR /&gt;retrieve the CPU make and speed, which is contained in HKey_Local_MachineHardwareDescriptionSystem
&lt;BR /&gt;CentralProcessor&amp;#0;ProcessorNameString.&lt;BR /&gt;&lt;BR /&gt;I open each subkey in turn with the Reg_Query_Value access. Each RegOpenKeyEX returns Error_Success. But I have fought for hours to get RegQueryKey or RegQueryKeyEx to work. &lt;BR /&gt;&lt;BR /&gt;Does anyone have a simple working example?&lt;BR /&gt;Thanks, and Good Night!&lt;P&gt;Message Edited by frieler on &lt;SPAN class="date_text"&gt;03-28-2004&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:38 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Mar 2004 16:15:56 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2004-03-28T16:15:56Z</dc:date>
    <item>
      <title>RegQueryValue Sample?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769845#M22022</link>
      <description>It's very late and I've spent the last many hours fighting with APIs again. Hopefully that is sufficient explaination for my incoherence........&lt;BR /&gt;&lt;BR /&gt;My first question is about APIs that retrieve the system and user name. The usage that works is&lt;BR /&gt;Call GetComputerName( Text, Loc(i) )&lt;BR /&gt;rather than as it appears in the CVF samples&lt;BR /&gt;Call GetComputerName( Text, i )&lt;BR /&gt;&lt;BR /&gt;Is this a bug, an erratum, or am I missing something fundamental?&lt;BR /&gt;&lt;BR /&gt;Since I have that working now, the more important question is about querying Registry Keys. I want to &lt;BR /&gt;retrieve the CPU make and speed, which is contained in HKey_Local_MachineHardwareDescriptionSystem
&lt;BR /&gt;CentralProcessor&amp;#0;ProcessorNameString.&lt;BR /&gt;&lt;BR /&gt;I open each subkey in turn with the Reg_Query_Value access. Each RegOpenKeyEX returns Error_Success. But I have fought for hours to get RegQueryKey or RegQueryKeyEx to work. &lt;BR /&gt;&lt;BR /&gt;Does anyone have a simple working example?&lt;BR /&gt;Thanks, and Good Night!&lt;P&gt;Message Edited by frieler on &lt;SPAN class="date_text"&gt;03-28-2004&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:38 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2004 16:15:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769845#M22022</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2004-03-28T16:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: RegQueryValue Sample?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769846#M22023</link>
      <description>As usual, a few hours sleep and a careful review of the problem over morning coffee........&lt;BR /&gt;&lt;BR /&gt;Here's what worked for me;&lt;BR /&gt;&lt;BR /&gt;Character   :: KeyName*64, SubKeyName*24&lt;BR /&gt;Integer (4) :: i, ilen, hKey&lt;BR /&gt;&lt;BR /&gt;KeyName="HardwareDescriptionSystemCentralProcessor&amp;#0;"//char(0)&lt;BR /&gt;SubKeyName = "ProcessorNameString"//char(0)&lt;BR /&gt;i = RegOpenKeyEx( HKey_Local_Machine, KeyName, 0, Key_Query_Value, Loc(hKey) )&lt;BR /&gt;ilen = 64&lt;BR /&gt;i = RegQueryValueEx( hKey, SubKeyName, 0, 0, Loc(Text), Loc(ilen) )&lt;BR /&gt;i = RegCloseKey( hKey )&lt;BR /&gt;&lt;BR /&gt;&amp;gt;9:34AM&lt;BR /&gt;But.....  This only seems to work if RegEdit has been invoked from the command line once since system boot (or login, I'm not sure which). This suggests that the "hive" is cached when RegEdit runs, and it is from this cache that the APIs gather data. Is there a way to fill this cache with another API call?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;10:02AM&lt;BR /&gt;My "Education" continues....&lt;BR /&gt;It now appears that the "cache" fill caused by RegEdit is volatile. After 20min or so, the code above again fails to work. Another command line use of RegEdit, and success immediately returns. &lt;BR /&gt;Any insight into this behavior?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;11:06AM&lt;BR /&gt;Some additional info.....&lt;BR /&gt;Some Keys (hives?) in the registry are indeed volatile, and are only built upon certain system events. Specifically, the one I'm interested is only built at boot up, when hardware discovery is initiated or when the RegEdit app is started.  I can start Regedit and then kill it immediately to cause this hive to be built, but it would be much more convenient to have an API call that did this. Some web info suggests RegQueryKeyEx, but I can't find that API anywhere in the CVF distribution. Does anyone know where it is hiding? Any other suggestions?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This still leaves my question about the sporadic use of value and pointer in the fortran interfaces, but maybe if I stare at that a while also.&lt;BR /&gt;&lt;BR /&gt;Thanks, Cliff&lt;P&gt;Message Edited by frieler on &lt;SPAN class="date_text"&gt;03-28-2004&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:10 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2004 23:41:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769846#M22023</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2004-03-28T23:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: RegQueryValue Sample?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769847#M22024</link>
      <description>&lt;DIV&gt;I can clear up some of the confusion.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Interfaces such as RegQueryValue for which the value argument can be "anything" were initially defined as an address-sized integer passed by value. Thus you needed the LOC() to pass the address of the value buffer.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Somewhere around CVF 6.5 (or maybe 6.1?) we added an IGNORE_LOC attribute which, when combined with REFERENCE, said "if the code has LOC() for this argument, ignore it and pass the argument by reference. We added this to many interfaces so that programming would be more natural. Some examples show the new way, some the old.&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 Mar 2004 03:04:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769847#M22024</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-03-29T03:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: RegQueryValue Sample?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769848#M22025</link>
      <description>Thanks, Steve.&lt;BR /&gt;I thought that might be the case, but I make enough bonehead assumptions and mistakes that I was deliberately diplomatic.&lt;BR /&gt;&lt;BR /&gt;I guess I still don't quite understand, though. If the changes to CVF were to make the interface tolerant of the presence or absence of Loc(), why is my specific example functional one way and not the other?&lt;BR /&gt;&lt;BR /&gt;Thanks again, Cliff</description>
      <pubDate>Mon, 29 Mar 2004 03:15:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769848#M22025</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2004-03-29T03:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: RegQueryValue Sample?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769849#M22026</link>
      <description>&lt;DIV&gt;I didn't look at your example specifically - just wanted to clear up the issue about "to LOC or not to LOC". Perhaps someone else can help with your particular issue.&lt;/DIV&gt;</description>
      <pubDate>Mon, 29 Mar 2004 10:45:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769849#M22026</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2004-03-29T10:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: RegQueryValue Sample?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769850#M22027</link>
      <description>&lt;P&gt;Cliff, to my knowledge no CVF's API translation has &lt;STRONG&gt;ever &lt;/STRONG&gt;translated LPDWORD (and similar, such as LPUINT) as integer &lt;STRONG&gt;by reference&lt;/STRONG&gt; (which would be natural) -- there has always been just integer (by value by implication from STDCALL). Thus, Steve's remarks about IGNORE_LOC and REFERENCE dont' apply. &lt;/P&gt;
&lt;P&gt;This translation choice/omission is IMO not fortunate, but at least it's consistent in its inconsistency. That means you have to use LOC() wherever APIs state LPDWORD for an argument. I'd guess that the CVF sample you refer to is simply mistaken.&lt;/P&gt;
&lt;P&gt;I didn't look much at your volatile registry hive problem; but I doubt the registry is the way to go -- getting low-level hardware information has always been tricky under Windows. Have you searched the newsgroups?&lt;/P&gt;
&lt;P&gt;Jugoslav&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2004 21:26:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/RegQueryValue-Sample/m-p/769850#M22027</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-03-29T21:26:01Z</dc:date>
    </item>
  </channel>
</rss>

