SecurityDescriptorToBinarySD

SecurityDescriptorToBinarySD function

The SecurityDescriptorToBinarySD function converts an IADsSecurityDescriptor object to the binary security descriptor format.

Syntax


HRESULT SecurityDescriptorToBinarySD(
  _In_  VARIANT              vVarSecDes,
  _Out_ PSECURITY_DESCRIPTOR *ppSecurityDescriptor,
  _Out_ PDWORD               pdwSDLength,
  _In_  LPCWSTR              pszServerName,
  _In_  LPCWSTR              userName,
  _In_  LPCWSTR              passWord,
  _In_  DWORD                dwFlags
);

Parameters

vVarSecDes [in]

Type: VARIANT

Contains a VARIANT that contains the security descriptor to convert. The VARIANT must contain a VT_DISPATCH that contains an IADsSecurityDescriptor object.

ppSecurityDescriptor [out]

Type: PSECURITY_DESCRIPTOR*

Address of a SECURITY_DESCRIPTOR pointer that receives the binary security descriptor data. The caller must free this memory by passing this pointer to the FreeADsMem function.

pdwSDLength [out]

Type: PDWORD

Address of a DWORD value that receives the length, in bytes of the binary security descriptor data.

pszServerName [in]

Type: LPCWSTR

A null-terminated Unicode string that specifies the name of the server where the security descriptor is placed. This parameter is optional and can be NULL.

userName [in]

Type: LPCWSTR

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

passWord [in]

Type: LPCWSTR

A null-terminated Unicode string that contains the password that the security descriptor is associated. 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 the standard return values, as well as the following.

S_OK

Operation succeeded.

Remarks

This function is used for legacy applications to manually convert security descriptors to binary security descriptors. For new applications, use IADsSecurityUtility, which performs 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
VARIANT
SECURITY_DESCRIPTOR
FreeADsMem
ADS_AUTHENTICATION_ENUM
BinarySDToSecurityDescriptor
ADSI Error Codes
ADSI Functions

 

 

Show:
© 2016 Microsoft