【发布时间】:2014-09-08 11:58:48
【问题描述】:
我正在开发一个简单的驱动程序来通知用户模式的进程创建! 我搜索了一个发现了一些很好的例子,但那只是在“dbgView”中显示结果!
我的问题是从PPS_CREATE_NOTIFY_INFO CreateInfo 检索并发送:ImageFileName 和CommandLine。
这是我在 CreateProcessNotifyEx 回调中的代码:
VOID CreateProcessNotifyEx(
__inout PEPROCESS Process,
__in HANDLE ProcessId,
__in_opt PPS_CREATE_NOTIFY_INFO CreateInfo
)
{ ...
Pinfo->ParentId = CreateInfo->ParentProcessId;
Pinfo->ProcessId = ProcessId;
Pinfo->Create = CreateInfo->CreationStatus;
Pinfo->ImageFileName= CreateInfo->ImageFileName;
Pinfo->CommandLine= CreateInfo->CommandLine;
..
KeSetEvent(ProcessEvent, 0, FALSE);
KeClearEvent(ProcessEvent);
....}
这段代码完美运行,我在用户模式下获得了 [b]Pinfo[/b] 结构,但 Pinfo->ImageFileName 和 Pinfo->CommandLine 不包含任何字符串! (Pinfo->ProcessId 和 Pinfo->通过真实数据创建填充)
我哪里错了?
{哦,如果我的英语不好,请见谅}
【问题讨论】:
-
根据该 API 的文档,此信息可能无法通过该 api 获得。
-
@Rohan 不,我确定此信息可用,因为使用
dbgprint(" %ws",CreateInfo->ImageFileName)时。在DebugView中写入CreateInfo->ImageFileName的值。
标签: c callback kernel createprocess