阅读:2853回复:5
使用OID_802_11_DISASSOCIATE断开无线连接失败
DWORD dwBytesReturned = 0;
ULONG oid = OID_802_11_DISASSOCIATE; if (!DeviceIoControl(m_hDevice, IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid), ( ULONG *) NULL, 0, &dwBytesReturned, NULL)) { char szError[256] = {0}; sprintf_s(szError, sizeof(szError), "断开失败(错误:%d)", GetLastError()); m_strErrorInfo = szError; goto RELEASE; } GetLastError()返回31。信息为:连到系统上的设备没有发挥作用。 请问我这代码有什么问题? |
|
沙发#
发布于:2009-07-26 10:28
会不会是原先就根本没连接呢?
|
|
|
板凳#
发布于:2009-07-26 14:47
不会,我是在无线网卡已经连上一个AP的时候,来测试这函数的
|
|
地板#
发布于:2009-07-31 09:37
IOCTL_NDIS_QUERY_GLOBAL_STATS is QUERY only and there is no way to set operation to NDIS miniport driver.
You should use native wifi function, e.g., WlanDisconnect, to facilitate this operation. |
|
地下室#
发布于:2009-08-03 08:28
|
|
5楼#
发布于:2009-08-05 09:48
Here it is.
http://www.microsoft.com/downloads/details.aspx?FamilyId=52A43BAB-DC4E-413F-AC71-158EFD1ADA50&displaylang=en BTW, the native WiFi functions do not work COMPLETELY on some 802.11 network cards because driver implementation limitation. |
|