GPRS connection network in Windows Mobile

Source: Internet
Author: User

Windows MobileProgramTo connect to the server using HTTP or socket, connect to the network first. You can use the connmgrestablishconnectionsync function to connect.

DWORD dwstatus = 0;
Handle hconnection = NULL;

Connmgr_connectioninfo sconinfo;
Memset (& sconinfo, 0, sizeof (connmgr_connectioninfo ));

Sconinfo. cbsize = sizeof (connmgr_connectioninfo );
Sconinfo. dwparams = connmgr_param_guiddestnet;
Sconinfo. dwpriority = connmgr_priority_userinteractive;

Sconinfo. dwflags = connmgr_flag_proxy_http
| Connmgr_flag_proxy_wap
| Connmgr_flag_proxy_socks4
| Connmgr_flag_proxy_socks5;

Sconinfo. bexclusive = false;
Sconinfo. bdisabled = false;
Sconinfo. guiddestnet = iid_destnetwap;

Connmgrestablishconnectionsync (& sconinfo, & hconnection, 15000, & dwstatus );

If you know the name of an access point, you can use connmgrenumdestinations to obtain the guiddestnet of the corresponding access point. Then you can use the underlying Inet interface to connect to HTTP. Are you finished? No. Another problem: the proxy server. We all know that mobile cmnet does not need a proxy, and cmwap does. The access point may contain proxy server information, and the access types include HTTP, WAP, secure WAP, and socks. Each type may require a different proxy. Do not expect the connmgrenumdestinations function to get so many things.

In fact, Microsoft provides a function, which is the legendary connmgrprovidermessage. How are you doing ?... Before you finish, go down.

I tested the result. On a real machine, this function has never been successful, never. Depressing. Is it related to the signature? Unknown.

A strong attack on the front is not acceptable. Do not shoot a gun, quietly entering the village. Let's take a look at the mobile phone registry. Detailed Access Point information is available under HKEY_LOCAL_MACHINE/comm/connmgr. All Access Points of the mobile phone are listed under the destinations subitem, and the corresponding key value is destid. Our eyes jump to the level with connmgr providers, there is a lot of information, one of the sub-item {EF097F4C-DC4B-4c98-8FF6-AEF805DC0E8E}, almost close to our baby. This item has many subitems. We traverse each item until we find a key value srcid that is equal to the destid we mentioned above. As you can see, there are many key values at the same level as srcid, But we currently need two types and proxies. Type is the access type (HTTP, WAP, secure WAP, socks, etc.) mentioned above, and proxy is a string of miserable characters.

The above is the result of Windows mobile5.0. In pocket pc2003 and smartphone2003, HKEY_LOCAL_MACHINE/comm/connmgr corresponds to HKEY_LOCAL_MACHINE/software/Microsoft/connmgr.

So far, the treasure hunt experience has come to an end.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.