阅读:1416回复:0
请教一问题,断开当前AP失败
int CWifi::DisConnect()
{ int iRet = -1; if (!m_hDevice) { m_strErrorInfo = "没有初始化"; goto RELEASE; } 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; } iRet = 0; RELEASE: return iRet; } GetLastError()返回错误31。 请问有哪位可以指点一二????? |
|