1

From my command prompt in Compact 7 I try to execute something like this:

wlantool -c -ssid name -auth wpa2psk -encr aes -key mypassword

I get this error: [WLANTOOL] WlanReasonCodeToString() FAILED error: 1814

Same command was working for almost 1 month and suddenly it's returning this error.

  • Network name (SSID): name
  • Encryption: AES
  • Authentication: WPA2-PSK
  • Network key: mypassword

What am I doing wrong in my command promt above? And how do I find out what error 1814 is?

I want to call the command line tool wlantool.exe from a C# program to let the user handle wifi-connections from within my app.

c++ Code of WLANTOOL

DWORD dwFlags = 0;
    BOOL bOverwrite = TRUE;
    DWORD dwReasonCode = WLAN_REASON_CODE_UNKNOWN;
    dwError = WlanSetProfile(*phClientHandle, 
                             &pInterface->InterfaceGuid, 
                             0,
                             bstrXml,
                             NULL,
                             bOverwrite, 
                             NULL, 
                             &dwReasonCode);
    if(ERROR_SUCCESS != dwError)
    {
        WCHAR strMeaning[MAX_PATH];
        DWORD dwEr = ERROR_SUCCESS;

        strMeaning[0] = L'\0';

        dwEr = WlanReasonCodeToString(dwReasonCode,
                                      MAX_PATH,
                                      strMeaning,
                                      NULL);
        if(ERROR_SUCCESS != dwEr )
        {
            PrintMsg(L"WlanReasonCodeToString() FAILED error: %lu",dwEr);
            break;
        }


        PrintMsg(L"WlanSetProfile() FAILED Error: %lu dwReasonCode : %lu Meaning : %s,",
                 dwError,
                 dwReasonCode,
                 strMeaning);
        break;
    }
samiaj
  • 421
  • 1
  • 5
  • 15
  • 1814 is ERROR_RESOURCE_NAME_NOT_FOUND (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms681386(v=vs.85).aspx) – Carsten Hansen May 08 '18 at 23:20
  • @CarstenHansen Thanks for your reply.I understood 1814 is ERROR_RESOURCE_NAME_NOT_FOUND. But not sure what resource is missing suddenly. – samiaj May 09 '18 at 13:59

1 Answers1

0

The issue has happened because WINCE has a limit of 66(not sure is this exact count) number of profiles can be created.When I manually delete some profiles created previously from registry the issue solved.

samiaj
  • 421
  • 1
  • 5
  • 15