English
Regulars table & Café

GetFileSecurity.

 


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:

CompileMarkSeparation
DEF @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]
 
05/22/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.641 Views

Untitledvor 0 min.

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie