English 中文(简体)
Enumerate active GPRS connections on Windows Mobile
原标题:

I need to enumerate and close individual GPRS connections on a Windows Mobile device.

I ve tried the RAS API as suggested by this answer, however it doesn t work on all devices. RasEnumConnections on an HTC device does list GPRS sessions, but on a Samsung it doesn t.

The Samsung has a GUI app with this functionality - it makes a lot of use of ossvcs.dll but the functions it uses are only exported by ordinal, so I have no idea what they are!

I have also looked at Connection Manager API but it doesn t let you enumerate existing connections.

Any more ideas? Is there an API I ve missed?

最佳回答

Enumerating and closing connections is intentionally difficult. The general idea is that an application should not be forcibly terminating connections that do not belong to it because it very un-neighborly. It assumes that apps using the connection are prepared to have that connection torn out from under them, and that s not a valid assumption.

Even if you could enumerate the connections through connection manager, you still can t close them. You can only mark a connection as no longer in use by your application, so if the Connection Manager sees that no one is using it and the timeout for the connection expires, then it may close it.

RAS was a workaround/hack to get at those connections, but it s been deprecated so OEMs don t have to use RAS for managing connections, and it sounds like Samsung isn t using it. Instead they chose to have their own proprietary implementation.

The only way at that implementation would be through their own proprietary API, and it doesn t look like they publish it, so you d have to reverse engineer it. Even then it s going to be specific to their device, and brittle as it may change across versions.

My advice is to rethink the need to shut down all connections on the device.

问题回答

暂无回答




相关问题
Using maps on Windows Mobile

I m experimenting with maps on different mobile platforms. Getting Google Maps to work on Android was easy, following this tutorial. Getting the same to work on Windows Mobile is a different matter. ...

Build a Bitmap filling it with a smaller image

I m developing a Windows Mobile application with C# and .NET Compact Framework. I want to fill a Bitmap with an image that it s smaller. To fill this new Bitmap I want to repeat the image ...

Bing maps used offline: cache tiles from its web service

I m developing a Windows Mobile application that uses Bing Maps Web Service to show user s position on it. I think I have a problem if the user hasn t got internet service on his mobile, so I think I ...

Determine Mobile Internet Explorer version

I need to determine the version of Mobile Internet Explorer on a Windows Mobile 6.1 device. So that I can report the same user-agent string as is being used by Mobile Internet Explorer. The user-...

Custom listview control for windows mobile in c#

I need to develop a custom listview control (ie, i need two labels and a progress bar in each list item) . I am new to windows mobile so please help me with code samples.

In Which Languages Can I Develop For Windows Mobile?

Today my new HP iPAQ was delivered at my home, but now I want to know two things before I start any project: In which languages can I develop for it(Windows Mobile 5)? Where can I download this ...

热门标签