亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? wlsample.cpp

?? 對(duì)wifi編程有很大的幫助作用
?? CPP
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
                                                   NULL);

        pSsid->uSSIDLength--;
        memcpy(&pSsid->ucSSID, pbSsid, pSsid->uSSIDLength);
    }

    return dwRetCode;
}

// copy SSID to a null-terminated WCHAR string
// count is the number of WCHAR in the buffer.
LPWSTR
SsidToStringW(
    __out_ecount(count) LPWSTR   buf,
    __in ULONG   count,
    __in PDOT11_SSID pSsid
    )
{
    ULONG   bytes, i;

    bytes = min( count-1, pSsid->uSSIDLength);
    for( i=0; i<bytes; i++)
        mbtowc( &buf[i], (const char *)&pSsid->ucSSID[i], 1);
    buf[bytes] = '\0';

    return buf;
}


// the max lenght of the reason string in characters
#define WLSAMPLE_REASON_STRING_LEN 256

// print the reason string
VOID
PrintReason(
    __in WLAN_REASON_CODE reason
)
{
    WCHAR strReason[WLSAMPLE_REASON_STRING_LEN];

    if (WlanReasonCodeToString(
            reason, 
            WLSAMPLE_REASON_STRING_LEN,
            strReason, 
            NULL            // reserved
            ) == ERROR_SUCCESS)
    {
        wcout << L" The reason is \"" << strReason << L"\"." << endl;
    }
    else
    {
        wcout << L" The reason code is " << reason << L"." << endl;
    }
}

// print the basic information of a visible wireless network
VOID PrintNetworkInfo(
    __in PWLAN_AVAILABLE_NETWORK pNetwork
)
{
    WCHAR strSsid[DOT11_SSID_MAX_LENGTH+1];

    if (pNetwork != NULL)
    {
        // SSID
        wcout << L"SSID: " << SsidToStringW(strSsid, sizeof(strSsid)/sizeof(WCHAR), &pNetwork->dot11Ssid) << endl;

        // whether security is enabled
        if (pNetwork->bSecurityEnabled)
        {
            wcout << L"\tSecurity enabled." << endl;
        }
        else
        {
            wcout << L"\tSecurity not enabled." << endl;
        }

        // number of BSSIDs
        wcout << L"\tContains " << pNetwork->uNumberOfBssids << L" BSSIDs." << endl;

        // whether have a profile for this SSID
        if (pNetwork->dwFlags & WLAN_AVAILABLE_NETWORK_HAS_PROFILE)
        {
            wcout << L"\tHas a matching profile: " << pNetwork->strProfileName << L"." <<endl;
        }

        // whether it is connected
        if (pNetwork->dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED)
        {
            wcout << L"\tCurrently connected." << endl;
        }

        // whether it is connectable
        if (!pNetwork->bNetworkConnectable)
        {
            // the reason that it is not connectable
            wcout << L"\tThe network is not connectable. ";
            PrintReason(pNetwork->wlanNotConnectableReason);
        }
        else
        {
            wcout << L"\tThe network is connectable." << endl;
        }

        // BSS type
        wcout << L"\tBSS type: " << GetBssTypeString(pNetwork->dot11BssType) << endl;
        
        // Signal quality
        wcout << L"\tSignal quality: " << pNetwork->wlanSignalQuality << L"%" << endl;

        // Default auth algorithm
        wcout << L"\tDefault authentication algorithm: " << GetAuthAlgoString(pNetwork->dot11DefaultAuthAlgorithm) << endl;

        // Default cipher algorithm
        wcout << L"\tDefault cipher algorithm: " << GetCipherAlgoString(pNetwork->dot11DefaultCipherAlgorithm) << endl;
    }
}

