枚举 Windows Mobile 上的活动 GPRS 连接

发布于 2024-08-22 05:06:34 字数 407 浏览 4 评论 0原文

我需要枚举并关闭 Windows Mobile 设备上的各个 GPRS 连接。

我已经按照 这个答案的建议尝试了 RAS API,但是它没有不适用于所有设备。 HTC 设备上的 RasEnumConnections 确实会列出 GPRS 会话,但在 Samsung 上却不会。

三星有一个具有此功能的 GUI 应用程序 - 它大量使用了 ossvcs.dll,但它使用的功能仅按序号导出,所以我不知道它们是什么!

我还查看了连接管理器 API,但它不允许您枚举现有连接。

还有更多想法吗?有没有我错过的 API?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

究竟谁懂我的在乎 2024-08-29 05:06:34

枚举和关闭连接是故意困难的。一般的想法是,应用程序不应该强行终止不属于它的连接,因为它非常不邻居。它假设使用该连接的应用程序准备好从它们下面断开该连接,但这不是一个有效的假设。

即使您可以通过连接管理器枚举连接,您仍然无法关闭它们。您只能将连接标记为应用程序不再使用,因此如果连接管理器发现没有人在使用它,并且连接超时已到,则可能会关闭它。

RAS 是获取这些连接的一种解决方法/黑客手段,但它已被弃用,因此 OEM 不必使用 RAS 来管理连接,而且听起来三星并没有使用它。相反,他们选择拥有自己的专有实现。

该实现的唯一方法是通过他们自己的专有 API,而且看起来他们没有发布它,所以你必须对其进行逆向工程。即使这样,它也将是特定于他们的设备的,并且很脆弱,因为它可能会随着版本的变化而变化。

我的建议是重新考虑是否需要关闭设备上的所有连接。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文