locked
IcmpSendEcho Blue screen RRS feed

  • Question

  • I run this program and stop over Debug->Stop Debugging and computer do Blue screen PROCESS_HAS_LOCKED_PAGES and reset why?
    I have Windows Vista and Visual Studio 2008 Standard

    #include <Icmpapi.h>
    #pragma comment(lib, "IPHLPAPI.lib")

    //.....

    void CPingTestDlg::OnBnClickedButton1()
    {
    char strHost[] = "192.168.2.101";

    HANDLE hIcmpFile;
    IPAddr ipaddr = INADDR_NONE;
    DWORD dwRetVal = 0;
    char SendData[] = "Send Buffer";
    LPVOID ReplyBuffer = NULL;
    DWORD ReplySize = 0;

    ipaddr = inet_addr(strHost);
    if (ipaddr == INADDR_NONE)
    return;

    hIcmpFile = IcmpCreateFile();
    if (hIcmpFile == INVALID_HANDLE_VALUE)
    return;

    ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);
    ReplyBuffer =(VOID*) malloc(ReplySize);
    if(ReplyBuffer == NULL)
    return;

    while( 1 )
    {
    dwRetVal = IcmpSendEcho( hIcmpFile, ipaddr,(LPVOID) SendData, sizeof(SendData), NULL, ReplyBuffer, ReplySize, 2000 );
    }

    IcmpCloseHandle( hIcmpFile );
    free( ReplyBuffer );
    return;

    }
    • Edited by Milan Kovac Saturday, July 25, 2009 4:39 PM
    Saturday, July 25, 2009 3:51 PM

Answers

  • It's a bug in your NIC driver.  Try to find an update.

    Hans Passant.
    • Marked as answer by Milan Kovac Saturday, July 25, 2009 5:37 PM
    Saturday, July 25, 2009 4:58 PM

All replies

  • It's a bug in your NIC driver.  Try to find an update.

    Hans Passant.
    • Marked as answer by Milan Kovac Saturday, July 25, 2009 5:37 PM
    Saturday, July 25, 2009 4:58 PM
  • My freind test this program on other computer with some error. why? In other computer is other NIC.
    Saturday, July 25, 2009 5:39 PM
  • This is still an issue in Windows 7 (have not tried SP1 beta)

    I have tried with 3 different NICs.. all the same.. anyone else?

     


    Regards, Fil.
    Monday, January 10, 2011 6:03 AM
  • I've got the same issue on Win 7 SP1 x64. How can I avoid this issue? If I can't, apparently IcmpSendEcho is unusable, because how can I be sure users won't experience this?
    Thursday, May 8, 2014 8:21 AM