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."

RE: OID_802_11_BSSID_LIST_SCAN by pavel_a

pavel_a
Thu May 26 14:39:10 CDT 2005

"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."
>
--


Re: OID_802_11_BSSID_LIST_SCAN by Thomas

Thomas
Thu May 26 15:27:45 CDT 2005


"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message
news:1rvbva82kaysf$.dlg@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




Re: OID_802_11_BSSID_LIST_SCAN by iwub

iwub
Fri May 27 04:18:27 CDT 2005

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@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."



Re: OID_802_11_BSSID_LIST_SCAN by Wojciech

Wojciech
Fri May 27 06:27:26 CDT 2005


> 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."

Re: OID_802_11_BSSID_LIST_SCAN by Pavel

Pavel
Fri May 27 18:31:54 CDT 2005

"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message news:1b2cj2tbnczdv.dlg@tofik.homeip.net...
> 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;
> }

Sure enough, it will fail.
IOCTL_NDIS_QUERY_GLOBAL_STATS always does Query, but
OID_802_11_BSSID_LIST_SCAN works only if you Set it.
Getting OID_802_11_BSSID_LIST is a Query, thus it works.

So you do need something like ndis transport driver or ask the manufacturer of the wireless adapter to help.
Maybe there is a parameter that tells the driver to refresh scan results more frequently.

Also, note that OID_802_11_BSSID_LIST_SCAN does not produce
new scan results immediately. It only starts the scan. The adapter or driver complete it
when they can.

Regards,
--PA




Re: OID_802_11_BSSID_LIST_SCAN by Wojciech

Wojciech
Mon May 30 06:37:10 CDT 2005

> Sure enough, it will fail.
> IOCTL_NDIS_QUERY_GLOBAL_STATS always does Query, but
> OID_802_11_BSSID_LIST_SCAN works only if you Set it.
> Getting OID_802_11_BSSID_LIST is a Query, thus it works.
>
> So you do need something like ndis transport driver or ask the manufacturer of the wireless adapter to help.
> Maybe there is a parameter that tells the driver to refresh scan results more frequently.
>
> Also, note that OID_802_11_BSSID_LIST_SCAN does not produce
> new scan results immediately. It only starts the scan. The adapter or driver complete it
> when they can.

Yes. I wrote already that I don't know how to SET that oid. But I wonder
how does it make NDISUIO service. It seems to support a lots of w-lan cards
(i tested it with 5 different cards). I can't belive that it uses a magic
parameters specific for each card's manufacturer.

When I use NDISUIO and I set OID..._SCAN it seems to do real scan, because
I need to wait a little bit longer until DeviceIoControl funcion returns.
It is clearly noticeable on PocketPC. Sometimes it takes 2s until function
returns and after reading the list through the oid.._list it always differs
(new accespoints, rssi).

--
Thanks,
Wojtek

E-mail hint: add [usenet] to the subject
"Ipsa scientia potestas est."

Re: OID_802_11_BSSID_LIST_SCAN by Pavel

Pavel
Tue May 31 14:09:29 CDT 2005

"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message news:1e9nxskr0q8le$.dlg@tofik.homeip.net...
> Yes. I wrote already that I don't know how to SET that oid. But I wonder
> how does it make NDISUIO service.

NDISUIO (or clones of DDK Ndisprot sample ) is a real NDIS transport driver, so the full set of NDIS intefaces is available to
it.

> It seems to support a lots of w-lan cards
> (i tested it with 5 different cards). I can't belive that it uses a magic
> parameters specific for each card's manufacturer.

