TranslateNameA function

Converts a directory service object name from one format to another.

Syntax

BOOLEAN SEC_ENTRY TranslateNameA(
  LPCSTR               lpAccountName,
  EXTENDED_NAME_FORMAT AccountNameFormat,
  EXTENDED_NAME_FORMAT DesiredNameFormat,
  LPSTR                lpTranslatedName,
  PULONG               nSize
);

Parameters

lpAccountName

The name to be translated.

AccountNameFormat

The format of the name to be translated. This parameter is a value from the EXTENDED_NAME_FORMAT enumeration type.

DesiredNameFormat

The format of the converted name. This parameter is a value from the EXTENDED_NAME_FORMAT enumeration type. It cannot be NameUnknown.

lpTranslatedName

A pointer to a buffer that receives the converted name.

nSize

On input, the variable indicates the size of the lpTranslatedName buffer, in TCHARs. On output, the variable returns the size of the returned string, in TCHARs, including the terminating null character.

If lpTranslated is NULL and nSize is 0, the function succeeds and nSize receives the required buffer size.

If the lpTranslatedName buffer is too small to hold the converted name, the function fails and nSize receives the required buffer size.

Return Value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

TranslateName fails if it cannot bind to Active Directory on a domain controller.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header secext.h (include Security.h)
Library Secur32.lib
DLL Secur32.dll

See Also

Computer Names

DsCrackNames

EXTENDED_NAME_FORMAT

System Information Functions