C# Class Microsoft.Win32.Security.SecurityDescriptor

Summary description for SecurityDescriptor.
Inheritance: DisposableObject
Mostrar archivo Open project: woanware/Win32Security Class Usage Examples

Private Properties

Property Type Description
AllocateAndInitializeSecurityDescriptor void
AreFlagsSet bool
CheckIsValid void
Clear void
SecurityDescriptor System
SecurityDescriptor System
UnsafeSetDacl void
UnsafeSetGroup void
UnsafeSetOwner void
UnsafeSetSacl void

Public Methods

Method Description
GetFileSecurity ( string fileName ) : SecurityDescriptor

Return the security descriptor of a given filename

GetFileSecurity ( string fileName, SECURITY_INFORMATION secInfo ) : SecurityDescriptor

Return the selected components of the security descriptor of a given filename

GetKernelObjectSecurity ( IntPtr handle ) : SecurityDescriptor
GetKernelObjectSecurity ( IntPtr handle, SECURITY_INFORMATION secInfo ) : SecurityDescriptor

Return the selected components of the security descriptor of a given kernel object handle

GetNamedSecurityInfo ( string objectName, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : SecurityDescriptor
GetRegistryKeySecurity ( IntPtr hKey, SECURITY_INFORMATION secInfo ) : SecurityDescriptor
GetSecurityInfo ( IntPtr handle, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : SecurityDescriptor
MakeAbsolute ( ) : void
MakeSeflRelative ( ) : void
SecurityDescriptor ( ) : System

Create an emtpy security descriptor

SetDacl ( Microsoft.Win32.Security.Dacl dacl ) : void
SetDacl ( Microsoft.Win32.Security.Dacl dacl, bool defaulted ) : void
SetFileSecurity ( string fileName, SECURITY_INFORMATION secInfo ) : void
SetGroup ( Microsoft.Win32.Security.Sid group ) : void
SetGroup ( Microsoft.Win32.Security.Sid group, bool defaulted ) : void
SetKernelObjectSecurity ( IntPtr handle, SECURITY_INFORMATION secInfo ) : void
SetNamedSecurityInfo ( string objectName, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : void
SetNullDacl ( bool defaulted ) : void
SetOwner ( Microsoft.Win32.Security.Sid owner ) : void
SetOwner ( Microsoft.Win32.Security.Sid owner, bool bDefaulted ) : void
SetRegistryKeySecurity ( IntPtr hKey, SECURITY_INFORMATION secInfo ) : void
SetSacl ( Microsoft.Win32.Security.Sacl sacl ) : void
SetSacl ( Microsoft.Win32.Security.Sacl sacl, bool defaulted ) : void
SetSecurityInfo ( IntPtr handle, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
AllocateAndInitializeSecurityDescriptor ( ) : void
AreFlagsSet ( ) : bool
CheckIsValid ( ) : void
Clear ( ) : void
SecurityDescriptor ( IntPtr secDesc ) : System

Internal: Create a security decriptor from a pointer to unmanged memory

SecurityDescriptor ( IntPtr secDesc, bool useLocalFree ) : System
UnsafeSetDacl ( SecurityDescriptor secDesc, Microsoft.Win32.Security.Dacl dacl, bool defaulted ) : void
UnsafeSetGroup ( SecurityDescriptor secDesc, Microsoft.Win32.Security.Sid group, bool defaulted ) : void
UnsafeSetOwner ( SecurityDescriptor secDesc, Microsoft.Win32.Security.Sid owner, bool defaulted ) : void
UnsafeSetSacl ( SecurityDescriptor secDesc, Microsoft.Win32.Security.Sacl sacl, bool defaulted ) : void

Method Details

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

GetFileSecurity() public static method

Return the security descriptor of a given filename
public static GetFileSecurity ( string fileName ) : SecurityDescriptor
fileName string The filename
return SecurityDescriptor

GetFileSecurity() public static method

Return the selected components of the security descriptor of a given filename
public static GetFileSecurity ( string fileName, SECURITY_INFORMATION secInfo ) : SecurityDescriptor
fileName string The filename
secInfo SECURITY_INFORMATION The components of the security descriptor to return
return SecurityDescriptor

GetKernelObjectSecurity() public static method

public static GetKernelObjectSecurity ( IntPtr handle ) : SecurityDescriptor
handle System.IntPtr
return SecurityDescriptor

GetKernelObjectSecurity() public static method

Return the selected components of the security descriptor of a given kernel object handle
public static GetKernelObjectSecurity ( IntPtr handle, SECURITY_INFORMATION secInfo ) : SecurityDescriptor
handle System.IntPtr
secInfo SECURITY_INFORMATION The components of the security descriptor to return
return SecurityDescriptor

GetNamedSecurityInfo() public static method

public static GetNamedSecurityInfo ( string objectName, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : SecurityDescriptor
objectName string
objectType SE_OBJECT_TYPE
securityInfo SECURITY_INFORMATION
return SecurityDescriptor

GetRegistryKeySecurity() public static method

public static GetRegistryKeySecurity ( IntPtr hKey, SECURITY_INFORMATION secInfo ) : SecurityDescriptor
hKey System.IntPtr
secInfo SECURITY_INFORMATION
return SecurityDescriptor

GetSecurityInfo() public static method

public static GetSecurityInfo ( IntPtr handle, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : SecurityDescriptor
handle System.IntPtr
objectType SE_OBJECT_TYPE
securityInfo SECURITY_INFORMATION
return SecurityDescriptor

MakeAbsolute() public method

public MakeAbsolute ( ) : void
return void

MakeSeflRelative() public method

public MakeSeflRelative ( ) : void
return void

SecurityDescriptor() public method

Create an emtpy security descriptor
public SecurityDescriptor ( ) : System
return System

SetDacl() public method

public SetDacl ( Microsoft.Win32.Security.Dacl dacl ) : void
dacl Microsoft.Win32.Security.Dacl
return void

SetDacl() public method

public SetDacl ( Microsoft.Win32.Security.Dacl dacl, bool defaulted ) : void
dacl Microsoft.Win32.Security.Dacl
defaulted bool
return void

SetFileSecurity() public method

public SetFileSecurity ( string fileName, SECURITY_INFORMATION secInfo ) : void
fileName string
secInfo SECURITY_INFORMATION
return void

SetGroup() public method

public SetGroup ( Microsoft.Win32.Security.Sid group ) : void
group Microsoft.Win32.Security.Sid
return void

SetGroup() public method

public SetGroup ( Microsoft.Win32.Security.Sid group, bool defaulted ) : void
group Microsoft.Win32.Security.Sid
defaulted bool
return void

SetKernelObjectSecurity() public method

public SetKernelObjectSecurity ( IntPtr handle, SECURITY_INFORMATION secInfo ) : void
handle System.IntPtr
secInfo SECURITY_INFORMATION
return void

SetNamedSecurityInfo() public method

public SetNamedSecurityInfo ( string objectName, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : void
objectName string
objectType SE_OBJECT_TYPE
securityInfo SECURITY_INFORMATION
return void

SetNullDacl() public method

public SetNullDacl ( bool defaulted ) : void
defaulted bool
return void

SetOwner() public method

public SetOwner ( Microsoft.Win32.Security.Sid owner ) : void
owner Microsoft.Win32.Security.Sid
return void

SetOwner() public method

public SetOwner ( Microsoft.Win32.Security.Sid owner, bool bDefaulted ) : void
owner Microsoft.Win32.Security.Sid
bDefaulted bool
return void

SetRegistryKeySecurity() public method

public SetRegistryKeySecurity ( IntPtr hKey, SECURITY_INFORMATION secInfo ) : void
hKey System.IntPtr
secInfo SECURITY_INFORMATION
return void

SetSacl() public method

public SetSacl ( Microsoft.Win32.Security.Sacl sacl ) : void
sacl Microsoft.Win32.Security.Sacl
return void

SetSacl() public method

public SetSacl ( Microsoft.Win32.Security.Sacl sacl, bool defaulted ) : void
sacl Microsoft.Win32.Security.Sacl
defaulted bool
return void

SetSecurityInfo() public method

public SetSecurityInfo ( IntPtr handle, SE_OBJECT_TYPE objectType, SECURITY_INFORMATION securityInfo ) : void
handle System.IntPtr
objectType SE_OBJECT_TYPE
securityInfo SECURITY_INFORMATION
return void