Prev: keyboard filter driver
Next: Programming style...
From: Wojciech F. on 26 May 2005 15:21 I try to get signal strength and MAC's of all access points in user-mode. I try to make it without NDISUIO writing in pure C. I made a little app which uses WMI and Setup Api to find wireless network card. Unfortunately I do not know how to SET OID_802_11_BSSID_LIST_SCAN oid. Passing it to DeviceIoControl with IOCT_QUERY_GLOBAL_STATS returns FALSE and error: "50. The network request is not supported." ERROR_NOT_SUPPORTED". Although using only the query: OID_802_11_BSSID_LIST seems to work (list refreshes itself) but e.g. when I run Netstumbler (during work of my app) DeviceIoControl fails and getlasterror() shows error: "31 A device attached to the system is not functioning. ERROR_GEN_FAILURE ". And the most irritating thing is, that Netstumbler sees more access points than my programm. help..... -- Thanks, Wojtek E-mail hint: add [usenet] to the subject "Ipsa scientia potestas est."
From: Pavel A. on 26 May 2005 15:39 "Wojciech F." <"vankaszaner[REMOVE_IT]" wrote: > I try to get signal strength and MAC's of all access points in user-mode. I > try to make it without NDISUIO writing in pure C. > I made a little app which uses WMI and Setup Api to find wireless network > card. > Unfortunately I do not know how to SET OID_802_11_BSSID_LIST_SCAN oid. > Passing it to DeviceIoControl with IOCT_QUERY_GLOBAL_STATS returns FALSE > and error: "50. The network request is not supported." Exactly so. One can't pass this OID from user mode thru WMI and, of course, not thru IOCT_QUERY_GLOBAL_STATS. This is "by design". Maybe you don't need to set it at all. Driver of the wireless card scans automatically from time to time. All you need is get OID_802_11_BSSID_LIST. > Although using only the query: OID_802_11_BSSID_LIST seems to work (list > refreshes itself) but e.g. when I run Netstumbler (during work of my app) > DeviceIoControl fails and getlasterror() shows error: "31 A device attached > to the system is not functioning. ERROR_GEN_FAILURE ". Buffer is too small?? >And the most > irritating thing is, that Netstumbler sees more access points than my > programm. > help..... > > -- > Thanks, > Wojtek > > E-mail hint: add [usenet] to the subject > "Ipsa scientia potestas est." > --
From: Thomas F. Divine [DDK MVP] on 26 May 2005 16:27 "Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message news:1rvbva82kaysf$.dlg(a)tofik.homeip.net... >I try to get signal strength and MAC's of all access points in user-mode. I > try to make it without NDISUIO writing in pure C. > I made a little app which uses WMI and Setup Api to find wireless network > card. > Unfortunately I do not know how to SET OID_802_11_BSSID_LIST_SCAN oid. > Passing it to DeviceIoControl with IOCT_QUERY_GLOBAL_STATS returns FALSE > and error: "50. The network request is not supported." > ERROR_NOT_SUPPORTED". > Although using only the query: OID_802_11_BSSID_LIST seems to work (list > refreshes itself) but e.g. when I run Netstumbler (during work of my app) > DeviceIoControl fails and getlasterror() shows error: "31 A device > attached > to the system is not functioning. ERROR_GEN_FAILURE ". And the most > irritating thing is, that Netstumbler sees more access points than my > programm. > help..... The NetStumbler author has access to some adapter vendor proprietary information. For these adapters he uses non-NDIS adapter-vendor proprietary APIs to fetch information that isn't accessable through NDIS. This information is only available through license agreements with adapter vendors. When NetStumbler is in use it is certainly possible that the adapter may appear to be non-functional to Windows (Although I haven't seen this behavior myself.) No, I am not the NetStumbler author, although some versions of NetStumbler do use PCAUSA NDIS protocol drivers. As Pavel A. said the OS periodically makes the OID_802_11_BSSID_LIST_SCAN call at about 60-second intervals. So, about 83% of the time you should get a complete BSSID list if you query the OID_802_11_BSSID_LIST using WMI or IOCT_QUERY_GLOBAL_STATS. Do be sure to pass a LARGE buffer to be filled with list items when you make the query. Good luck, Thomas F. Divine, Windows DDK MVP http://www.rawether.net
From: iwub on 27 May 2005 05:18 I have done this, sure that it is OK on XP SP2. try again , and your params OK ? "Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> ??????:1rvbva82kaysf$.dlg(a)tofik.homeip.net... >I try to get signal strength and MAC's of all access points in user-mode. I > try to make it without NDISUIO writing in pure C. > I made a little app which uses WMI and Setup Api to find wireless network > card. > Unfortunately I do not know how to SET OID_802_11_BSSID_LIST_SCAN oid. > Passing it to DeviceIoControl with IOCT_QUERY_GLOBAL_STATS returns FALSE > and error: "50. The network request is not supported." > ERROR_NOT_SUPPORTED". > Although using only the query: OID_802_11_BSSID_LIST seems to work (list > refreshes itself) but e.g. when I run Netstumbler (during work of my app) > DeviceIoControl fails and getlasterror() shows error: "31 A device > attached > to the system is not functioning. ERROR_GEN_FAILURE ". And the most > irritating thing is, that Netstumbler sees more access points than my > programm. > help..... > > -- > Thanks, > Wojtek > > E-mail hint: add [usenet] to the subject > "Ipsa scientia potestas est."
From: Wojciech F. on 27 May 2005 07:27
> The NetStumbler author has access to some adapter vendor proprietary > information. For these adapters he uses non-NDIS adapter-vendor proprietary > APIs to fetch information that isn't accessable through NDIS. This > information is only available through license agreements with adapter > vendors. > > When NetStumbler is in use it is certainly possible that the adapter may > appear to be non-functional to Windows (Although I haven't seen this > behavior myself.) No, I am not the NetStumbler author, although some > versions of NetStumbler do use PCAUSA NDIS protocol drivers. > > As Pavel A. said the OS periodically makes the OID_802_11_BSSID_LIST_SCAN > call at about 60-second intervals. So, about 83% of the time you should get > a complete BSSID list if you query the OID_802_11_BSSID_LIST using WMI or > IOCT_QUERY_GLOBAL_STATS. > Unfortunately I need to call OID_802_11_BSSID_LIST_SCAN every 1-2sec. I'm working on WLAN positioniong system, so I have to get most current AP list with RSSI. Using NDISUIO it seems to be piece of cake: //whole code works perfectly PNDISUIO_SET_OID pSetOid = (PNDISUIO_SET_OID) &Buf[0]; pSetOid->Oid = OID_802_11_BSSID_LIST_SCAN; if (!DeviceIoControl(h,IOCTL_NDISUIO_SET_OID_VALUE,(LPVOID) &Buf[0], sizeof(Buf), (LPVOID) &Buf[0],0,&bytes,NULL)) { DWORD res=GetLastError(); return res; } PNDISUIO_QUERY_OID pQueryOid = (PNDISUIO_QUERY_OID) &Buf[0]; pQueryOid->Oid = OID_802_11_BSSID_LIST; if (!DeviceIoControl(h, IOCTL_NDISUIO_QUERY_OID_VALUE, &Buf[0], sizeof(Buf), &Buf[0], sizeof(Buf), &bytes, NULL)) { DWORD res=GetLastError(); return res; } ============================================================ And my current case: ULONG oid; oid=OID_802_11_BSSID_LIST_SCAN; //it always fails with ERROR_NOT_SUPPORTED //OIDScope from PCAUSA shows OID_802_11_BSSID_LIST_SCAN in list of //supported OIDs if (!DeviceIoControl(h,IOCTL_NDIS_QUERY_GLOBAL_STATS, &oid, sizeof(oid), (LPVOID) &Buf[0],sizeof(Buf),&bytes,NULL)) { DWORD res=GetLastError(); return res; } //does not fail oid=OID_802_11_BSSID_LIST; if (!DeviceIoControl(h,IOCTL_NDIS_QUERY_GLOBAL_STATS,&oid, sizeof(oid), (LPVOID) &Buf[0],sizeof(Buf),&bytes,NULL)) { DWORD res=GetLastError(); return res; } Buffer is big enough now. It fails with ERROR_GEN_FAILURE no more even with networkstumbler in background. -- Thanks, Wojtek E-mail hint: add [usenet] to the subject "Ipsa scientia potestas est." |