【问题标题】:WlanGetProfileList is not returning profiles created after device restartWlanGetProfileList 不返回设备重启后创建的配置文件
【发布时间】:2018-05-11 06:05:30
【问题描述】:

WlanGetProfileList 原生 api 按预期工作,直到设备重新启动。设备重启后,相同 api 的结果为空。但我仍然可以在 Windows Compact OS 的注册表值下看到创建的配置文件。

为了在 WINCE7 中启用 wifi 功能,我使用了 WLANTOOL。下面是来自 wlantool 的代码,用于获取创建的配置文件列表。

BOOL WlanInterfaces::ListProfileList(LPCWSTR strAdapter)
{
BOOL bResult = FALSE;
DWORD dwError = ERROR_SUCCESS;
PWLAN_PROFILE_INFO_LIST pProfileList = NULL;    
do
{
    if(FALSE == Init())
        break;

    WLAN_INTERFACE_INFO* pInterface = NULL;
    if(!GetInterface(strAdapter,&pInterface))
        break;

    dwError = WlanGetProfileList(*phClientHandle,
                                 &pInterface->InterfaceGuid,
                                 NULL,
                                 &pProfileList);

    if(ERROR_SUCCESS != dwError)
    {
        PrintMsg(L"WlanGetProfileList() Failed Error : %d",dwError);
        break;
    }

    if(NULL == pProfileList)
    {
        PrintMsg(L"WlanGetProfileList() returned NULL ProfileList");
        break;
    }

    for(DWORD i =0;i<pProfileList->dwNumberOfItems;i++)
    {
        PrintMsg(L"");
        PrintMsg(L"Index           : %lu",i);
        PrintMsg(L"Flags           : %lu",pProfileList->ProfileInfo[i].dwFlags);
        PrintMsg(L"ProfileName     : %s",pProfileList->ProfileInfo[i].strProfileName);
        ListProfile(strAdapter,pProfileList->ProfileInfo[i].strProfileName);
    }

    bResult = TRUE;
    }while(FALSE);

if(pProfileList)
    WlanFreeMemory(pProfileList);    

return bResult;
}

任何帮助将不胜感激。提前致谢。

【问题讨论】:

    标签: c++ wifi windows-ce wlanapi nt-native-api


    【解决方案1】:

    在 Win CE 上,一些设备文件夹和 IIRC,注册表项在重启时被重置。

    您需要查看适用于您的设备和 Windows 版本的文档,以了解哪些存储位置是永久性的,然后使用它们或保存它们并从中恢复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-22
      • 1970-01-01
      • 2020-08-03
      • 1970-01-01
      • 1970-01-01
      • 2017-06-01
      • 2017-12-25
      相关资源
      最近更新 更多