Click here to Skip to main content
15,791,602 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre5-Oct-09 11:37
MrMcIntyre5-Oct-09 11:37 
GeneralRe: C++ Helper Wanted Pin
David Crow6-Oct-09 3:19
David Crow6-Oct-09 3:19 
AnswerRe: C++ Helper Wanted Pin
Richard MacCutchan6-Oct-09 4:08
mveRichard MacCutchan6-Oct-09 4:08 
GeneralRe: C++ Helper Wanted Pin
MrMcIntyre6-Oct-09 6:25
MrMcIntyre6-Oct-09 6:25 
GeneralRe: C++ Helper Wanted Pin
Richard MacCutchan6-Oct-09 6:49
mveRichard MacCutchan6-Oct-09 6:49 
GeneralRe: C++ Helper Wanted Pin
Big Daddy Farang6-Oct-09 9:22
Big Daddy Farang6-Oct-09 9:22 
GeneralRe: C++ Helper Wanted Pin
Richard MacCutchan6-Oct-09 11:25
mveRichard MacCutchan6-Oct-09 11:25 
QuestionActive scan on a WiFi NIC, including flush of old scan results - how ? Pin Pin
amitalonm4-Oct-09 4:09
amitalonm4-Oct-09 4:09 
Hi,

I wrote a program using VC++ that should scan for available wireless networks in the area.

In my SW I use the commands OID_802_11_BSSID_LIST_SCAN and OID_802_11_BSSID_LIST.

My questions are:
1. How can I Force the Wireless NIC to do ACTIVE SCAN (as contrary to PASSIVE scan) ?

2. According to tests that I did, the card does not flush the list between scans, i.e. I get for several scan a result of an AP that was on air during an old scan, but is no longer there, and new scans return's it's data as if it is still there.

A code part that I used is attached - in order to illustrate which functions I am using.

NDIS_802_11_BSSID_LIST* m_pBSSIDList;
m_pBSSIDList = (NDIS_802_11_BSSID_LIST *) VirtualAlloc (NULL,
                                                        sizeof (NDIS_802_11_BSSID_LIST) * NUMBEROF_BSSIDS,
                                                        MEM_RESERVE | MEM_COMMIT,
                                                        PAGE_READWRITE) ;


memset (m_pBSSIDList, 0, sizeof (NDIS_802_11_BSSID_LIST) * NUMBEROF_BSSIDS);

// Do Scan
oidcode = OID_802_11_BSSID_LIST_SCAN;
DeviceIoControl (m_handle,
		IOCTL_NDIS_QUERY_GLOBAL_STATS,
		&oidcode,
		sizeof(oidcode),
		(ULONG *) NULL,
		0,
		&bytesreturned,
		NULL);

Sleep (6100); // According to the documentation the result of the scan should be valid after 6 seconds.
// The original line was delay of 2000 mSec. find out why...
//Sleep (2000);

// Read scan results
oidcode = OID_802_11_BSSID_LIST;
if (DeviceIoControl(    m_handle,
			IOCTL_NDIS_QUERY_GLOBAL_STATS,
			&oidcode,
			sizeof(oidcode),
			(ULONG *) m_pBSSIDList,
			sizeof(NDIS_802_11_BSSID_LIST) * NUMBEROF_BSSIDS,
			&bytesreturned,
			NULL) == 0)
{
	// List failed
	return NULL;
}
else
{
	return m_pBSSIDList;
}




If you have any idea of how can I solve my problems, or if you see that I forgot any important line- please let me know.
I am open to hear about completely new ways to do this. only requirement is that I will use VC++.

Thanks a lot,
--Amit.
AnswerRe: Active scan on a WiFi NIC, including flush of old scan results - how ? Pin Pin
David Crow5-Oct-09 6:08
David Crow5-Oct-09 6:08 
GeneralRe: Active scan on a WiFi NIC, including flush of old scan results - how ? Pin Pin
amitalonm5-Oct-09 11:06
amitalonm5-Oct-09 11:06 
QuestionRe: Active scan on a WiFi NIC, including flush of old scan results - how ? Pin Pin
David Crow5-Oct-09 11:14
David Crow5-Oct-09 11:14 
AnswerRe: Active scan on a WiFi NIC, including flush of old scan results - how ? Pin Pin
amitalonm5-Oct-09 11:58
amitalonm5-Oct-09 11:58 
GeneralRe: Active scan on a WiFi NIC, including flush of old scan results - how ? Pin Pin
fibers21-Dec-09 17:45
fibers21-Dec-09 17:45 
GeneralRe: Active scan on a WiFi NIC, including flush of old scan results - how ? Pin Pin
amitalonm23-Dec-09 3:13
amitalonm23-Dec-09 3:13 
Question[Message Deleted] Pin
Infinite1UP4-Oct-09 3:52
Infinite1UP4-Oct-09 3:52 
AnswerRe: File Path Error Message - VC++ 6 & wxWidgets Pin
Richard MacCutchan4-Oct-09 5:38
mveRichard MacCutchan4-Oct-09 5:38 
GeneralRe: File Path Error Message - VC++ 6 & wxWidgets Pin
Infinite1UP4-Oct-09 16:17
Infinite1UP4-Oct-09 16:17 
GeneralRe: File Path Error Message - VC++ 6 & wxWidgets Pin
Richard MacCutchan4-Oct-09 23:23
mveRichard MacCutchan4-Oct-09 23:23 
QuestionGrid Control Questions Pin
tsjcs4-Oct-09 2:34
tsjcs4-Oct-09 2:34 
AnswerRe: Grid Control Questions Pin
Rolf Kristensen4-Oct-09 23:12
Rolf Kristensen4-Oct-09 23:12 
GeneralRe: Grid Control Questions Pin
kilt9-Oct-09 0:47
kilt9-Oct-09 0:47 
Questionexe not works on Vista 32 bit Pin
Aabid3-Oct-09 23:15
Aabid3-Oct-09 23:15 
AnswerRe: exe not works on Vista 32 bit Pin
Michael Schubert4-Oct-09 0:39
Michael Schubert4-Oct-09 0:39 
GeneralRe: exe not works on Vista 32 bit Pin
Aabid4-Oct-09 1:25
Aabid4-Oct-09 1:25 
GeneralRe: exe not works on Vista 32 bit Pin
Richard MacCutchan4-Oct-09 2:33
mveRichard MacCutchan4-Oct-09 2:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.