Einzelnen Beitrag anzeigen

Angel4585

Registriert seit: 4. Okt 2005
Ort: i.d.N.v. Freiburg im Breisgau
2.199 Beiträge
 
Delphi 2010 Professional
 
#5

Re: Registry wird nur teilweise ausgelesen

  Alt 1. Sep 2009, 09:08
So mal die Hilfe bissl durchforstet(unter D2005, so verzweifelt bin ich schon )

Ich starte den prozess der die Registry auslesen soll mit CreateProcessAsUser. Damit das Profil geladen wird wird vorher noch LoadUserProfile aufgerufen. In der Hilfe steht dazu:

Zitat:
Upon successful return, the hProfile member of PROFILEINFO is a registry key handle opened to the root of the user's hive. It has been opened with full access (KEY_ALL_ACCESS). If a service that is impersonating a user needs to read or write to the user's registry file, use this handle instead of HKEY_CURRENT_USER. Do not close the hProfile handle. Instead, pass it to the UnloadUserProfile function. This function closes the handle. You should ensure that all handles to keys in the user's registry hive are closed. If you do not close all open registry handles, the user's profile fails to unload. For more information, see Registry Key Security and Access Rights and Registry Hives.
Die Registry lese ich bisher mit der TRegistry Klasse aus. Wenn ich den Text aus der Hilfe lese würde ich vermuten, dass ich wenn ich mit dem Handle arbeite anstatt dem Schlüssel, mehr sehen kann.
Aber wie benutze ich denn das Handle anstatt dem HKEY_CURRENT_USER?

Ich könnte dann nämlich vermutlich die Netzlaufwerke im Dienst wiederherstellen anstatt im Programm, oder?
Martin Weber
Ich bin ein Rüsselmops
  Mit Zitat antworten Zitat