c++ - WlanGetProfileList 不返回设备重启后创建的配置文件

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

WlanGetProfileList在设备重新启动之前, native 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;
}

如有任何帮助,我们将不胜感激。提前致谢。

最佳答案

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

您需要查看您的设备和 Windows 版本的文档,以查看哪些存储位置是持久的,然后使用它们或保存到它们或从它们恢复。

关于c++ - WlanGetProfileList 不返回设备重启后创建的配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50285970/

相关文章:

Python 字典与 C++ 标准 :unordered_map (cython) vs cythonized python dict

c++ - 带星号和符号的函数参数

arduino - 如何使用 Arduino Wifi Bee 连接到 Cloudant

c++ - 模块、进程和线程?

c# - 缺少 OpenNetCF WebRequestMethod 类

两个值之间的 C++ 时间差

c++ - 了解其他类(class)发生的事件

cmd - 如何获取netsh wlan托管网络的忘记密码

android - hostapd 和 rpbi 强制门户

c++ - 在 Windows CE 5 中的可见应用程序之间切换,Lang : C++