// print BSS info
VOID 
PrintBssInfo(
    __in PWLAN_BSS_ENTRY pBss
)
{
    WCHAR strSsid[DOT11_SSID_MAX_LENGTH+1];
    UINT i;
    PBYTE pIe = NULL;
    
    if (pBss != NULL)
    {
        // MAC address
        wcout << L"MAC address: ";
        for (i = 0; i < 6; i++)
        {
            wcout << setw(2) << setfill(L'0') << hex << (UINT)pBss->dot11Bssid[i] <<L" ";
        }
        wcout << endl;
        
        // SSID
        wcout << L"\tSSID: " << SsidToStringW(strSsid, sizeof(strSsid)/sizeof(WCHAR), &pBss->dot11Ssid) << endl;

        // Beacon period
        wcout << L"\tBeacon period: " << dec << pBss->usBeaconPeriod << L" TU" << endl;
        
        // IE
        wcout << L"\tIE";
        i = 0;
        pIe = (PBYTE)(pBss) + pBss->ulIeOffset;

        // print 8 byte per line
        while (i < pBss->ulIeSize)
        {
            if (i % 8 == 0)
            {
                wcout << endl << L"\t\t";
            }
            wcout << setw(2) << setfill(L'0') << hex << (UINT)pIe[i] << L" ";
            i++;
        }

        wcout << endl;
    }
    
}

#define WLAN_INVALID_COUNTER (ULONGLONG)-1

// print the counter value in driver statistics
VOID 
PrintCounterValue(
    __in ULONGLONG value
)
{
    if (value == WLAN_INVALID_COUNTER)
        wcout << L" cannot be obtained" << endl;
    else
        // wcout cannot handle ULONGLONG
        wcout << (UINT)value << endl;
}

// print the error message
VOID
PrintErrorMsg(
    __in LPWSTR strCommand,
    __in DWORD dwError
)
{
    if (strCommand != NULL)
    {
        if (dwError == ERROR_SUCCESS)
        {
            wcout << L"Command \"" << strCommand << L"\" completed successfully." << endl;
        }
        else if (dwError == ERROR_INVALID_PARAMETER)
        {
            wcout << L"The parameter for \"" << strCommand << L"\" is not correct. ";
            wcout << L"Please use \"help " << strCommand << L"\" to check the usage of the command." << endl;
        }
        else if (dwError == ERROR_BAD_PROFILE)
        {
            wcout << L"The given profile is not valid." << endl;
        }
        else if (dwError == ERROR_NOT_SUPPORTED)
        {
            wcout << L"Command \"" << strCommand << L"\" is not supported." << endl;
        }
        else
        {
            wcout << L"Got error " << dwError << L" for command \"" << strCommand << L"\"" << endl;
        }
    }
}

// open a WLAN client handle and check version
DWORD
OpenHandleAndCheckVersion(
    PHANDLE phClient
)
{
    DWORD dwError = ERROR_SUCCESS;
    DWORD dwServiceVersion;
    HANDLE hClient = NULL;

    __try
    {
        *phClient = NULL;
        
        // open a handle to the service
        if ((dwError = WlanOpenHandle(
                            WLAN_API_VERSION,
                            NULL,               // reserved
                            &dwServiceVersion,
                            &hClient
                            )) != ERROR_SUCCESS)
        {
            __leave;
        }

        // check service version
        if (WLAN_API_VERSION_MAJOR(dwServiceVersion) < WLAN_API_VERSION_MAJOR(WLAN_API_VERSION_2_0))
        {
            // No-op, because the version check is for demonstration purpose only.
            // You can add your own logic here.
        }

        *phClient = hClient;

        // set hClient to NULL so it will not be closed
        hClient = NULL;
    }
    __finally
    {
        if (hClient != NULL)
        {
            // clean up
            WlanCloseHandle(
                hClient, 
                NULL            // reserved
                );
        }
    }

    return dwError;
}

//
// Functions that demonstrate how to use WLAN APIs
//

