Directory Services

IADsSecurityUtility Property Methods

The property methods of the IADsSecurityUtility interface get or set the properties described in the following table. For more information, see Interface Property Methods.


Property Description

[Visual Basic]
Access: Read/Write
DataType: LONG

HRESULT get_SecurityMask
([out] LONG* fDaclDefaulted);
HRESULT put_SecurityMask
([in] LONG fDaclDefaulted);

This property sets the security mask for a security descriptor before GetSecurityDescriptor or SetSecurityDescriptor is called. The possible security descriptors are Owner, Group, DACL, or SACL, as defined in ADS_SECURITY_INFO_ENUM. If none is specified, it defaults to ADS_SECURITY_INFO_OWNER | ADS_SECURITY_INFO_DACL | GROUP_SECURITY_INFORMATION. The security mask can only be set for a file or registry key object, it cannot be set for a fileshare object. When the security mask is set, it will carry the mask on all subsequent operations. To reset it, you must set SecurityMask again.

Example Code [Visual Basic]

The following code example shows how to set the SACL and DACL of a security descriptor for the owner of a file.

Dim sdUtil as New ADsSecurityUtility
Dim sd as IADsSecurityDescriptor

On Error GoTo Cleanup 

Set sdUtil = CreateObject("ADsSecurityUtility")
Set sd = sdUtil.GetSecurityDescriptor("c:\specs\adsixml.doc", ADS_PATH_FILE, ADS_SD_FORMAT_IID )

	If (Err.Number<>0) Then
		MsgBox("An error has occurred. " & Err.Number)
	End If
	Set sdUtil = Nothing
	Set sd = Nothing


Client: Included in Windows XP.
Server: Included in Windows Server 2003.
Header: Declared in Iads.h.

See Also