3.1.4.1 WitnessrGetInterfaceList (Opnum 0)
The WitnessrGetInterfaceList method returns information about the interfaces to which witness client connections can be made.
-
DWORD WitnessrGetInterfaceList( [in] handle_t Handle, [out] PWITNESS_INTERFACE_LIST* InterfaceList);
Handle: An RPC binding handle [C706].
InterfaceList: A pointer to a PWITNESS_INTERFACE_LIST, as specified in section 2.2.2.6.
Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code, as specified in [MS-ERREF] section 2.2. The most common error codes are listed in the following table.
-
Return value/code
Description
0x00000000
ERROR_SUCCESS
The operation completed successfully.
0x00000005
ERROR_ACCESS_DENIED
Access is denied.
0x00000057
ERROR_INVALID_PARAMETER
The parameter is incorrect.
0x00000103
ERROR_NO_MORE_ITEMS
No more data is available.
0x0000000E
ERROR_OUTOFMEMORY
There is not enough storage space to complete the operation.
If there are no entries in the InterfaceList, the server MUST fail the request and return the error code ERROR_NO_MORE_ITEMS.
If no entry in the InterfaceList has a State of AVAILABLE, the server MUST wait until at least one entry enters that State, as specified in section 3.1.6.1.
For each Interface in the InterfaceList, the server MUST construct a WITNESS_INTERFACE_INFO structure as follows:
The InterfaceGroupName field of the WITNESS_INTERFACE_INFO structure MUST be set to Interface.InterfaceGroupName.
The State field MUST be set to Interface.State.
The Version field MUST be set to WitnessServiceVersion.
If Interface.IPv4Address is not empty, the IPV4 field MUST be set to Interface.IPv4Address, and IPv4 flag MUST be set in the Flags field.
If Interface.IPv6Address is not empty, the IPV6 field MUST be set to Interface.IPv6Address, and IPv6 flag MUST be set in the Flags field.
In an implementation-dependent manner, the server MUST determine if the IPv4Address or IPv6Address match any interface which is hosted on the server and if the server is also running this Witness Service instance. If the address is not hosted on the local server, the INTERFACE_WITNESS flag MUST be set in the Flags field. Otherwise, the flag MUST NOT be set.
The server MUST construct the WITNESS_INTERFACE_LIST structure as follows:
All WITNESS_INTERFACE_INFO structures MUST be copied into the InterfaceInfo field of the WITNESS_INTERFACE_LIST structure.
The NumberOfInterfaces field of the WITNESS_INTERFACE_LIST structure MUST be set to the number of interfaces provided by InterfaceInfo.
The WITNESS_INTERFACE_LIST structures MUST be copied into the InterfaceList parameter.
The server MUST return ERROR_SUCCESS and the InterfaceList parameter to the caller.