Re: INVALID_KERNEL_HANDLE when call ZwClose( )
- From: Mark Roddy <markr@xxxxxxxxxxxxxx>
- Date: Thu, 02 Aug 2007 09:44:30 -0400
Jia wrote:
Hi all,Don't supply invalid handles to ZwClose or any other kernel routine that requires handles. This is not user mode code, you really are expected to use valid handles, objects, pointers etc. and when you don't it is almost certain that Bad Things Will Happen. This bugcheck may only occur if a debugger is attached and you are closing a handle from a kernel system thread.
I met a problem when I call ZwClose( ) in kernel driver. If the
parameter is an invalid handle, it will BSOD, that is Bug Check 0x93:
INVALID_KERNEL_HANDLE, with parameter2 is "1". According to MSDN, this
means "the caller tried to close an invalid handle".
Howerver, also in MSDN, ZwClose( ) is said to return
STATUS_INVALID_HANDLE "if Handle is not a valid handle".
Is it inconsistency? How can I avoid this BSOD except to maintain a
handle list?
I used try and except, but it cannot grasp the problem. Is there any
function to check the handle validity?
.
- References:
- Prev by Date: Re: UMDF - Virtual HTTP File System
- Next by Date: Re: Modify the return value of IOCTL in disk.sys
- Previous by thread: INVALID_KERNEL_HANDLE when call ZwClose( )
- Next by thread: Re: INVALID_KERNEL_HANDLE when call ZwClose( )
- Index(es):
Relevant Pages
|
|