<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[RegQueryValue]]></title><description><![CDATA[<p>Hallo!</p>
<p>hab ja schon länger nichts mehr gepostet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> .</p>
<p>Ich habe ein Problem mit RegQueryValue().</p>
<p>Wieso muss der Typ bei lpdata denn unsigned char * sein?</p>
<p>Hab hier auch mal den Source falls es an etwas anderem liegen sollte.</p>
<pre><code class="language-cpp">int enumvalues(HKEY subkey)

{
char kA[255];

unsigned long int valueindex=0;
unsigned long int valuesize=sizeof(kA);
unsigned long int type[30];

char byte[200];
char SZ[250];
LPDWORD dword;

unsigned long int bytesize=sizeof(byte);
long int SZsize=sizeof(SZ);
unsigned long int dwordsize=sizeof(dword);

for (;valueindex&lt;values;valueindex++)
{
RegEnumValue(subkey,valueindex,kA,&amp;valuesize,NULL,&amp;type[valueindex],NULL,NULL);

printf(&quot;%s&quot;,kA);

if(type[valueindex]==REG_BINARY)  //type-array
{
printf(&quot; binaray &quot;);

path[i],value[valueindex],RRF_RT_REG_BINARY,NULL,&amp;byte,&amp;bytesize);
printf(&quot;%x&quot;,byte);
}
if(type[valueindex]==REG_SZ)
{
printf(&quot; string\n&quot;);
RegQueryValue(rootkey[parameter], path[i],value[valueindex],&amp;SZsize);
printf(&quot;%s&quot;, SZ);
}
if(type[valueindex]==REG_DWORD)
{
printf(&quot; Zahl &quot;);

RegQueryValueEx(subkey,value[valueindex],NULL,NULL,(unsigned char *)dword,&amp;dwordsize);

path[i],value[valueindex],RRF_RT_REG_DWORD,NULL,&amp;dword,&amp;dwordsize);
printf(&quot;%i\n&quot;,dword);
}

valuesize=sizeof(kA);
//printf(&quot;%s\n&quot;,kA);

}
</code></pre>
<p>das is ne Unterdunktionen die, wie der Name schon sagt, alle values , deren Typen und deren Inhalt auslesen und anzeigen soll.</p>
<p>Ich hoffe ihr könnt mir helfen.</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/176108/regqueryvalue</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 19:37:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/176108.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Mar 2007 17:15:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RegQueryValue on Sat, 17 Mar 2007 17:15:13 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>hab ja schon länger nichts mehr gepostet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> .</p>
<p>Ich habe ein Problem mit RegQueryValue().</p>
<p>Wieso muss der Typ bei lpdata denn unsigned char * sein?</p>
<p>Hab hier auch mal den Source falls es an etwas anderem liegen sollte.</p>
<pre><code class="language-cpp">int enumvalues(HKEY subkey)

{
char kA[255];

unsigned long int valueindex=0;
unsigned long int valuesize=sizeof(kA);
unsigned long int type[30];

char byte[200];
char SZ[250];
LPDWORD dword;

unsigned long int bytesize=sizeof(byte);
long int SZsize=sizeof(SZ);
unsigned long int dwordsize=sizeof(dword);

for (;valueindex&lt;values;valueindex++)
{
RegEnumValue(subkey,valueindex,kA,&amp;valuesize,NULL,&amp;type[valueindex],NULL,NULL);

printf(&quot;%s&quot;,kA);

if(type[valueindex]==REG_BINARY)  //type-array
{
printf(&quot; binaray &quot;);

path[i],value[valueindex],RRF_RT_REG_BINARY,NULL,&amp;byte,&amp;bytesize);
printf(&quot;%x&quot;,byte);
}
if(type[valueindex]==REG_SZ)
{
printf(&quot; string\n&quot;);
RegQueryValue(rootkey[parameter], path[i],value[valueindex],&amp;SZsize);
printf(&quot;%s&quot;, SZ);
}
if(type[valueindex]==REG_DWORD)
{
printf(&quot; Zahl &quot;);

RegQueryValueEx(subkey,value[valueindex],NULL,NULL,(unsigned char *)dword,&amp;dwordsize);

path[i],value[valueindex],RRF_RT_REG_DWORD,NULL,&amp;dword,&amp;dwordsize);
printf(&quot;%i\n&quot;,dword);
}

valuesize=sizeof(kA);
//printf(&quot;%s\n&quot;,kA);

}
</code></pre>
<p>das is ne Unterdunktionen die, wie der Name schon sagt, alle values , deren Typen und deren Inhalt auslesen und anzeigen soll.</p>
<p>Ich hoffe ihr könnt mir helfen.</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247378</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247378</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Sat, 17 Mar 2007 17:15:13 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sat, 17 Mar 2007 19:12:20 GMT]]></title><description><![CDATA[<p>echt keiner der mir helfen kann?</p>
<p>konkretes Problem:</p>
<p>Ich würde gern dwords einlesen/speichern aber der Typ is char.</p>
<p>einfach (unsigned char <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title="*)"
      alt="😉"
    /> vor dword (Variable) schreiben?</p>
<p>Ausserdem krieg ich bei allen values die selbe Zahl raus.</p>
<p>Hoffe ihr könnt mir helfen.</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247436</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Sat, 17 Mar 2007 19:12:20 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sat, 17 Mar 2007 21:56:21 GMT]]></title><description><![CDATA[<p>muhi schrieb:</p>
<blockquote>
<p>Ich würde gern dwords einlesen/speichern aber der Typ is char.</p>
</blockquote>
<p>Einfach casten :</p>
<pre><code class="language-cpp">// &quot;LPBYTE&quot; == &quot;BYTE *&quot; == &quot;unsigned char *&quot;
DWORD dword;

RegQueryValueEx(...,(LPBYTE) &amp;dword,...);
RegQueryValueEx(...,(BYTE *) &amp;dword,...);
RegQueryValueEx(...,(unsigned char *) &amp;dword,...);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1247510</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247510</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 17 Mar 2007 21:56:21 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 01:15:05 GMT]]></title><description><![CDATA[<p>Hallo, danke, wie ihr an meinem Source seht, habe ich eh gecastet.</p>
<p>Problem:</p>
<p>Es wird nichts in dword gespeichert obwohl imo alles passt.</p>
<p>Seht ihr den Fehler??</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247553</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Sun, 18 Mar 2007 01:15:05 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 01:27:57 GMT]]></title><description><![CDATA[<p>Ich sehe auch keinen. Prüf mal Rückgabewert von RegQueryValueEx()!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247554</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 18 Mar 2007 01:27:57 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 02:06:41 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>hat 2 als Rückgabewert</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247561</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Sun, 18 Mar 2007 02:06:41 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 02:59:37 GMT]]></title><description><![CDATA[<p>Hmm, &quot;Datei nicht gefunden&quot;?<br />
Wo setzt du die Variable &quot;values&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247567</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247567</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 18 Mar 2007 02:59:37 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 03:05:51 GMT]]></title><description><![CDATA[<p>wie meinst du?</p>
<p>Übrigens cool, dass du um die Zeit noch zurückschreibst <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247568</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247568</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Sun, 18 Mar 2007 03:05:51 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 03:31:21 GMT]]></title><description><![CDATA[<p>muhi schrieb:</p>
<blockquote>
<pre><code class="language-cpp">// [..]
for (;valueindex&lt;values;valueindex++)
{
RegEnumValue(subkey,valueindex,kA,&amp;valuesize,NULL,&amp;type[valueindex],NULL,NULL);
// [..]
</code></pre>
</blockquote>
<p>In der for-Schleife das &quot;values&quot; meine ich?<br />
Normalerweise ruft man ja einfach RegEnumValue() solange auf bis es nen Fehler meldet bzw. ERROR_NO_MORE_ITEMS zurückgibt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247574</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 18 Mar 2007 03:31:21 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 03:35:38 GMT]]></title><description><![CDATA[<p>das hab ich aus RegQueryInfoKey();</p>
<p>die Anzahl der Values eines Keys</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247576</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Sun, 18 Mar 2007 03:35:38 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 14:59:24 GMT]]></title><description><![CDATA[<p>Gibts da viell noch ne andere Fehlerquelle?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247762</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247762</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Sun, 18 Mar 2007 14:59:24 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 15:03:46 GMT]]></title><description><![CDATA[<p>Hmm, mir fällt da auch nix mehr ein ;/</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1247769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1247769</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 18 Mar 2007 15:03:46 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 21:11:10 GMT]]></title><description><![CDATA[<p>Schade, weil dann kann ich ned weitermachen und ich bin eig nimmer weit entfernt den Regeditor fertigzustellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248013</guid><dc:creator><![CDATA[Muhi89]]></dc:creator><pubDate>Sun, 18 Mar 2007 21:11:10 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Sun, 18 Mar 2007 21:23:16 GMT]]></title><description><![CDATA[<p>Soll ich jetzt viell SHRegQueryValueEx() verwenden?</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248032</guid><dc:creator><![CDATA[Muhi89]]></dc:creator><pubDate>Sun, 18 Mar 2007 21:23:16 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Mon, 19 Mar 2007 12:57:41 GMT]]></title><description><![CDATA[<p>Hmmm weiss ned wo da der Unterschied ist</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248349</guid><dc:creator><![CDATA[dontknow?]]></dc:creator><pubDate>Mon, 19 Mar 2007 12:57:41 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Mon, 19 Mar 2007 13:11:17 GMT]]></title><description><![CDATA[<p>Hast Du Dein Source geändert wie &quot;merker&quot; gezeigt hat???<br />
Merke: LPDWORD != DWORD!</p>
<p>Und Du musst ein DWORD definieren und kein LPDWORD!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1248359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1248359</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 19 Mar 2007 13:11:17 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Tue, 20 Mar 2007 13:17:37 GMT]]></title><description><![CDATA[<p>Ja hab ich, es bringt leider nichts.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1249096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1249096</guid><dc:creator><![CDATA[Muhi89]]></dc:creator><pubDate>Tue, 20 Mar 2007 13:17:37 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Fri, 23 Mar 2007 13:30:51 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich denke der Fehler liegt in der Generierung des Regkeys.</p>
<p>Hab dauernd Probleme mit den verdammten Strings.</p>
<p>Hier mal der gesamte Source:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;winreg.h&gt;
#include &lt;stdio.h&gt;

int enumsubkeys(HKEY key);
int enumvalues(HKEY subkey);

extern SOCKET sendsock;
extern SOCKADDR_IN address;

int parameter=0;

unsigned long int subkeys=0;
unsigned long int values=0;
unsigned long int size=200;

unsigned long int index=0;

char string [30] [200];
char path [30] [200];
unsigned long int buffersize=200;

unsigned long int i;

unsigned long int subvalues;

unsigned long int zaehler=0;

int rc=0;
int k=0;

char singlestring[200]=&quot;&quot;;
char doubleslash[2]=&quot;\\&quot;;

int nummer;
int rc;

HKEY rootkey[4];

int regeditor(void)

{

HKEY hkey;
HKEY newkey[20];

rootkey[0]=HKEY_USERS;
rootkey[1]=HKEY_CURRENT_USER;
rootkey[2]=HKEY_LOCAL_MACHINE;
rootkey[3]=HKEY_USERS;
rootkey[4]=HKEY_PERFORMANCE_DATA;

i=0;

hkey=rootkey[parameter];

strcpy(path[0],singlestring);

do 
{

RegQueryInfoKey(hkey,NULL,NULL,NULL,&amp;subkeys, NULL,
		                NULL,&amp;values,NULL,NULL,NULL,NULL);

if(subkeys!=0)
{
rc=enumsubkeys(hkey); 
}
else
{

  if (values!=0)

    {
     enumvalues(hkey);  

    }

}

scanf(&quot;%i&quot;,&amp;nummer);

if(i==0)
{
strcpy(path[i],string[nummer]);
}

else
{
strcpy(path[i], path[i-1]);
lstrcat(path[i],doubleslash);
lstrcat(path[i],string[nummer]);
}

memset(string,0,sizeof(string));

rc=RegOpenKeyEx(hkey,path[i],0,KEY_ALL_ACCESS,&amp;newkey[k]); 

i=i+1;

hkey=newkey[k];

k=k+1;

}while(1);

return 0;
}

int enumsubkeys(HKEY key)

{

for (zaehler=0,index=0;zaehler&lt;=(subkeys);index++,zaehler++)

{
RegEnumKey(key,index,string[zaehler],buffersize);
printf(&quot;%s\n&quot;,string[zaehler]);
Sleep(90);
}

return 0;
}

int enumvalues(HKEY subkey)

{
char kA[255];

unsigned long int valueindex=0;
unsigned long int valuesize=sizeof(kA);
unsigned long int type[30];

char byte[200];
char SZ[250];
unsigned char dword=0;
unsigned char euda=0;

unsigned long int bytesize=sizeof(byte);
unsigned long int SZsize=sizeof(SZ);
unsigned long int dwordsize=sizeof(euda);

char value[20][255];

int rc;

for (;valueindex&lt;values;valueindex++)
{
RegEnumValue(subkey,valueindex,kA,&amp;valuesize,NULL,&amp;type[valueindex],NULL,NULL);

printf(&quot;%s&quot;,kA);

if(type[valueindex]==REG_BINARY)  //type-array
{
printf(&quot; binaray &quot;);

printf(&quot;%x&quot;,byte);
}
if(type[valueindex]==REG_SZ)
{
printf(&quot; string &quot;);

printf(&quot;%s&quot;, SZ);
}
if(type[valueindex]==REG_DWORD)
{
printf(&quot; Zahl &quot;);

rc=RegQueryValueEx(subkey,value[valueindex],NULL,NULL,&amp;dword,&amp;dwordsize);

printf(&quot;%i&quot;,rc);

printf(&quot;%i\n&quot;,dword);
}

valuesize=sizeof(kA);

}

return 0;
}

int main()

{

regeditor();

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1251140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1251140</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Fri, 23 Mar 2007 13:30:51 GMT</pubDate></item><item><title><![CDATA[Reply to RegQueryValue on Fri, 23 Mar 2007 19:18:00 GMT]]></title><description><![CDATA[<p>Bitte helft mir ich hab da echt Probleme.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1251356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1251356</guid><dc:creator><![CDATA[muhi]]></dc:creator><pubDate>Fri, 23 Mar 2007 19:18:00 GMT</pubDate></item></channel></rss>