首页
社区
课程
招聘
[求助]NtQueryObject为何会造成程序死锁?
2008-2-25 11:38 11393

[求助]NtQueryObject为何会造成程序死锁?

2008-2-25 11:38
11393
我在查询一个进程中的句柄时 先用NtQuerySystemInformation查出信息
然后再NtQueryObject
但在查询一个句柄的时候 一直死锁在那了 不执行下去。
请问有没有人知道这是什么原因? 谢谢

[CTF入门培训]顶尖高校博士及硕士团队亲授《30小时教你玩转CTF》,视频+靶场+题目!助力进入CTF世界

收藏
点赞0
打赏
分享
最新回复 (9)
雪    币: 8188
活跃值: (4238)
能力值: ( LV15,RANK:2459 )
在线值:
发帖
回帖
粉丝
ccfer 16 2008-2-25 13:20
2
0
If the object to which the handle refers is a file object and the handle was opened
for synchronous access (by specifying FILE_SYNCHRONOUS_IO_ALERT or FILE_
SYNCHRONOUS_IO_NONALERT as CreateOptions), queries of this information class will be
synchronized with other file operations on the handle.
雪    币: 226
活跃值: (30)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
流动的情感 4 2008-2-25 13:38
3
0
请问有什么办法解决死锁问题吗? 或者用别的方法来查询句柄信息?
雪    币: 8188
活跃值: (4238)
能力值: ( LV15,RANK:2459 )
在线值:
发帖
回帖
粉丝
ccfer 16 2008-2-25 14:16
4
0
只是一点怀疑,我也不了解真实原因
雪    币: 226
活跃值: (30)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
流动的情感 4 2008-2-25 14:24
5
0
用创建线程超时的办法可以解决
但这样延长了运行时间 。有上千个句柄 执行一次要n久。。
唉。。 郁闷哦。
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
goodwinds 2008-3-17 09:24
6
0
怎么解决呢?
用多线程,一下子创建上百个,慢的很。
雪    币: 6071
活跃值: (2236)
能力值: (RANK:1060 )
在线值:
发帖
回帖
粉丝
forgot 26 2008-3-17 09:32
7
0
用IOCP吧,官方的说法好像是创建线程
雪    币: 325
活跃值: (97)
能力值: ( LV13,RANK:530 )
在线值:
发帖
回帖
粉丝
foxabu 13 2008-3-17 11:23
8
0
膜拜....
雪    币: 40
活跃值: (38)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
happyZore 2017-4-10 12:53
9
0
同问,这种该如何解决呢?
雪    币: 326
活跃值: (56)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
elapseyear 2017-4-12 09:37
10
0

Do  not  call  this  routine  from  kernel-mode  code;  instead,  call  the  ZwXxx  equivalent.

又查了一下The downfall of this API is that certain objects may hang when you attempt to query them. This is because those objects, for example, are opened with SYNC access and some of them really mean business. There are pipes opened on the system that if you attempt to query them will hang indefinitely.        

游客
登录 | 注册 方可回帖
返回