2 out of 4 rated this helpful - Rate this topic

TranslateName function

Applies to: desktop apps only

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

Minimum supported server

Windows 2000 Server

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

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