Re: WZCQueryInterface by Paul
Paul
Fri Apr 11 10:36:48 PDT 2008
Referring to your other question, on the assumption that you're trying to
decide if you should disable an adapter or not, no, that's not how it would
do that. If you search the archives, using GoogleGroups to target
"microsoft.public.windowsce.*", you'll see my take on "disable network
adapter", which boils down to "set flag in registry entry for the adapter
you want to disable that corresponds to 'disabled'" followed by "tell NDIS
to turn off the power", and "unbind the adapter".
Paul T.
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:esGS$n$mIHA.5024@TK2MSFTNGP06.phx.gbl...
> Still not perfectly clear.
>
> You can tell if the adapter is connected to the extent that you might be
> able to communicate with something, you can use NDISUIO to send an
> IOCTL_NDISUIO_NIC_STATISTICS to that and check the MediaState field in the
> resulting structure for == MEDIA_STATE_CONNECTED. That's not perfect, as
> each adapter can set that whenever it wants, but it's usually a pretty
> good indicator that a wireless card is at least associated with the AP,
> though it may not yet have an assigned IP address, depending on who it's
> getting that from, what security it in place, etc.
>
> If you really want to be able to tell if you can communicate with a
> *specific* other host, try PINGing it! Or doing a tracert on it.
>
> Now, having said that, are we talking about Windows CE or XP? Platform
> Builder is Windows CE; powerscript, last I heard at least, is not. The
> information that you will get here is 99.99999% Windows CE.
>
> Paul T.
>
> "Void" <Void@discussions.microsoft.com> wrote in message
> news:CA2C00FF-C24D-4478-80E8-D845FB52B8D5@microsoft.com...
>> Connected through the wireless interface..as in..able to communicate with
>> an
>> other computer wirelessly. Im using powerscript. C++ is luxurious due to
>> the
>> insane amount of tutorials and guides for it as compared to powerscript.
>>
>> I dont have platform builder, but every forum i post in tells me to go
>> here.
>>
>> [CODE]
>> wzc_802_11_config_list stssid
>> intfs_key_table lo_pIntfs
>> intf_entry lo_intf
>> string ls_null, ls_guid
>> unsignedlong lul_inflags, lul_null, lul_ret
>>
>> lul_inflags = 4294967295 //all
>>
>> SetNull(ls_null)
>> SetNull(lul_null)
>>
>> lul_ret = WZCEnumInterfaces( ls_null, ref lo_pIntfs )
>> //lul_ret = 0
>>
>> as_guid = space(50)
>> memcpy(as_guid, lo_pIntfs.pIntfs[1], 100)
>> lo_intf.wszGuid = ls_guid
>> lul_ret = WZCQueryInterface(ls_null, lul_inflags, ref lo_intf, ref
>> lul_null)
>> //lul_ret = 0
>> //I can get the ssid authmode wepstatus all correctly
>> //ulMediaState always = 0
>>
>> memcpy(ref stssid, lo_intf.ptrstssidlist, lo_intf.stssidlistlength )
>> //copies no problem
>>
>> //stssid.wzc_wlan_config[1] (I can get macaddress ssid and the rest
>> except..)
>> //stssid.wzc_wlan_config[1].rssi always = 0
>>
>> [/CODE]
>>
>> Any Ideas?
>>
>> "Paul G. Tobey [eMVP]" wrote:
>>
>>> "Connected"? Give us a little more information about what *your*
>>> semantics
>>> of that are.
>>>
>>> Direct calls from what? What's luxurious about programming in C++?
>>> You're
>>> using assembly?
>>>
>>> Paul T.
>>>
>>> "Void" <Void@discussions.microsoft.com> wrote in message
>>> news:F3091BC1-FEF3-49A4-8715-58A3C674A983@microsoft.com...
>>> > Id like to know if im currently connected to through the wireless or
>>> > not.
>>> >
>>> > The stssidlist i am getting out of the raw data pdata pointer after
>>> > the
>>> > queryinterface call. It returns the WZC_WLAN_CONFIG.
>>> >
>>> > Unfortuantly i dont have the luxury of programming in C++ so im doing
>>> > this
>>> > with direct calls to the wzcsapi.dll and going through the bytes
>>> > returned
>>> > to
>>> > see what i get. I get the exact same bytes returned with the interface
>>> > connected that i get with it dissconnected.
>>> >
>>> > "Paul G. Tobey [eMVP]" wrote:
>>> >
>>> >> What are you wanting to do with the media state?
>>> >>
>>> >> I'm not sure where, exactly, you're getting the StSSID piece. I've
>>> >> had
>>> >> no
>>> >> problem getting the signal strength.
>>> >>
>>> >> Paul T.
>>> >>
>>> >> "Void" <Void@discussions.microsoft.com> wrote in message
>>> >> news:3E7061E5-4B4A-412E-8543-57C143C0FCA4@microsoft.com...
>>> >> > Hi,
>>> >> >
>>> >> > Im able to successfully query a wirless interface using
>>> >> > WZCQueryInterface.
>>> >> > But the meida state always returns 0 no matter the actual state.
>>> >> >
>>> >> > Also, when i grab the StSSID list, on every WZC_WLAN_CONFIG the
>>> >> > RSSI
>>> >> > is
>>> >> > always 0. Most everything else gets filled.
>>> >> >
>>> >> > Any ideas?
>>> >>
>>> >>
>>> >>
>>>
>>>
>>>
>
>