Setitng OID_802_11_SSID in XP SP2
- From: "John K Gummadi" <john@xxxxxxxxxx>
- Date: Mon, 18 Apr 2005 12:19:37 +0200
Hello,
I'm developing a WiFi tool. I could successfully implement it in Win2K and
XP (SP1) but I'm having problems with SP2 (XP).
This is what I'm doing:
////////////////////////////////////////////////////////////////////////////
/////////////////////
1. I disable microsoft WZC service (by doing "net stop wzcsvc") before my
software does any kind of Wifi related stuff.
2. hNdis = CreateFile("\\\\.\\\\Ndisuio", ...); //SUCCESS
3. DeviceIoControl (hNdis, IOCTL_NDISUIO_BIND_WAIT, ...); //SUCCESS
4. DeviceIoControl (hNdis, IOCTL_NDISUIO_OPEN_DEVICE,
L"\\DEVICE\\{CBBD6910-2191-4E07-8F88-6AB5FAABFE9B}", ...);
//SUCCESS
5.
NDIS_802_11_SSID ndis = {NULL};
memset(&ndis, 0, sizeof(ndis));
_tcscpy((TCHAR*)ndis.Ssid, "webtogo");
ndis.SsidLength = _tcslen((LPCTSTR)ndis.Ssid);
UCHAR buffer[sizeof(NDISUIO_SET_OID) + sizeof(NDIS_802_11_SSID)] = {NULL};
NDISUIO_SET_OID* poid = (NDISUIO_SET_OID*)buffer;
poid->Oid = OID_802_11_SSID;
memcpy(&poid->Data, &ndis, sizeof(NDIS_802_11_SSID));
DeviceIoControl (hNdis, IOCTL_NDISUIO_SET_OID_VALUE, poid,
sizeof(NDISUIO_SET_OID)+sizeof(NDIS_802_11_SSID), ...); // This
FAILED
//GetLastError gives 2 (The system cannot find the file specified).
////////////////////////////////////////////////////////////////////////////
/////////////////////
If device name was wrong, it should have given me error on point 4 (while
doing IOCTL_NDISUIO_OPEN_DEVICE). The same code works on XP-SP1 and on
Win2K.
I heard that WZC wont stop completely in SP2 and that we have to disable it
for each and every adapter. But if that was the case, why
"IOCTL_NDISUIO_OPEN_DEVICE" was successful? I did try disabling WZC for my
adapter though (without doing "net stop wzcsvc"). Then it gives error 170
("The requested resource is in use") for "IOCTL_NDISUIO_OPEN_DEVICE" though
it doesn't give any error while disabling WZC for my adapter.
I tried asking this question in "microsoft.public.win32.programmer.networks"
but was suggested to post it in this group.
Any ideas please?
Thanks,
John.
.
- Follow-Ups:
- RE: Setitng OID_802_11_SSID in XP SP2
- From: Pavel A.
- Re: Setitng OID_802_11_SSID in XP SP2
- From: John K Gummadi
- RE: Setitng OID_802_11_SSID in XP SP2
- Prev by Date: VFW development
- Next by Date: Biometric Fingerprint Reader
- Previous by thread: VFW development
- Next by thread: Re: Setitng OID_802_11_SSID in XP SP2
- Index(es):
Relevant Pages
|