BinarySDToSecurityDescriptor function

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

Syntax


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

Parameters

pSecurityDescriptor [in]

Type: PSECURITY_DESCRIPTOR

Address of a SECURITY_DESCRIPTOR structure to convert.

pVarsec [out]

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 [in]

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 [in]

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 [in]

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 [in]

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:

S_OK

Operation was successful.

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Adshlp.h

Library

Activeds.lib

DLL

Activeds.dll

See also

IADsSecurityDescriptor
SECURITY_DESCRIPTOR
VariantClear
ADS_AUTHENTICATION_ENUM
IADsSecurityUtility
SecurityDescriptorToBinarySD
ADSI Error Codes
ADSI Functions

 

 

Show: