Connection Manager: What's in CONNMGR_CONNECTION_DETAILED_STATUS?

The CONNMGR_CONNECTION_DETAILED_STATUS struct tells the detailes information of all connections that connection manager can use to build connection path to satisfy a connection request at that point of time. It can be otabined by calling ConnMgrQueryDetailedStatus.

typedef struct _CONNMGR_CONNECTION_DETAILED_STATUS{

  struct _CONNMGR_CONNECTION_DETAILED_STATUS* pNext;

  DWORD dwVer;

  DWORD dwParams;

  DWORD dwType;

  DWORD dwSubtype;

  DWORD dwFlags;

  DWORD dwSecure;

  GUID guidDestNet;

  GUID guidSourceNet;

  TCHAR* szDescription;

  TCHAR* szAdapterName;

  DWORD dwConnectionStatus;

  SYSTEMTIME LastConnectTime;

  DWORD dwSignalQuality;

  CONNMGR_CONNECTION_IPADDR* pIPAddr;

} CONNMGR_CONNECTION_DETAILED_STATUS;

Two interesting fields of this struct are szAdapterName and szDescription. Here is the output from a HTC PPC with GPRS and WiFi active:

szAdapterName: szDescription

Cellular Line: T-Mobile USA

(NULL): SOCKS-{18AD9FBD-F716-ACB6-FD8A-1965DB95B814}

(NULL): HTTP-{18AD9FBD-F716-ACB6-FD8A-1965DB95B814}

(NULL): T-Mobile USA Proxy Internet

(NULL): null-corp-{18AD9FBD-F716-ACB6-FD8A-1965DB95B814}

(NULL): HTTP-{ADB0B001-10B5-3F39-27C6-9742E785FCD4}

TIACXWLN1: MCT

 

Observations:

1. The connected APN name (for example, ‘T-Mobile USA’) is in the szDescription field, with ‘Cellular Line’ as its adapter name. You can verify these two values by dumping CM_GPRSEntries using rapiconfig. The adapter name ‘Cellular Line’ is the DeviceName parameter in a GPRS entry provisioned to the device.

2. Wireless LAN adapter name varies on devices. Here the adapter name is ‘TIACXWLN1’. The connected SSID is MCT, as in the szDescription field.

3. All proxies, including null proxies are listed as connections. Their adapter name is ‘NULL’.

Update: the dwType field can be used to identify connection types:

dwType Value Description
CM_CONNTYPE_UNKNOWN Unknown connection.
CM_CONNTYPE_CELLULAR Cellular connection.
CM_CONNTYPE_NIC Network interface card (NIC) connection.
CM_CONNTYPE_BLUETOOTH Bluetooth connection.
CM_CONNTYPE_UNIMODEM Unimodem connection.
CM_CONNTYPE_VPN Virtual private network (VPN) connection.
CM_CONNTYPE_PROXY Proxy connection. For more proxy constants, see Connection Manager Proxy Flag Constants.
CM_CONNTYPE_PC PC connection.