Einzelnen Beitrag anzeigen

Benutzerbild von CoRe.eXtreem
CoRe.eXtreem

Registriert seit: 30. Nov 2003
61 Beiträge
 
Delphi 2005 Personal
 
#4

Re: RegGetKeySecurity

  Alt 7. Nov 2008, 10:29
Delphi-Quellcode:
    .data
   lpSubKey         db   "SOFTWARE\Classes\.7z\2",0
   phkResult          dd   0

    .data?
   pSecurityDescriptor      SECURITY_DESCRIPTOR <>

    .code
    
start:
   xor   eax,eax

   push   offset phkResult
   push   KEY_ALL_ACCESS
   push   0
   push   offset lpSubKey
   push   HKEY_LOCAL_MACHINE
   call   RegOpenKeyEx

   push   sizeof SECURITY_DESCRIPTOR      ;<-- Ich vermute der Fehler liegt hier
   push   offset pSecurityDescriptor
   push   DACL_SECURITY_INFORMATION
   push   offset phkResult
   call   RegGetKeySecurity

   push   phkResult
   call   RegCloseKey

   @_ExitProcess:
   push   0
   call   ExitProcess

end start
Der "SECURITY_DESCRIPTOR" gehört in die nicht initialisierte section. Jetzt ist nur noch die Frage wie ich diesen initialisiere vor der verwendung.

In der MSDN (http://msdn.microsoft.com/en-us/libr...61(VS.85).aspx) steht dazu folgendes,...

The SECURITY_DESCRIPTOR structure contains the security information associated with an object. Applications use this structure to set and query an object's security status.

Because the internal format of a security descriptor can vary, we recommend that applications not modify the SECURITY_DESCRIPTOR structure directly. For creating and manipulating a security descriptor, use the functions listed in the See Also section.


Vielleicht kann mir bei der initialisierung des SECURITY_DESCRIPTOR helfen.

Viele Grüße
  Mit Zitat antworten Zitat