Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run in Windows7 #40

Open
vczh opened this issue Mar 28, 2019 · 2 comments
Open

Cannot run in Windows7 #40

vczh opened this issue Mar 28, 2019 · 2 comments
Labels
enhancement Fixed The issue has been fixed, but you need temporary manual steps to apply.

Comments

@vczh
Copy link
Member

vczh commented Mar 28, 2019

I fixed the issue by skipping APIs in non-supported OS: WinNativeDpiAwareness.cpp.

Code in the Release repo has been updated, but a new version is not made. Please download the source code from the Release repo directly, instead of downloading the latest release.

@vczh vczh added the Fixed The issue has been fixed, but you need temporary manual steps to apply. label Mar 28, 2019
@MouriNaruto
Copy link

本来想完全用英文的,由于我英文不大好,发现写到一半写不下去,于是使用中文反馈了。

我已经阅读了你修复后的实现,但是我有些疑惑。

从 MSDN 文档上,我们可以得知 GetModuleHandle API 的描述是 "Retrieves a module handle for the specified module. The module must have been loaded by the calling process." 。

在你的实现中,你使用这个 API 来获取 user32.dll 和 shcore.dll 的模块句柄。咱们都知道,user32.dll 每个 现代的能运行图形应用的 Windows 的映像实例都是存在的且只要是图形应用这个动态链接库就已经被进程加载。

但是 shcore.dll 的话,你是否存在可靠的证据来确定只要有这个动态链接库的 Windows 映像实例的进程只要是图形应用时就一定会把 shcore.dll 加载进进程呢。如果你没有可靠的证据保证的话,感觉使用 LoadLibrary API 是明智的选择。当然确定这点的时候一定是要那没有打任何补丁的 Windows 映像实例来验证的,原因我感觉你能理解的。

当然,如果你要确定使用 LoadLibrary API 的时候,我希望您能把动态链接库劫持缓解机制也考虑进去。这方面的话,直接解释做法,还不如给你看我写的代码更加清楚。

参考:https://github.com/M2Team/NSudo/blob/052ac2b295c13e7f52404caf58870960f99ff666/NSudoSDK/M2WindowsHelpers.cpp#L1419

毛利

@vczh
Copy link
Member Author

vczh commented May 7, 2019

@MouriNaruto 这么说来我还真不知道shcore会不会被load进去,不过win7好像没这个dll,我得找个win8来试试。

@vczh vczh closed this as completed Jul 18, 2020
@vczh vczh reopened this Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Fixed The issue has been fixed, but you need temporary manual steps to apply.
Projects
None yet
Development

No branches or pull requests

2 participants