// Notification callback function
VOID WINAPI
NotificationCallback(
    __in PWLAN_NOTIFICATION_DATA pNotifData, 
    __in_opt PVOID pContext  // this parameter is not used
)
{
    WCHAR strSsid[DOT11_SSID_MAX_LENGTH+1];
    PWLAN_CONNECTION_NOTIFICATION_DATA pConnNotifData = NULL;

    if (pNotifData != NULL)
    {
        switch(pNotifData->NotificationSource)
        {
            case WLAN_NOTIFICATION_SOURCE_ACM:
                wcout << L"Got notification " << GetAcmNotificationString(pNotifData->NotificationCode) << L" from ACM." << endl; 

                // print some notifications as examples
                switch(pNotifData->NotificationCode)
                {
                    case wlan_notification_acm_connection_complete:
                        if (pNotifData->dwDataSize < sizeof(WLAN_CONNECTION_NOTIFICATION_DATA))
                        {
                            break;
                        }
                        pConnNotifData = (PWLAN_CONNECTION_NOTIFICATION_DATA)pNotifData->pData;
                        if (pConnNotifData->wlanReasonCode == WLAN_REASON_CODE_SUCCESS)
                        {
                            wcout << L"The connection succeeded." << endl;

                            if (pConnNotifData->wlanConnectionMode == wlan_connection_mode_discovery_secure ||
                                pConnNotifData->wlanConnectionMode == wlan_connection_mode_discovery_unsecure)
                            {
                                // the temporary profile generated for discovery
                                wcout << L"The profile used for this connection is as follows:" << endl;
                                wcout << pConnNotifData->strProfileXml << endl;
                            }
                        }
                        else
                        {
                            wcout << L"The connection failed.";
                            PrintReason(pConnNotifData->wlanReasonCode);
                        }
                        break;
                    case wlan_notification_acm_connection_start:
                        if (pNotifData->dwDataSize != sizeof(WLAN_CONNECTION_NOTIFICATION_DATA))
                        {
                            break;
                        }
                        pConnNotifData = (PWLAN_CONNECTION_NOTIFICATION_DATA)pNotifData->pData;
                        // print out some connection information
                        wcout << L"\tCurrently connecting to " << SsidToStringW(strSsid, sizeof(strSsid)/sizeof(WCHAR), &pConnNotifData->dot11Ssid);
        
                        wcout << L" using profile " << pConnNotifData->strProfileName;
                        wcout << L", connection mode is " << GetConnectionModeString(pConnNotifData->wlanConnectionMode);
                        wcout << L", BSS type is " << GetBssTypeString(pConnNotifData->dot11BssType) << endl;

                        break;
                }

                break;
            case WLAN_NOTIFICATION_SOURCE_MSM:
                wcout << L"Got notification " << GetMsmNotificationString(pNotifData->NotificationCode) << L" from MSM." << endl; 
                break;
        }

    }
}

// Register for notification
VOID 
RegisterNotification(
    __in int argc, 
    __in_ecount(argc) LPWSTR argv[]
)
{
    DWORD dwError = ERROR_SUCCESS;
    HANDLE hClient = NULL;
    DWORD dwPrevNotifType = 0;

    __try
    {
        if (argc != 1)
        {
            dwError = ERROR_INVALID_PARAMETER;
            __leave;
        }

        // open a handle to the service
        if ((dwError = OpenHandleAndCheckVersion(
                            &hClient
                            )) != ERROR_SUCCESS)
        {
            __leave;
        }

        // register for ACM and MSM notifications
        if ((dwError = WlanRegisterNotification(
                            hClient,
                            WLAN_NOTIFICATION_SOURCE_ACM | WLAN_NOTIFICATION_SOURCE_MSM,
                            FALSE,			// do not ignore duplications
                            NotificationCallback,
                            NULL,			// no callback context is needed
                            NULL,           // reserved
                            &dwPrevNotifType
                            )) != ERROR_SUCCESS)
        {
            __leave;
        }

        wcout << L"ACM and MSM notifications are successfully registered. Press any key to exit." << endl;

        // wait for the user to press a key
        _getch();

        // unregister notifications
        if ((dwError = WlanRegisterNotification(
                            hClient,
                            WLAN_NOTIFICATION_SOURCE_NONE,
                            FALSE,          // do not ignore duplications
                            NULL,           // no callback function is needed
                            NULL,           // no callback context is needed
                            NULL,           // reserved
                            &dwPrevNotifType
                            )) == ERROR_SUCCESS)
        {
            wcout << L"ACM and MSM notifications are successfully unregistered." << endl;
        }
        else
        {
            wcout << L"Error " << dwError << L" occurs when unresiger ACM and MSM notifications." << endl;
        }
    }
    __finally
    {
        // clean up
        if (hClient != NULL)
        {
            WlanCloseHandle(
                hClient, 
                NULL            // reserved
                );
        }
    }

    PrintErrorMsg(argv[0], dwError);
}


