3.1.4.14 R_WinsGetNameAndAdd (Opnum 13)

The R_WinsGetNameAndAdd method retrieves the NetBIOS name and the corresponding IP address of the target WINS server.

 DWORD R_WinsGetNameAndAdd(
   [in] handle_t ServerHdl,
   [out, ref] PWINSINTF_ADD_T pWinsAdd,
   [out, string, size_is(80)] LPBYTE pUncName
 );

ServerHdl: An RPC binding over IP address/HostName to the WINS server. RPC uses this binding internally to determine which WINS server the call is directed to.

pWinsAdd:  A pointer to a structure containing the IP address of the target WINS server.

pUncName: A  pointer to a NULL-terminated string containing the NetBIOS name of the target WINS server.

Return Values: A 32 bit unsigned integer that indicates the return status. A return value of ERROR_SUCCESS (0x00000000) indicates that operation completed successfully. A nonzero return value is a Win32 error code, as specified in [MS-ERREF]. The following Win32 error codes can be returned:

Return value/code

Description

0x00000000

ERROR_SUCCESS

The call was successful.

0x00000005

ERROR_ACCESS_DENIED

The caller doesn't have sufficient permissions.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].

Processing and Response Requirements:

The following requirements and recommendations apply to a WINS server that processes a call to R_WinsGetNameAndAdd:

  • The R_WinsGetNameAndAdd caller SHOULD have query-level access.<9> If an RPC client with a lower access level calls this method, the server SHOULD return ERROR_ACCESS_DENIED.<10>

  • The structure that pWinsAdd points to contains only an IP address. The R_WinsGetNameAndAdd caller SHOULD ignore the other fields of the structure.

  • The server retrieves the NetBIOS name by calling a standard Windows function, which returns the status code directly to the caller without any modification. Hence, any Win32 error code can be returned, as specified in [MS-ERREF].