Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TranslateName function

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

Syntax


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 client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Secext.h (include Security.h)

Library

Secur32.lib

DLL

Secur32.dll

Unicode and ANSI names

TranslateNameW (Unicode) and TranslateNameA (ANSI)

See also

Computer Names
DsCrackNames
EXTENDED_NAME_FORMAT
System Information Functions

 

 

Community Additions

ADD
Show:
© 2015 Microsoft