Back to product page

MyHostname function


Holds the hostname of the local computer.

Type

A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

  • C
long Sftp_GetMyHostname(void *Sftp, char *Buffer, int *Bufsize);
long Sftp_SetMyHostname(void *Sftp, char *newVal);
The MyHostname(void *Sftp,char *Buffer,int *Bufsize) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *Bufferlong Sftp_GetMyHostname(void *Sftp, char *Buffer, int *Bufsize); long Sftp_SetMyHostname(void *Sftp, char *newVal);
int *BufsizeSize of the buffer.

Remarks

Here you can find the short name of the local computer, as defined in your network settings. There will be no domain information because your computer can be known differently on the external network, depending on your dial-up settings, local network settings, etc..

Although you can write to this property it will not change your network settings.

The Bufsize variable should contain the maximum data length that can be stored in the Buffer variable. If you set Bufsize = 0, then the function will return with error ERROR_INSUFFICIENT_BUFFER and Bufsize will contain the required buffer size.

Platforms

Windows