Windows 7 x64:低 IL 进程 msdn 示例不起作用

发布于 2024-09-07 06:53:36 字数 269 浏览 3 评论 0原文

我想从中等完整性级别的进程创建低完整性级别的进程。 我找到了 msdn 示例:设计应用程序以低完整性级别运行

但它在我的系统上不起作用。进程创建成功,但出现消息框

“应用程序无法正确初始化(0xC0000022 -- STATUS_ACCESS_DENIED) ...” 出现了。有人遇到同样的问题吗?

I want to create process with low integrity level from process with medium integrity level.
I found msdn example: Designing Applications to Run at a Low Integrity Level

But it does not work on my system. Process is created successfully, but message box

"Alpplication failed to initialized properly(0xC0000022 -- STATUS_ACCESS_DENIED) ..."
is appeared. Did anybody meet the same problem?

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

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

发布评论

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

评论(2

戴着白色围巾的女孩 2024-09-14 06:53:36

我也遇到了这个。示例中使用的 SID 不正确。它应该是“S-1-16-4096”,而不是“S-1-16-1024”。

I ran into this too. The SID used in the example is incorrect. It should be "S-1-16-4096", not "S-1-16-1024".

水染的天色ゝ 2024-09-14 06:53:36

我对@dyared 的答案投了赞成票,因为它帮助我找到了完整的答案。我首先要指出的是,我并不专门研究这个问题,这只是我的发现的总结。

看来 MSDN 示例不适用于指定的 SID 字符串,因为它指定的完整性级别太低。来自Chromium 的源代码,示例中使用的 S-1-16-1024 SID 介于 INTEGRITY_LEVEL_BELOW_LOWINTEGRITY_LEVEL_UNTRUSTED

const wchar_t* GetIntegrityLevelString(IntegrityLevel integrity_level) {
  switch (integrity_level) {
    case INTEGRITY_LEVEL_SYSTEM:
      return L"S-1-16-16384";
    case INTEGRITY_LEVEL_HIGH:
      return L"S-1-16-12288";
    case INTEGRITY_LEVEL_MEDIUM:
      return L"S-1-16-8192";
    case INTEGRITY_LEVEL_MEDIUM_LOW:
      return L"S-1-16-6144";
    case INTEGRITY_LEVEL_LOW:
      return L"S-1-16-4096";
    case INTEGRITY_LEVEL_BELOW_LOW:
      return L"S-1-16-2048";
    case INTEGRITY_LEVEL_UNTRUSTED:
      return L"S-1-16-0";
    case INTEGRITY_LEVEL_LAST:
      return NULL;
  }

此外,@dyared 建议的 SID S-1-16-4096 似乎也在启动 Internet Explorer 时使用保护模式,如 在 Windows Vista 上以保护模式创建进程 MSDN 博客上的文章。

然而,因为足以让示例正常工作并不意味着它对于每种情况都足够严格,并且必须在了解其含义的情况下选择适当的完整性级别。

I have upvoted @dyared's answer because it helped me find the complete answer. I should mention first that I am not specialized in this matter and this is only a summary of my findings.

It seems that the MSDN example does not work with the specified SID string because it specifies an integrity level that is too low. From the Chromium's source code, the S-1-16-1024 SID used in the example is between INTEGRITY_LEVEL_BELOW_LOW and INTEGRITY_LEVEL_UNTRUSTED:

const wchar_t* GetIntegrityLevelString(IntegrityLevel integrity_level) {
  switch (integrity_level) {
    case INTEGRITY_LEVEL_SYSTEM:
      return L"S-1-16-16384";
    case INTEGRITY_LEVEL_HIGH:
      return L"S-1-16-12288";
    case INTEGRITY_LEVEL_MEDIUM:
      return L"S-1-16-8192";
    case INTEGRITY_LEVEL_MEDIUM_LOW:
      return L"S-1-16-6144";
    case INTEGRITY_LEVEL_LOW:
      return L"S-1-16-4096";
    case INTEGRITY_LEVEL_BELOW_LOW:
      return L"S-1-16-2048";
    case INTEGRITY_LEVEL_UNTRUSTED:
      return L"S-1-16-0";
    case INTEGRITY_LEVEL_LAST:
      return NULL;
  }

Furthermore, it seems that the SID S-1-16-4096, suggested by @dyared, is also used when launching Internet Explorer in protected mode, as claimed in Creating a Process in Protected Mode on Windows Vista article on MSDN Blogs.

However, because it was enough to get the example working does not mean it is strict enough for every situation and choosing the appropriate integrity level must be made understanding its implications.

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