【发布时间】:2021-09-22 18:18:36
【问题描述】:
我正在尝试在 Windows 内核驱动程序中使用 GetProcessImageFileNameW。
LPWSTR path[MAX_PATH];
if(GetProcessImageFileNameW(hProcess, path, MAX_PATH) == 0)
{
DbgPrint("Can't get the process image name");
return;
}
但是当我构建时出现编译器错误“Using uninitialized memory 'path'”
我该如何解决?
【问题讨论】:
-
请附上完整的错误信息。您可能想阅读minimal reproducible example。
-
对不起。但是可以在内核模式下调用
GetProcessImageFileNameW吗?而There is a SO question 提供了一个在驱动程序中获取当前进程映像文件全名的解决方案。