通过 GetModuleHandle 使用 windows 内核函数

Using a windows kernal function via GetModuleHandle

我想使用 FsRtlIsDbcsInExpression (https://msdn.microsoft.com/en-us/library/windows/hardware/ff546803(v=vs.85).aspx) 进行通配符检查,与 Windows 完全相同,无需在我的程序中重新实现它。当我使用:

auto module = GetModuleHandle(TEXT("NtosKrnl.exe"));

模块变为空。根据我在 Internet 上可以找到的内容,由于这是内核模式函数,因此需要 KernelGetModuleBase。但是,此功能似乎不会自动解析,并且没有关于它的 msdn 文档,所以我怀疑这是否是解决方案。有人知道如何使用函数吗?

ntoskrnl 的 GetModuleHandle 将失败,因为它没有加载到您的内存中 space。您只能从内核中调用此类函数。

您可能想尝试使用函数 PathMatch 规范 (https://msdn.microsoft.com/en-us/library/windows/desktop/bb773727%28v=vs.85%29.aspx)。它似乎做同样的工作。