FreeRDP
TestGetComputerName.c File Reference
#include <stdio.h>
#include <string.h>
#include <winpr/wtypes.h>
#include <winpr/sysinfo.h>
#include <winpr/error.h>

Functions

BOOL GetComputerNameA (LPSTR lpBuffer, LPDWORD lpnSize)
 
BOOL Test_GetComputerName (void)
 
BOOL Test_GetComputerNameEx_Format (COMPUTER_NAME_FORMAT format)
 
int TestGetComputerName (int argc, char *argv[])
 

Function Documentation

BOOL GetComputerNameA ( LPSTR  lpBuffer,
LPDWORD  lpnSize 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL Test_GetComputerName ( void  )

BOOL WINAPI GetComputerName(LPTSTR lpBuffer, LPDWORD lpnSize);

GetComputerName retrieves the NetBIOS name of the local computer.

lpBuffer [out] A pointer to a buffer that receives the computer name or the cluster virtual server name. The buffer size should be large enough to contain MAX_COMPUTERNAME_LENGTH + 1 characters.

lpnSize [in, out] On input, specifies the size of the buffer, in TCHARs. On output, the number of TCHARs copied to the destination buffer, not including the terminating null character. If the buffer is too small, the function fails and GetLastError returns ERROR_BUFFER_OVERFLOW. The lpnSize parameter specifies the size of the buffer required, including the terminating null character

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL Test_GetComputerNameEx_Format ( COMPUTER_NAME_FORMAT  format)

BOOL WINAPI GetComputerNameEx(COMPUTER_NAME_FORMAT NameType, LPTSTR lpBuffer, LPDWORD lpnSize);

Retrieves a NetBIOS or DNS name associated with the local computer.

NameType [in] ComputerNameNetBIOS ComputerNameDnsHostname ComputerNameDnsDomain ComputerNameDnsFullyQualified ComputerNamePhysicalNetBIOS ComputerNamePhysicalDnsHostname ComputerNamePhysicalDnsDomain ComputerNamePhysicalDnsFullyQualified

lpBuffer [out] A pointer to a buffer that receives the computer name or the cluster virtual server name. The length of the name may be greater than MAX_COMPUTERNAME_LENGTH characters because DNS allows longer names. To ensure that this buffer is large enough, set this parameter to NULL and use the required buffer size returned in the lpnSize parameter.

lpnSize [in, out] On input, specifies the size of the buffer, in TCHARs. On output, receives the number of TCHARs copied to the destination buffer, not including the terminating null character. If the buffer is too small, the function fails and GetLastError returns ERROR_MORE_DATA. This parameter receives the size of the buffer required, including the terminating null character. If lpBuffer is NULL, this parameter must be zero.

Here is the call graph for this function:

Here is the caller graph for this function:

int TestGetComputerName ( int  argc,
char *  argv[] 
)

Here is the call graph for this function:

Here is the caller graph for this function: