Vista 上的 DeleteIpForwardEntry 访问被拒绝

发布于 2024-10-06 11:08:34 字数 343 浏览 0 评论 0原文

调用DeleteIpForwardEntry() 在Windows XP 和Windows 7 上工作得非常好。但是,在Windows Vista 上,它会失败并显示ERROR_ACCESS_DENIED。

该文档称“用户在本地计算机上缺乏所需的管理权限,或者应用程序没有作为内置管理员(RunAs 管理员)在增强的 shell 中运行。”

好吧,在我的例子中,用户是本地计算机上的管理员,应用程序是通过 SOFTWARE\Microsoft\Windows\CurrentVersion\Run 登录时运行的,所以我不能真正告诉它在“增强的 shell”中运行。

有没有办法解决 Vista 中的“第 22 条军规”问题?

Calling DeleteIpForwardEntry() works perfectly well on Windows XP and Windows 7. On Windows Vista, however, it fails with ERROR_ACCESS_DENIED.

The documentation says that "the user lacks the required administrative privileges on the local computer or the application is not running in an enhanced shell as the built-in Administrator (RunAs administrator)."

Well, in my case the user is the Administrator on the local computer and the application is run on logon via SOFTWARE\Microsoft\Windows\CurrentVersion\Run so I can't really tell it to run in an "enhanced shell".

Is there a way to solve this "Catch 22" situation in Vista?

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

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

发布评论

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

评论(1

魔法少女 2024-10-13 11:08:34

我不明白为什么这会在 Windows 7 上工作。文档表明失败将是相同的。

在 Windows Vista 及更高版本上,
DeleteIpForwardEntry函数只能
由以以下身份登录的用户调用
管理员组的成员。如果
DeleteIpForwardEntry 被调用
不是该组织成员的用户
管理员组、功能
调用将失败并出现 ERROR_ACCESS_DENIED
已返回。

此外,您的帖子表明登录用户是管理员。您的 Windows 7 和 Windows Vista 测试是否有可能针对不同的用户 - 在 Windows 7 上您的测试用户是管理员,在 Windows Vista 计算机上测试用户不是?

没有办法解决以这种方式运行应用程序的问题。您能否将其重新实现为在管理员帐户中运行的 Windows 服务,该服务作用于计算机上的交互式登录事件以根据需要操作 IP 配置?

I don't understand why this would work on Windows 7. The docs indicate the failure will be the same.

On Windows Vista and later, the
DeleteIpForwardEntry function can only
be called by a user logged on as a
member of the Administrators group. If
DeleteIpForwardEntry is called by a
user that is not a member of the
Administrators group, the function
call will fail and ERROR_ACCESS_DENIED
is returned.

Also, your post indicates the logged on user is an Administrator. Is it possible that your Windows 7 and Windows Vista tests are for different users - on Windows 7 your test user is an admin, on Windows Vista machine the test user is not?

There's no way to work around this running the app in that way. Can you re-implement this as a Windows Service running in an admin account, which acts on interactive logon events on the machine to manipulate the IP configuration as needed?

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