首页
社区
课程
招聘
[旧帖] ZwQueryInformationProcess获取路径名是乱码,大哥大哥来看看 0.00雪花
发表于: 2016-3-3 23:21 2947

[旧帖] ZwQueryInformationProcess获取路径名是乱码,大哥大哥来看看 0.00雪花

2016-3-3 23:21
2947
帮我解决一下,这个我就搞一天,我都不想编程了。

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 112
活跃值: (12)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
ZwQueryInformationProcess(getCurrentProcess,ProcessImageFileName,@pbi,sizeof(pbi),@returnedLength);
看看NtQueryInformationProcess源码
2016-3-4 00:33
0
雪    币: 8
活跃值: (21)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
UNICODE_STRING
When the ProcessInformationClass parameter is ProcessImageFileName, the buffer pointed to by the ProcessInformation parameter should be large enough to hold a UNICODE_STRING structure as well as the string itself. The string stored in the Buffer member is the name of the image file.

If the buffer is too small, the function fails with the STATUS_INFO_LENGTH_MISMATCH error code and the ReturnLength parameter is set to the required buffer size.

sizeof(pbi)写成1000,调试看到buffer里为路径名,不是乱码了。可是会报错啊
2016-3-4 01:52
0
雪    币: 364
活跃值: (1586)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
4
pbi.Buffer没分配空间,OutputDebugString pbi.buffer最好是‘\0‘结尾
2016-3-4 10:08
0
雪    币: 225
活跃值: (173)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
楼上正解。最后转换为DELPHI字符串
2016-3-4 10:55
0
游客
登录 | 注册 方可回帖
返回
//