IADsSecurityUtility::ConvertSecurityDescriptor method (iads.h)

The ConvertSecurityDescriptor method converts a security descriptor from one format to another.

Syntax

HRESULT ConvertSecurityDescriptor(
  [in]  VARIANT varSD,
  [in]  long    lDataFormat,
  [in]  long    lOutFormat,
  [out] VARIANT *pResult
);

Parameters

[in] varSD

A VARIANT that contains the security descriptor to convert. The format of this VARIANT is defined by the lDataFormat parameter.

[in] lDataFormat

Contains one of the ADS_SD_FORMAT_ENUM values which specifies the format of the security descriptor in the varSD parameter. The following list identifies the possible values for this parameter and the format of the varSD parameter.

ADS_SD_FORMAT_IID

varSD contains a VT_DISPATCH that can be queried for the IADsSecurityDescriptor interface.

ADS_SD_FORMAT_RAW

varSD contains a VT_I1 | VT_ARRAY that contains the security descriptor in raw data format. This is in the format of a SECURITY_DESCRIPTOR structure.

ADS_SD_FORMAT_HEXSTRING

varSD contains a VT_BSTR that contains the raw security descriptor in hex encode string format.

[in] lOutFormat

Contains one of the ADS_SD_FORMAT_ENUM values which specifies the format that the security descriptor should be converted to. The following list identifies the possible values for this parameter and the format of the pvResult parameter.

ADS_SD_FORMAT_IID

pvResult receives a VT_DISPATCH that can be queried for the IADsSecurityDescriptor interface.

ADS_SD_FORMAT_RAW

pvResult receives a VT_I1 | VT_ARRAY that contains the security descriptor in raw data format. This is in the format of a SECURITY_DESCRIPTOR structure.

ADS_SD_FORMAT_HEXSTRING

pvResult receives a VT_BSTR that contains the raw security descriptor in hex encode string format.

[out] pResult

Pointer to a VARIANT that receives the converted security descriptor. The format of the retrieved security descriptor is specified by the lOutFormat parameter.

Return value

Returns S_OK if successful or a COM or Win32 error code otherwise. Possible error codes include the following.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header iads.h
DLL Activeds.dll

See also

ADS_PATHTYPE_ENUM

ADS_SD_FORMAT_ENUM

IADsSecurityDescriptor

IADsSecurityUtility