It is an universal vehicle to send any NDIS request to 3rd party netcard drivers.
It has nothing specific to wi-fi. Just study the ndisprot sample.
(if you work on WinCE OS, there it is different. I'm talking about NT based Windows).

> When I use NDISUIO and I set OID..._SCAN it seems to do real scan, because
> I need to wait a little bit longer until DeviceIoControl funcion returns.
> It is clearly noticeable on PocketPC. Sometimes it takes 2s until function
> returns and after reading the list through the oid.._list it always differs
> (new accespoints, rssi).

Depends on the netcard driver. Scan can and should run asynchronously.
Holding the caller for 2 seconds is bad.

Regards,
--PA




Re: OID_802_11_BSSID_LIST_SCAN by Wojciech

Wojciech
Fri Jun 03 04:51:38 CDT 2005

Tue, 31 May 2005 22:09:29 +0300,
microsoft.public.development.device.drivers, Pavel A.:

> "Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message news:1e9nxskr0q8le$.dlg@tofik.homeip.net...
>> Yes. I wrote already that I don't know how to SET that oid. But I wonder
>> how does it make NDISUIO service.
>
> NDISUIO (or clones of DDK Ndisprot sample ) is a real NDIS transport driver, so the full set of NDIS intefaces is available to
> it.
>
>> It seems to support a lots of w-lan cards
>> (i tested it with 5 different cards). I can't belive that it uses a magic
>> parameters specific for each card's manufacturer.
>
> It is an universal vehicle to send any NDIS request to 3rd party netcard drivers.
> It has nothing specific to wi-fi. Just study the ndisprot sample.
> (if you work on WinCE OS, there it is different. I'm talking about NT based Windows).
>
>> When I use NDISUIO and I set OID..._SCAN it seems to do real scan, because
>> I need to wait a little bit longer until DeviceIoControl funcion returns.
>> It is clearly noticeable on PocketPC. Sometimes it takes 2s until function
>> returns and after reading the list through the oid.._list it always differs
>> (new accespoints, rssi).
>
> Depends on the netcard driver. Scan can and should run asynchronously.
> Holding the caller for 2 seconds is bad.
>
> Regards,
> --PA

thanks for discussion, friend.


--
Thanks,
Wojtek

E-mail hint: add [usenet] to the subject
"Ipsa scientia potestas est."

Re: OID_802_11_BSSID_LIST_SCAN by Arsalan

Arsalan
Fri Jun 03 12:47:34 CDT 2005

But what I have noted is that I have to wait 3 to 5 sec using Sleep() before
calling OID_...SCAN and OID_..._LIST otherwise i dont get the updated list.

"Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message
news:4t4am2hkiwo2.dlg@tofik.homeip.net...
> Tue, 31 May 2005 22:09:29 +0300,
> microsoft.public.development.device.drivers, Pavel A.:
>
>> "Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message
>> news:1e9nxskr0q8le$.dlg@tofik.homeip.net...
>>> Yes. I wrote already that I don't know how to SET that oid. But I wonder
>>> how does it make NDISUIO service.
>>
>> NDISUIO (or clones of DDK Ndisprot sample ) is a real NDIS transport
>> driver, so the full set of NDIS intefaces is available to
>> it.
>>
>>> It seems to support a lots of w-lan cards
>>> (i tested it with 5 different cards). I can't belive that it uses a
>>> magic
>>> parameters specific for each card's manufacturer.
>>
>> It is an universal vehicle to send any NDIS request to 3rd party netcard
>> drivers.
>> It has nothing specific to wi-fi. Just study the ndisprot sample.
>> (if you work on WinCE OS, there it is different. I'm talking about NT
>> based Windows).
>>
>>> When I use NDISUIO and I set OID..._SCAN it seems to do real scan,
>>> because
>>> I need to wait a little bit longer until DeviceIoControl funcion
>>> returns.
>>> It is clearly noticeable on PocketPC. Sometimes it takes 2s until
>>> function
>>> returns and after reading the list through the oid.._list it always
>>> differs
>>> (new accespoints, rssi).
>>
>> Depends on the netcard driver. Scan can and should run asynchronously.
>> Holding the caller for 2 seconds is bad.
>>
>> Regards,
>> --PA
>
> thanks for discussion, friend.
>
>
> --
> Thanks,
> Wojtek
>
> E-mail hint: add [usenet] to the subject
> "Ipsa scientia potestas est."



Re: OID_802_11_BSSID_LIST_SCAN by Thomas

Thomas
Fri Jun 03 13:13:29 CDT 2005


"Arsalan Ahmad" <arsal__@hotmail.com> wrote in message
news:egvBYRGaFHA.796@TK2MSFTNGP10.phx.gbl...
> But what I have noted is that I have to wait 3 to 5 sec using Sleep()
> before calling OID_...SCAN and OID_..._LIST otherwise i dont get the
> updated list.
>
Have you read the MSDN topic "Scanning 802.11 Networks". It describes the
timing between starting a list scan and fetching the list. See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/network/hh/network/213_802.11_bb61b6ee-e9ab-4f03-aee3-c932fe2ea2a9.xml.asp

(Beware of wrap...)

Good luck,

Thomas F. Divine, Windows DDK MVP
http://www.rawether.net


Re: OID_802_11_BSSID_LIST_SCAN by Arsalan

Arsalan
Fri Jun 03 13:16:16 CDT 2005

sorry..what i wanted to say is what I have noted is that I have to wait 3 to
5 sec using Sleep() between
calling OID_...SCAN and OID_..._LIST otherwise i dont get the updated list
i.e.

Call OID_...LIST_SCAN

Wait for 3 or 5 sec

Call OID_LIST



"Arsalan Ahmad" <arsal__@hotmail.com> wrote in message
news:egvBYRGaFHA.796@TK2MSFTNGP10.phx.gbl...
> But what I have noted is that I have to wait 3 to 5 sec using Sleep()
> before calling OID_...SCAN and OID_..._LIST otherwise i dont get the
> updated list.
>
> "Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message
> news:4t4am2hkiwo2.dlg@tofik.homeip.net...
>> Tue, 31 May 2005 22:09:29 +0300,
>> microsoft.public.development.device.drivers, Pavel A.:
>>
>>> "Wojciech F." <"vankaszaner[REMOVE_IT]"@tlen.pl> wrote in message
>>> news:1e9nxskr0q8le$.dlg@tofik.homeip.net...
>>>> Yes. I wrote already that I don't know how to SET that oid. But I
>>>> wonder
>>>> how does it make NDISUIO service.
>>>
>>> NDISUIO (or clones of DDK Ndisprot sample ) is a real NDIS transport
>>> driver, so the full set of NDIS intefaces is available to
>>> it.
>>>
>>>> It seems to support a lots of w-lan cards
>>>> (i tested it with 5 different cards). I can't belive that it uses a
>>>> magic
>>>> parameters specific for each card's manufacturer.
>>>
>>> It is an universal vehicle to send any NDIS request to 3rd party netcard
>>> drivers.
>>> It has nothing specific to wi-fi. Just study the ndisprot sample.
>>> (if you work on WinCE OS, there it is different. I'm talking about NT
>>> based Windows).
>>>
>>>> When I use NDISUIO and I set OID..._SCAN it seems to do real scan,
>>>> because
>>>> I need to wait a little bit longer until DeviceIoControl funcion
>>>> returns.
>>>> It is clearly noticeable on PocketPC. Sometimes it takes 2s until
>>>> function
>>>> returns and after reading the list through the oid.._list it always
>>>> differs
>>>> (new accespoints, rssi).
>>>
>>> Depends on the netcard driver. Scan can and should run asynchronously.
>>> Holding the caller for 2 seconds is bad.
>>>
>>> Regards,
>>> --PA
>>
>> thanks for discussion, friend.
>>
>>
>> --
>> Thanks,
>> Wojtek
>>
>> E-mail hint: add [usenet] to the subject
>> "Ipsa scientia potestas est."
>
>