BinarySDToSecurityDescriptor function

The BinarySDToSecurityDescriptor function converts a binary security descriptor to an IADsSecurityDescriptor object.

Syntax

HRESULT BinarySDToSecurityDescriptor(
  PSECURITY_DESCRIPTOR pSecurityDescriptor,
  VARIANT              *pVarsec,
  LPCWSTR              pszServerName,
  LPCWSTR              userName,
  LPCWSTR              passWord,
  DWORD                dwFlags
);

Parameters

pSecurityDescriptor

Type: PSECURITY_DESCRIPTOR

Address of a SECURITY_DESCRIPTOR structure to convert.

pVarsec

Type: VARIANT*

Address of a VARIANT that receives the object. The VARIANT contains a VT_DISPATCH object that can be queried for the IADsSecurityDescriptor interface. The caller must release this VARIANT by passing the VARIANT to the VariantClear function.

pszServerName

Type: LPCWSTR

A null-terminated Unicode string that provides the name of the server that the security descriptor was retrieved from. This parameter is optional and can be NULL.

userName

Type: LPCWSTR

A null-terminated Unicode string that provides the user name to be associated with the security descriptor. This parameter is optional and can be NULL.

passWord

Type: LPCWSTR

A null-terminated Unicode string that provides the password to be associated with the security descriptor. This parameter is optional and can be NULL.

dwFlags

Type: DWORD

Contains authentication flags for the conversion. This can be zero or a combination of one or more of the ADS_AUTHENTICATION_ENUM enumeration values.

Return Value

Type: HRESULT

This method supports standard return values, as well as the following:

If the operation fails, an ADSI error code is returned. For more information, see ADSI Error Codes.

Remarks

This function is used for legacy applications that must manually convert security descriptors to binary security descriptors. For new applications, use the IADsSecurityUtility interface, which does this conversion automatically.

Requirements

   
Windows version Windows Vista Windows Server 2008
Target Platform Windows
Header adshlp.h
Library Activeds.lib
DLL Activeds.dll

See Also

ADSI Error Codes

ADSI Functions

ADS_AUTHENTICATION_ENUM

IADsSecurityDescriptor

IADsSecurityUtility

SECURITY_DESCRIPTOR

SecurityDescriptorToBinarySD

VariantClear