TranslateName Function

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

Syntax

C++
BOOLEAN WINAPI TranslateName(
  __in     LPCTSTR lpAccountName,
  __in     EXTENDED_NAME_FORMAT AccountNameFormat,
  __in     EXTENDED_NAME_FORMAT DesiredNameFormat,
  __out    LPTSTR lpTranslatedName,
  __inout  PULONG nSize
);

Parameters

lpAccountName [in]

The name to be translated.

AccountNameFormat [in]

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

DesiredNameFormat [in]

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

lpTranslatedName [out]

A pointer to a buffer that receives the converted name.

nSize [in, out]

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

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderSecext.h (include Security.h)
LibrarySecur32.lib
DLLSecur32.dll
Unicode and ANSI namesTranslateNameW (Unicode) and TranslateNameA (ANSI)

See Also

Computer Names
DsCrackNames
EXTENDED_NAME_FORMAT
System Information Functions

Send comments about this topic to Microsoft

Build date: 10/8/2009

Tags :


Page view tracker