Windows 2008:当 __COMPAT_LAYER=ElevateCreateProcess 时应用程序崩溃
有一个应用程序可以在Windows 2008中正常启动,我们称之为App1。
当同一应用程序由另一个应用程序(Launcher)启动时,App1 在 secure32.dll 中崩溃。 研究表明,这两个案例的环境不同。
当应用程序崩溃时,其环境有一个额外的变量 __COMPAT_LAYER=ElevateCreateProcess。
在全局系统级别设置 __COMPAT_LAYER=asInvoker 无法解决该问题。 将 App1 和 Launcher 添加到注册表 HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers 也无法解决该问题。
这两个程序在其清单中都有以下权限:requestedExecutionLevel level="asInvoker" uiAccess="false"
UAC 已关闭。 Windows 更新是最新的。 唯一有帮助的解决方案是在两者之间注入另一个程序来清除 __COMPAT_LAYER 或将其设置为 asInvoker。
ElevateCreateProcess 的原因可能是什么以及如何避免?谢谢。
There is application that can be started properly by Windows 2008, lets call it App1.
When the same application is started by another application (Launcher), App1 crashes in secur32.dll.
Research indicated environment in those 2 cases was different.
When application crashes, it's environment has one extra variable __COMPAT_LAYER=ElevateCreateProcess.
Setting __COMPAT_LAYER=asInvoker on a global system level didn't resolve the issue.
Adding App1 and Launcher to registry at HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers also doesn't resolve it.
Both programs have the following permission in their manifests: requestedExecutionLevel level="asInvoker" uiAccess="false"
UAC is turned off. Windows updates are up to date.
The only solution that helps is injecting another program in between that clears the __COMPAT_LAYER or sets it to asInvoker.
What can possibly be the cause of ElevateCreateProcess and how to avoid it? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
造成此行为的原因可能是您的启动器进程的命名。 Windows 使用 ElevateCreateProcess 标志增强了与命名模式“*launch*.exe”匹配的每个进程。这种尴尬的行为是在 windows\apppatch\sysmain.sdb shim 数据库中指定的。您可以通过安装并运行应用程序兼容性工具包来查看这一点。在“系统数据库(32 位)/应用程序/自动运行”下,您可以找到此条目。尽管禁用也可能存在风险,但右键单击 ->禁用条目在我的情况下也不起作用。
The cause of this behavior might be the naming of your Launcher process. Windows augments every process matching the naming pattern "*launch*.exe" with the ElevateCreateProcess Flag. This awkward behavior is specified in the windows\apppatch\sysmain.sdb shim database. You can view this by installing and running the application compatibility Toolkit. Under "System Database (32-bit)/Applications/Autorun" you can find this entry. Although disabling might be risky as well, rightclick -> Disable Entry does not work in my case either.
事实证明,该问题是由在 dll 初始化期间调用 GetUserName 引发的,该问题在 Vista 上崩溃。相关帖子是https://groups.google.com/group/microsoft.public.win32.programmer.kernel/browse_thread/thread/ae1b1e4ecbb6b123/1e9fefd4c8b12452
As it turns out the issue was prompted by calling GetUserName during dll init which crashes on Vista. Related post is https://groups.google.com/group/microsoft.public.win32.programmer.kernel/browse_thread/thread/ae1b1e4ecbb6b123/1e9fefd4c8b12452