| |
|
|
|
Description:
GetFileSecurity determined Information over The Sicherheitseinstellungen of/ one File (Security Descriptor) a in NTFS partitionierten Festplatte. These function there only NT-based Windowssystemen. for the Access to The Sicherheitseinstellungen must one on The File or whom Ordner READ_CONTROL Zugriffsrechte having or the proprietor his.
Deklaration:
DEF @GetFileSecurity(5) !ADVAPI32,GetFileSecurityA
Parameter:
1.Parameter: address one Strings or Memory-Variable with a String, the whom File- or Ordnernamen contains, to the one The Sicherheitsinformationen needed. 2.Parameter: ? Happen?, The indicate which Information one needed. differently ? Happen? can with | add go. => - $1 = determined Information over the proprietor the Folder or the File (OWNER_SECURITY_INFORMATION). - $2 = determined The primäre group (GROUP_SECURITY_INFORMATION). - $4 = determined Information over Zugriffsberechtigungen (DACL) of others Usern(DACL_SECURITY_INFORMATION) - $8 = determined Information above, which Zugriffe of system transcribed (SACL) go.(SACL_SECURITY_INFORMATION). for this grabbed becomes one aktives privilege SeSecurityPrivilege needed (Token). 3.Parameter: enough dimensionierte Memory-Variable, a SECURITY_DESCRIPTOR structure aufnimmt, The The angefragten Info contains. The contents this structure should not directly read go - for there further APIs. 4.Parameter: The Size the Memory-Variables from Parameter 3 in Bytes as LongInt. 5.Parameter: 4 byte large Memory-Variable, The The benötigte Size of Parameter 3 aufnimmt.
Return Value:
1 with success, 0 with Error.
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$=@CHOOSEDIR$("Ordner 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:9143fea2ea] Security Descriptor File File directory Ordner grabbed Zugriffe permit prohibit read detect prevent [/keywords:9143fea2ea] |
|
|
| |
|
|