<?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[Registry abspeichern?]]></title><description><![CDATA[<p>Hi,</p>
<p>die Registry ist ja nichts anderes als eine riesige ini-Datei. Gibt es irgendwie Funktionen wie ich die Registry <strong>ganz</strong> in eine ini-Datei schreiben kann?</p>
<p>Ich dachte da an so GetPrivateProfileXXX und so. Jedoch da muss ich ja die Namen der einzelnen Schlüssel und so kennen, aber ich kenn ja nicht alle.</p>
<p>Gibt es da irgendwie Funktionen von der WinAPI oder aus der COM-Gegend? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/130609/registry-abspeichern</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 15:53:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/130609.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Dec 2005 12:29:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Registry abspeichern? on Sun, 25 Dec 2005 12:29:32 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>die Registry ist ja nichts anderes als eine riesige ini-Datei. Gibt es irgendwie Funktionen wie ich die Registry <strong>ganz</strong> in eine ini-Datei schreiben kann?</p>
<p>Ich dachte da an so GetPrivateProfileXXX und so. Jedoch da muss ich ja die Namen der einzelnen Schlüssel und so kennen, aber ich kenn ja nicht alle.</p>
<p>Gibt es da irgendwie Funktionen von der WinAPI oder aus der COM-Gegend? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/949496</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949496</guid><dc:creator><![CDATA[&#x27;#&#x27;]]></dc:creator><pubDate>Sun, 25 Dec 2005 12:29:32 GMT</pubDate></item><item><title><![CDATA[Reply to Registry abspeichern? on Sun, 25 Dec 2005 12:38:08 GMT]]></title><description><![CDATA[<p>Es gibt ja nur nen paar Hauptkategorien, welche du über entsprechende Makros in der Winapi öffnen kannst, alle darin enthaltenen Unterkategorien und Schlüssel kannst du dann auslesen und die Stück für Stück in ner ini speichern, wobei ne ini vom Aufbau her nicht wirklich zur Registry passt.<br />
Würde das ganze in nem Baum speichern und den anschließend speichern (zb xml).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/949507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949507</guid><dc:creator><![CDATA[User---]]></dc:creator><pubDate>Sun, 25 Dec 2005 12:38:08 GMT</pubDate></item><item><title><![CDATA[Reply to Registry abspeichern? on Sun, 25 Dec 2005 12:58:22 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich hab das jetzt mal anhand der Forensuche versucht und mit hilfe der MSDN, rausgekommen ist dies hier:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt; 
#include &lt;windows.h&gt; 

HRESULT ModifyPrivilege(
    IN LPCTSTR szPrivilege,
    IN BOOL fEnable)
{
    HRESULT hr = S_OK;
    TOKEN_PRIVILEGES NewState;
    LUID             luid;
    HANDLE hToken    = NULL;

    // Open the process token for this process.
    if (!OpenProcessToken(GetCurrentProcess(),
                          TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
                          &amp;hToken ))
    {
        printf(&quot;Failed OpenProcessToken\n&quot;);
        return ERROR_FUNCTION_FAILED;
    }

    // Get the local unique ID for the privilege.
    if ( !LookupPrivilegeValue( NULL,
                                szPrivilege,
                                &amp;luid ))
    {
        CloseHandle( hToken );
        printf(&quot;Failed LookupPrivilegeValue\n&quot;);
        return ERROR_FUNCTION_FAILED;
    }

    // Assign values to the TOKEN_PRIVILEGE structure.
    NewState.PrivilegeCount = 1;
    NewState.Privileges[0].Luid = luid;
    NewState.Privileges[0].Attributes = 
              (fEnable ? SE_PRIVILEGE_ENABLED : 0);

    // Adjust the token privilege.
    if (!AdjustTokenPrivileges(hToken,
                               FALSE,
                               &amp;NewState,
                               0,
                               NULL,
                               NULL))
    {
        printf(&quot;Failed AdjustTokenPrivileges\n&quot;);
        hr = ERROR_FUNCTION_FAILED;
    }

    // Close the handle.
    CloseHandle(hToken);

    return hr;
}

int main ()
{
    HKEY hkey;

    if (FAILED(ModifyPrivilege(SE_BACKUP_NAME, TRUE)))
        std::cout &lt;&lt; &quot;Fehler: ModifyPrivilege - &quot; &lt;&lt; ::GetLastError () &lt;&lt; std::endl;

    if (FAILED(RegOpenKeyExA(HKEY_LOCAL_MACHINE, &quot;Software\\Microsoft\\&quot;,0, KEY_ALL_ACCESS, &amp;hkey)))
        std::cout &lt;&lt; &quot;Fehler: RegOpenKeyExA - &quot; &lt;&lt; ::GetLastError () &lt;&lt; std::endl;

    if (FAILED(RegSaveKeyExA(hkey, &quot;g:\\backupreg.reg&quot;, NULL,REG_NO_COMPRESSION )))
        std::cout &lt;&lt; &quot;Fehler: RegSaveKeyExA - &quot; &lt;&lt; ::GetLastError () &lt;&lt; std::endl;

    std::cin.get ();

    return 0;
}
</code></pre>
<p>Die Datei wird ordnungsgemäß erstellt, doch der inhalt ist nicht vorhanden <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/949514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949514</guid><dc:creator><![CDATA[&#x27;#&#x27;]]></dc:creator><pubDate>Sun, 25 Dec 2005 12:58:22 GMT</pubDate></item><item><title><![CDATA[Reply to Registry abspeichern? on Mon, 26 Dec 2005 21:31:49 GMT]]></title><description><![CDATA[<p>*push* weiß denn keiner Rat? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/950445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/950445</guid><dc:creator><![CDATA[&#x27;#&#x27;]]></dc:creator><pubDate>Mon, 26 Dec 2005 21:31:49 GMT</pubDate></item><item><title><![CDATA[Reply to Registry abspeichern? on Mon, 26 Dec 2005 21:34:20 GMT]]></title><description><![CDATA[<p>Warum prüfst du den Rückgabewert von RegOpenKeyExA mit dem FAILED-Makro?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/950449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/950449</guid><dc:creator><![CDATA[LOL!]]></dc:creator><pubDate>Mon, 26 Dec 2005 21:34:20 GMT</pubDate></item><item><title><![CDATA[Reply to Registry abspeichern? on Mon, 26 Dec 2005 21:44:09 GMT]]></title><description><![CDATA[<p>Ich denke Du solltest noch das Format korrekt angeben... Du gibst nur an, dass Du keine Kompression willst... also:<br />
REG_STANDARD_FORMAT | REG_NO_COMPRESSION</p>
<p>Aber beachte: Das resultierende File ist binär. Es ist z.Z. nicht möglich so eine Text-Datei wie mit dem regedit zu erstellen. Dies ist in regedit eingebaut und ist nicht exportiert. Somit musst Du vermutlich doch alle Schlüssel von Hand durchgehen...</p>
<p>Und nebenbei bemerkt: Die Registry kann man nicht mit einer INI oder Text-Datei vergleichen, da hier auch neben den eigentichen Werten noch Zugriffsrechte / Owner / usw. gespeichert werden...</p>
<p>Was hast Du denn eigentlich vor?</p>
<p>Und nochmals nebenbei: Mit x64 wird alles noch schlimmer: Da gibt es Keys die es gar nicht gibt....</p>
<p>RegEnumKeyEx should return all keys, shouldn´t it?<br />
<a href="http://blog.kalmbachnet.de/?postid=41" rel="nofollow">http://blog.kalmbachnet.de/?postid=41</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/950455</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/950455</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 26 Dec 2005 21:44:09 GMT</pubDate></item></channel></rss>