Setitng OID_802_11_SSID in XP SP2

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.


.



Relevant Pages

  • Setitng OID_802_11_SSID in XP SP2
    ... I'm developing a WiFi tool. ... XP but I'm having problems with SP2. ... I heard that WZC wont stop completely in SP2 and that we have to disable it ... adapter though. ...
    (microsoft.public.development.device.drivers)
  • How to use WZC but disable its GUI?
    ... Is it possible to enable WZC but disable its GUI? ... I think I just uncovered a sad flaw with WZC: If you uncheck "Notify me ... So I need a way to keep the WiFi periodic scan at ~30sec while disabling any ...
    (microsoft.public.windowsce.platbuilder)
  • stopping internet hacks
    ... I run in win2k with a cable modem and leave my computer on ... Will disabling the local area connection prevent ANY ...
    (microsoft.public.win2000.security)
  • Re: Command Prompt Security Question
    ... >I am looking for how I can do the following on Win2K: ... In disabling cmd.exe, can I set up only two programs to run ... > Any pointers to further resources would be great too! ...
    (microsoft.public.win2000.cmdprompt.admin)