sethostname (Compact 2013)
This function is used to register the host name on a network with the Windows Internet Naming Service (WINS). This function also sets HKEY_LOCAL_MACHINE\Ident\Name and registers the name with DNS and LLMNR.
Note: |
|---|
|
DHCP Option 12 behavior is affected in the following manner when HKEY_LOCAL_MACHINE\Ident\Name is not equal to HKEY_LOCAL_MACHINE\Ident\OrigName. If the device has a unique name, where Name is not equal to OrigName, then the device will send DHCP Option 12. If the device does not have a unique name, or if both Name and OrigName do not exist under the Ident key, then the device will not send DHCP Option 12. |
If no error occurs, this function returns zero. If an error occurs, this function returns a value of SOCKET_ERROR, and retrieves a specific error code by calling WSAGetLastError.
The following table shows possible error codes for this function.
|
Error code |
Description |
|---|---|
|
WSAEFAULT |
The name parameter is not a valid part of the user address space, or the buffer size specified by the cName parameter is too small to hold the complete host name. |
|
WSAEINVAL |
One of the parameters is invalid. |
|
WSAENETDOWN |
The network subsystem failed. |
|
WSAEALREADY |
The host already is the name specified. |
Note: