| |
|
|
|
Description:
IsValidSecurityDescriptor erprüft a Security Descriptor (SECURITY_DESCRIPTOR structure) on its Gültigkeit. These function there only NT-based Windowssystemen.
Deklaration:
DEF @IsValidSecurityDescriptor(1) !ADVAPI32,IsValidSecurityDescriptor
Parameter:
1.Parameter: Memory-Variable with of/ one SECURITY_DESCRIPTOR structure or address of/ one SECURITY_DESCRIPTOR structure.
Return Value:
1 whom the Security Descriptor validly is, 0 otherwise.
Examples:
CompileMarkSeparationDEF @IsValidSecurityDescriptor(1) !"ADVAPI32","IsValidSecurityDescriptor"
DEF @GetFileSecurity(5) !"ADVAPI32","GetFileSecurityA"
DEF @GetLastError(0) !"KERNEL32","GetLastError"
DEF @SetLastError(1) !"KERNEL32","SetLastError"
Declare NEEDED#,SIDa#,Fehler&,NEEDED&,PSECURITY_DESCRIPTOR#
Declare FILENAME$
DIM Needed#,4
LET FILENAME$=@LOADFILE$("Datei wählen","*.*")
ADDSTRING "Security Descriptor von "+FILENAME$
Clear Needed#
LET Fehler&=@GetFileSecurity(@ADDR(Filename$),$1 | $2 | $4,0,0,Needed#)
ADDSTRING "Rückgabe von GetFileSecurity="+@STR$(Fehler&)
ADDSTRING "Letzter API-Fehler="+@STR$(@GetLastError())
LET NEEDED&=@LONG(Needed#,0)
ADDSTRING "Erforderliche Länge des Security Descriptor="+@STR$(Needed&)
CASE NEEDED&=0 : LET NEEDED&=1024
DIM PSECURITY_DESCRIPTOR#,Needed&
Clear PSECURITY_DESCRIPTOR#
@SetLastError(0)
LET Fehler&=@GetFileSecurity(@ADDR(Filename$),$1 | $2 | $4,PSECURITY_DESCRIPTOR#,NEEDED&,Needed#)
ADDSTRING "Rückgabe von GetFileSecurity="+@STR$(Fehler&)
ADDSTRING "Letzter API-Fehler="+@STR$(@GetLastError())
LET Fehler&=@IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR#)
ADDSTRING "Rückgabe von IsValidSecurityDescriptor="+@STR$(Fehler&)
ADDSTRING "Letzter API-Fehler="+@STR$(@GetLastError())
Dispose NEEDED#
Dispose PSECURITY_DESCRIPTOR#
@EDITBOX("Rückgaben",1pan class=s2>)
[keywords:3e5cd78005] validly Gültigkeit valide to check on Security Descriptor SECURITY_DESCRIPTOR [/keywords:3e5cd78005] |
|
|
| |
|
|