Location: Symbol Reference > Classes > TJwSecurityDescriptor Class
JWSCL Documentation
ContentsIndexHome
TJwSecurityDescriptor Methods
TJwSecurityDescriptor Methods
 
Name 
Description 
 
Assign copies all properties from another SD. It creates new instances of (if not nil) Owner, PrimaryGroup DACL and AuditACL will be cleared and filled with the ACL of the SD aObject. All the aces in the DACL and SACL structures are copied into new instances. The DACL can also be nil if the DACL is a NULL DACL (allows everyone access)
 
 
Create_SA creates a Security Attributes structure and initialises it with the security descriptor of this instance. The SA structure must be freed by Free_SA. The internal SD structure is automatically freed.
This method uses GetMem.
You can set Control or RMControl to modify the resulting control value of the security descriptor block. The values SE_DACL_PRESENT and SE_SACL_PRESENT are always automatically set. SE_RELATIVE is set, if parameter bRelative is true. SE_SACL_PRESENT will be set if property SACL/AuditACL is not nil.
 
 
Create_SA2 does the same as Create_SA, but uses the property InheritHandles to initialize the result.
See Create_SA for more information. 
 
Create_SAEx creates a security attributes structure on the stack. However the internal security descriptor will be created on heap.
The SA structure must be freed by Free_SAEx. The internal SD structure is automatically freed.
You can set Control or RMControl to modify the resulting control value of the security descriptor block. The values SE_DACL_PRESENT and SE_SACL_PRESENT are always automatically set. SE_RELATIVE is set, if parameter bRelative is true. SE_SACL_PRESENT will be set if property SACL/AuditACL is not nil.
 
 
Create_SAEx2 does the same as Create_SAEx, but uses the property InheritHandles to initialize the result.
See Create_SAEx for more information. 
 
This is the overview for the Create_SD method overload. 
 
Free_SA frees a security attribute created by Create_SA.
This method uses FreeMem, so do not use this function with security attributes structure that was created using LocalAlloc, GlobalAlloc or other incompatible functions.
 
 
Free_SAEx frees a security attribute created by Create_SAEx.
This method uses FreeMem, so do not use this function with security attributes structure that was created using LocalAlloc, GlobalAlloc or other incompatible functions.
 
 
Free_SD frees an security descriptor that was allocated by Create_SD. Only use a SD that was created by Create_SD. Free_SD uses FreeMem and TJwSecurityAccessControlList.Free_PACL to free memory. For unknown reasons some winapi calls fails if the the applied memory was allocated with GetMem.
Free_SD does not raise a SM exception. However there can be exception because of pointer problems. Do not edit the memory block manually or even free sub structures (as owner, dacl...)
 
 
This is GetPrivateObjectSecurity, a member of class TJwSecurityDescriptor. 
 
This is the overview for the GetSecurityDescriptorString method overload. 
 
This is GetTextMap, a member of class TJwSecurityDescriptor. 
 
hashCode creates a value out of a buffer with a given size. This pseudo hash function is not intended for production uses and should be replaced by a custom method using property OnHashCodeMethod
 
This is IsEqual, a member of class TJwSecurityDescriptor. 
 
LoadFromStream loads a security descriptor from a stream.
The stream position must be on the first value of the magic header. (see SaveToStream ). If the following values are true the hash value will be checked and an exception EJwsclStreamHashException will be raised if the read hash is not equal to the calculated one. Assigned(OnHashCodeMethod) and (ReadHash > 0) and (CalculatedHash > 0) and (iCHash <> iRHash) A hash comparison will only be done if the hashes are greater than zero.
raises EJwsclStreamHashException will be raised if the hash ist not valid. raises EJwsclInvalidSecurityDescriptor will be raised if... more 
 
ReplaceDescriptorElements replaces the security descriptor elements given in SecurityInformationSet with the ones in SecurityDescriptor.  
 
This is ReplaceOwner, a member of class TJwSecurityDescriptor. 
 
SaveToStream writes a relative security descriptor into a stream. The method uses a magic header to check for position errors in a stream.
  • Bytes | Value
  • 1..5 (5) | SD_MAGIC_HEADER (byte array)
  • 6..9 (4) | SD size (Cardinal)
  • 10..17 (8) | hash value (Int64)
  • 18..18 (1) | hash value in use (byte) true if 255 otherwise false. == SD_HEADER_SIZE
  • 19..sd (size) | security descriptor data
 
 
SetPrivateObjectSecurity combines a parent and a creator security descriptor into a new security descriptor. For detailed information see MSDN http://msdn2.microsoft.com/en-us/library/aa379581.aspx
If parameter Token is not nil and SecurityInformation contains siSaclSecurityInformation you must explicit activate SE_SECURITY_NAME privilege.
 
Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.