I use the code below (end of post) for querying encryption status on a
pocket pc device running mobile 2003.
I have the wireless device configured to connect to a given access point
using WPA and TKIP and I use a certificate for my EAP type. The device
connects fine to the secure AP, but the value I get from
OID_802_11_ENCRYPTION_STATUS is 5, which is Ndis802_11Encryption2KeyAbsent.
From the docs... Indicates that there are no transmit keys available for
use by TKIP or WEP, and TKIP and WEP are enabled; AES is not enabled.
I use basically the same setup in an app on a winxp machine connecting to
the same AP and I query the value of the encryption status using WMI and get
a value of 4, which is Ndis802_11Encryption2Enabled. From the docs...
Indicates that TKIP and WEP are enabled; AES is not enabled, and a transmit
key is available.
On my mobile device, under the network key tab for configuring the
authentication, the checkbox for 'The key is provided for me automatically'
is set by default and I can't change it when I haev WPA and TKIP set.
So my question is, why am I getting a result of
Ndis802_11Encryption2KeyAbsent on my mobile? I'm expecting the same value
that I get on my XP machine. How do I make it so this key is not absent?
Thanks,
Andrew
NDISUIO_QUERY_OID query;
query.ptcDeviceName = devicename;
query.Oid = OID_802_11_ENCRYPTION_STATUS;
DWORD ReturnedCount = 0;
BOOL success;
if (DeviceIoControl(
device,
IOCTL_NDISUIO_QUERY_OID_VALUE,
&query,
sizeof(NDISUIO_QUERY_OID),
&query,
sizeof(NDISUIO_QUERY_OID),
&ReturnedCount,
NULL))
{
status = *(query.Data);
}