Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Icmp6CreateFile function

The Icmp6CreateFile function opens a handle on which IPv6 ICMP echo requests can be issued.

Syntax


HANDLE Icmp6CreateFile(void);

Parameters

This function has no parameters.

Return value

The Icmp6CreateFile function returns an open handle on success. On failure, the function returns INVALID_HANDLE_VALUE. Call the GetLastError function for extended error information.

Remarks

The Icmp6CreateFile function opens a handle on which IPv6 ICMP echo requests can be issued. The Icmp6SendEcho2 function is used to send the IPv6 ICMP echo requests. The Icmp6ParseReplies function is used to parse the IPv6 ICMP replies. The IcmpCloseHandle function is used to close the ICMP handle opened by the Icmp6CreateFile function.

For IPv4, use the IcmpCreateFile function.

For IPv4, use the IcmpCreateFile, IcmpSendEcho, IcmpSendEcho2, IcmpSendEcho2Ex, and IcmpParseReplies functions.

Note that the include directive for Iphlpapi.h header file must be placed before the Icmpapi.h header file.

Examples

The following example opens a handle on which IPv6 ICMP echo requests can be issued.


#include <windows.h>
#include <stdio.h>
#include <iphlpapi.h>
#include <icmpapi.h>
#pragma comment(lib, "IPHLPAPI.lib")

void main()
{
    HANDLE hIcmpFile;

    hIcmpFile = Icmp6CreateFile();
    if (hIcmpFile == INVALID_HANDLE_VALUE) {
      printf("\tUnable to open handle.\n");
      printf("Icmp6Createfile returned error: %ld\n", GetLastError() );
    }
    else
      printf("\tHandle created.\n");
}


Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Icmpapi.h

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

GetLastError
Icmp6ParseReplies
Icmp6SendEcho2
IcmpCloseHandle
IcmpCreateFile
IcmpParseReplies
IcmpSendEcho
IcmpSendEcho2
IcmpSendEcho2Ex

 

 

Build date: 11/16/2013

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.