GetComputerObjectNameA function

Retrieves the local computer's name in a specified format.

Syntax

BOOLEAN SEC_ENTRY GetComputerObjectNameA(
  EXTENDED_NAME_FORMAT NameFormat,
  LPSTR                lpNameBuffer,
  PULONG               nSize
);

Parameters

NameFormat

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

lpNameBuffer

A pointer to a buffer that receives the name in the specified format.

If this parameter is NULL, either the function succeeds and the lpnSize parameter receives the required size, or the function fails with ERROR_INSUFFICIENT_BUFFER and lpnSize receives the required size. The behavior depends on the value of NameFormat and the version of the operating system.

nSize

On input, specifies the size of the lpNameBuffer buffer, in TCHARs. On success, receives the size of the name copied to the buffer. If the lpNameBuffer buffer is too small to hold the name, the function fails and lpnSize 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.

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

EXTENDED_NAME_FORMAT

GetComputerNameEx

System Information Functions