// set profile
VOID 
SetProfile(
    __in int argc, 
    __in_ecount(argc) LPWSTR argv[]
)
{
    DWORD dwError;
    HRESULT hr;
    HANDLE hClient = NULL;
    GUID guidIntf;
    CComPtr<IXMLDOMDocument2> pXmlDoc;
    CComBSTR bstrXml;
    VARIANT_BOOL vbSuccess;
    DWORD dwReason;

	// __try and __leave cannot be used here because of COM object
    do
    {
        if (argc != 3)
        {
            dwError = ERROR_INVALID_PARAMETER;
            break;
        }

        // get the interface GUID
        if (UuidFromString((RPC_WSTR)argv[1], &guidIntf) != RPC_S_OK)
        {
            wcerr << L"Invalid GUID " << argv[1] << endl;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91国产丝袜在线播放| 亚洲精品视频一区二区| 911国产精品| 欧美日韩一区不卡| 91麻豆精品国产| 制服丝袜在线91| 日韩一卡二卡三卡四卡| 日韩三级在线观看| 日韩女优毛片在线| xfplay精品久久| 国产欧美中文在线| 国产精品色哟哟| 最新高清无码专区| 亚洲综合精品自拍| 日韩高清不卡一区二区| 九九九久久久精品| 国产乱对白刺激视频不卡| 成人午夜在线播放| 日本韩国欧美三级| 欧美精品免费视频| 精品免费视频.| 中文字幕第一区| 亚洲日本韩国一区| 性做久久久久久免费观看| 捆绑调教一区二区三区| 国产成人av一区| 91免费观看国产| 欧美日韩国产大片| 欧美tickling挠脚心丨vk| 国产蜜臀av在线一区二区三区| 亚洲欧洲成人av每日更新| 亚洲高清一区二区三区| 麻豆一区二区三| 懂色av一区二区夜夜嗨| 91福利在线免费观看| 欧美精品欧美精品系列| 日本一区二区三区高清不卡 | 日韩国产一二三区| 国产综合色精品一区二区三区| 成人午夜看片网址| 欧美日韩你懂得| 久久久久久久久久久久久久久99 | 国产精品理论片在线观看| 亚洲高清视频的网址| 蜜桃视频在线观看一区二区| 不卡一区在线观看| 7777精品伊人久久久大香线蕉| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲 欧美综合在线网络| 成人午夜短视频| 91麻豆精品国产91久久久更新时间 | 欧美精选一区二区| 国产精品入口麻豆九色| 日本亚洲免费观看| 91亚洲国产成人精品一区二区三 | 久久夜色精品一区| 亚洲一二三区视频在线观看| 国产精品 日产精品 欧美精品| 欧美亚洲综合网| 国产欧美一区二区三区网站| 琪琪一区二区三区| 91视频一区二区三区| 久久综合狠狠综合久久激情| 亚洲精品成人精品456| 国产精品一区二区在线观看不卡| 欧美亚洲国产一区在线观看网站| 国产目拍亚洲精品99久久精品| 日av在线不卡| 欧美少妇一区二区| 综合av第一页| 国产成人av资源| 精品国产一区二区三区不卡| 午夜欧美电影在线观看| aa级大片欧美| 国产调教视频一区| 美女视频网站久久| 6080国产精品一区二区| 一区二区三区精品| 91在线观看免费视频| 久久精品亚洲麻豆av一区二区| 日韩成人av影视| 欧美天堂一区二区三区| 亚洲精品国产a久久久久久 | 国产精品灌醉下药二区| 国产在线麻豆精品观看| 欧美一区二区三区四区久久| 亚洲第一福利视频在线| 在线欧美一区二区| 亚洲黄一区二区三区| 99久久精品国产导航| 国产精品视频yy9299一区| 国产精一区二区三区| 精品国产第一区二区三区观看体验| 三级欧美在线一区| 欧美伦理视频网站| 亚洲成av人在线观看| 欧美日本不卡视频| 午夜精品一区在线观看| 欧美另类久久久品| 天堂蜜桃91精品| 91精品国产一区二区| 日本aⅴ免费视频一区二区三区 | 国产精品福利一区二区| 懂色av一区二区在线播放| 中文字幕第一页久久| 成人av资源在线| 国产精品久久久久久一区二区三区| 国产成a人亚洲精品| 国产精品久久久久婷婷二区次| 99天天综合性| 一区二区三区蜜桃| 欧美日韩免费电影| 日本色综合中文字幕| 日韩欧美的一区| 国产精品888| 中文字幕制服丝袜成人av| 91在线丨porny丨国产| 依依成人综合视频| 91.xcao| 国产一区二区免费在线| 日本一区二区三区电影| 91在线免费视频观看| 亚洲一二三级电影| 日韩免费观看高清完整版在线观看| 久久97超碰色| 中文字幕在线免费不卡| 91福利精品视频| 青青青爽久久午夜综合久久午夜 | 亚洲影视在线播放| 日韩午夜激情av| 国产精品一区二区久久不卡| 亚洲欧美在线另类| 欧美日韩免费不卡视频一区二区三区| 日韩国产在线观看| 亚洲国产精品精华液网站| 欧美日韩国产免费| 国产一区二区三区电影在线观看| 国产精品国产a级| 欧美顶级少妇做爰| 国产999精品久久久久久绿帽| 夜夜嗨av一区二区三区四季av| 91精品免费观看| aaa亚洲精品一二三区| 亚洲成av人片在线观看无码| 国产亚洲va综合人人澡精品| 色婷婷久久久亚洲一区二区三区 | 国产一区二区三区在线观看免费视频 | 视频在线观看一区二区三区| 久久亚洲精精品中文字幕早川悠里| 91天堂素人约啪| 麻豆精品久久精品色综合| 中文字幕在线不卡| 日韩欧美另类在线| 色综合久久88色综合天天6| 久久国产日韩欧美精品| 亚洲少妇最新在线视频| 精品国产百合女同互慰| 色88888久久久久久影院野外 | 色国产综合视频| 国产一区二区三区免费| 亚洲一区二区三区视频在线播放| 久久综合色婷婷| 欧美日韩另类一区| 北条麻妃国产九九精品视频| 日韩电影一二三区| 综合久久综合久久| 久久久电影一区二区三区| 在线电影欧美成精品| 91免费观看在线| 粉嫩13p一区二区三区| 另类综合日韩欧美亚洲| 亚洲综合免费观看高清在线观看| 国产视频一区在线观看| 欧美一区二区人人喊爽| 日本高清视频一区二区| 粉嫩高潮美女一区二区三区| 久久99精品久久只有精品| 午夜视频久久久久久| 亚洲日本青草视频在线怡红院 | 午夜精品爽啪视频| 亚洲激情图片小说视频| 国产精品国产三级国产a| 亚洲精品在线电影| 91精品福利在线一区二区三区| 色播五月激情综合网| 不卡的av在线播放| 国产高清精品网站| 国产一区二区三区四区五区入口| 午夜视频一区二区三区| 亚洲永久免费av| 亚洲精品欧美在线| 亚洲品质自拍视频网站| 自拍偷拍国产精品| 综合自拍亚洲综合图不卡区| 国产精品美女久久久久av爽李琼 | 午夜a成v人精品| 亚洲制服丝袜在线| 一区二区高清免费观看影视大全| 国产精品久久久久9999吃药| 中文天堂在线一区|