IsDestinationReachableA function (sensapi.h)
The IsDestinationReachable function determines whether or not a specified destination can be reached, and provides Quality of Connection (QOC) information for a destination.
Windows Vista and later, Windows Server 2008 and later: This function is not supported and always returns ERROR_CALL_NOT_IMPLEMENTED.
Syntax
BOOL IsDestinationReachableA(
[in] LPCSTR lpszDestination,
[in, out] LPQOCINFO lpQOCInfo
);
Parameters
[in] lpszDestination
A pointer to a null-terminated string that specifies a destination. The destination can be an IP address, UNC name, or URL.
[in, out] lpQOCInfo
A pointer to the QOCINFO structure that receives the Quality of Connection (QOC) information. You can supply a NULL pointer if you do not want to receive the QOC information.
Return value
Return code | Description |
---|---|
|
A destination can be reached. |
|
A destination cannot be reached. To get extended error information, call GetLastError. |
|
This function is not available on Windows Vista. |
Remarks
Client applications use this function to determine the QOC information before proceeding with network operations. For standalone computers that are directly connected to a network through a network card or remote access server (RAS), this function generates minimal network traffic with RPC calls to the nearest router. For computers that are part of a network where a destination can be reached by using RAS or a network gateway, this function pings a destination to generate accurate QOC information.
This function is only available for TCP/IP connections. A caller supplies the buffer for the QOCINFO structure, and must release the memory when it is not needed.
Starting with applications designed for Windows Vista and Windows Server 2008, developers should consider using the Network List Manager instead of this function.
Note
The sensapi.h header defines IsDestinationReachable as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Target Platform | Windows |
Header | sensapi.h |
Library | Sensapi.lib |
DLL | Sensapi.dll |