none
WIFI CPL create file returning invalid handle in WEC2013 RRS feed

  • Question

  • Hi all,

    we are working on a WiFi driver in Wince 2013 on freescale's SDP board. NDIS version is 6.0.

    We are using WiFiCPL application as the Network UI (Similar to NetUI).

    After booting we are getting the scanned lists properly and we can also connect to any AP in the scanned list.

    But the problem here is, When we try to disable our driver by clicking the 'Off' button on WiFiCPL interface, Disable is not Happening.The control is not passing to our WiFi Driver from the WiFiCPL application.

    After debugging we found that, Getting 'NDS0:' handle using CreateFile Function fails and it is returning an invalid handle and the Error code returning is 37. So the control retains in the WiFiCpl itself and Not passing to our driver,in turn, disable is not becoming successful.

    The Same WiFiCpl Application with same source code is working fine in WinCE7.

     The piece of code where WiFiCPL is failing is added below.

    //Here DD_NDIS_DEVICE_NAME is 'NDS0:'

    code:

    HANDLE  hNdis = INVALID_HANDLE_VALUE; hNdis=CreateFile(DD_NDIS_DEVICE_NAME, GENERIC_READ | GENERIC_WRITE,                 FILE_SHARE_READ | FILE_SHARE_WRITE,                 NULL, OPEN_ALWAYS, 0, NULL);          

    if (hNdis == INVALID_HANDLE_VALUE)     

    {      if (GetLastError() == ERROR_FILE_NOT_FOUND)      

    {       RETAILMSG(1,(TEXT(" ERROR_FILE_NOT_FOUND\n")));           }      else if(GetLastError() == ERROR_INVALID_NAME)      {       RETAILMSG(1,(TEXT(" ERROR_INVALID_NAME\n")));      }      else      {       RETAILMSG(1,(TEXT("Handle creation error code: %x hNdis:0x%x\n"),GetLastError(),hNdis));      }     }     

    Output we are getting is "Handle creation error code: 37 hNdis:0xFFFFFFFF"

    PLease let me know anyone faced similar kind of issue. Any suggestion is appreciated.


    • Edited by wifi_ndis6 Thursday, February 20, 2014 7:33 AM
    Thursday, February 20, 2014 7:32 AM

All replies

  • One More thing i want to add to this. GetLastError() function returns system error code, in our case it is 0x37, Which is ERROR_DEV_NOT_EXIST. Any registry settings need to be changed?

    Dha

    Wednesday, February 26, 2014 6:53 AM
  • So you're running this in a DEBUG operating system build and monitoring the kernel debug messages? It sounds like a crash occurred in the NDIS driver causing the device to "go away".

    Paul T.

    Monday, March 3, 2014 4:45 PM