Export (0) Print
Expand All

DsQuoteRdnValue function

The DsQuoteRdnValue function converts an RDN into a quoted RDN value, if the RDN value contains characters that require quotes. The quoted RDN can then be submitted as part of a distinguished name (DN) to the directory service using various APIs such as LDAP. An example of an RDN that would require quotes would be one that has a comma-separated value, such as an RDN for a name that uses the format "last,first".

Syntax


DWORD DsQuoteRdnValue(
  _In_     DWORD cUnquotedRdnValueLength,
  _In_     LPCTCH psUnquotedRdnValue,
  _Inout_  DWORD *pcQuotedRdnValueLength,
  _Out_    LPTCH psQuotedRdnValue
);

Parameters

cUnquotedRdnValueLength [in]

The number of characters in the psUnquotedRdnValue string.

psUnquotedRdnValue [in]

The string that specifies the unquoted RDN value.

pcQuotedRdnValueLength [in, out]

The maximum number of characters in the psQuotedRdnValue string.

The following flags are the output for this parameter.

ValueMeaning
ERROR_SUCCESS

Indicates that the correct number of characters were found in psQuotedRdnValue.

OUT ERROR_BUFFER_OVERFLOW

Indicates that the number of characters in the string do not match psQuotedRdnValue.

 

psQuotedRdnValue [out]

The string that receives the converted, and perhaps quoted, RDN value.

Return value

The following list contains the possible values returned for the DsQuoteRdnValue function.

Return codeDescription
ERROR_SUCCESS

If quotes or escapes were required, then psQuotedRdnValue contains the quoted, escaped version of psUnquotedRdnValue. Otherwise, psQuotedRdnValue contains a copy of psUnquotedRdnValue. In either case, pcQuotedRdnValueLength contains the number of characters in the RDN string.

ERROR_BUFFER_OVERFLOW

Indicates that the psQuotedRdnValueLength parameter contains the space required, in characters, to hold the psQuotedRdnValue parameter.

ERROR_INVALID_PARAMETER

Indicates that there is an invalid parameter.

ERROR_NOT_ENOUGH_MEMORY

Indicates that there is an allocation error.

 

Remarks

Quotes are not added to the RDN if none are required. In this case, the output RDN value is the same as the input RDN value.

When quoting is required, the RDN is quoted in accordance with the specification "Lightweight Directory Access Protocol (v3): UTF-8 String Representation of Distinguished Names," RFC 2253.

The input and output RDN values are not NULL-terminated strings.

To revert changes made by this call, call the DsUnquoteRdnValue function.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Dsparse.h (include Ntdsapi.h)

Library

Ntdsapi.lib

DLL

Ntdsapi.dll

Unicode and ANSI names

DsQuoteRdnValueW (Unicode) and DsQuoteRdnValueA (ANSI)

See also

DsUnquoteRdnValue
Domain Controller and Replication Management Functions

 

 

Show:
© 2014 Microsoft