All,
I am seeing this random crash on vista. This handle is kernel handle and is being opened using IoCreateFileSpecifyDeviceObjectHint function as follows. The handle value cc8 is correct, as when i dumped the free handle table i see the following
0: kd> !handle cc8 14
processor number 0, process fffffa80099ee710
PROCESS fffffa80099ee710
SessionId: 0 Cid: 1cb4 Peb: 7fffffde000 ParentCid: 0368
DirBase: 9f2b1000 ObjectTable: fffff88013aa3840 HandleCount: 103.
Image: DfrgNtfs.exe
Kernel Handle table at fffff8800196d000 with 664 Entries in use
0cc8: free handle, Entry address fffff88004665320, Next Entry 019aa5d8000003ec
So looks like this handle was closed, before i was trying to close it. There is not code which can close this handle in my driver.
Any idea who is closing this handle and why? Or how can i find out who is closing this handle before i am trying to close it. Well this issue is random, but happens atleast once a week. Any idea how can i track these handle and find out which is the process who closed it?
this is how handle was opened.
Status = IoCreateFileSpecifyDeviceObjectHint(
&fHandle,
GENERIC_READ,
&initializedAttributes,
&ioSB,
NULL,
FILE_ATTRIBUTE_NORMAL,
0,
FILE_OPEN,
FILE_WRITE_THROUGH|FILE_NO_INTERMEDIATE_BUFFERING|FILE_SYNCHRONOUS_IO_NONALERT,
NULL,
0,
CreateFileTypeNone,
NULL,
IO_IGNORE_SHARE_ACCESS_CHECK,
NULL);
if(!NT_SUCCESS(Status) ||
ioSB.Status == STATUS_REPARSE ||
ioSB.Status == STATUS_DIRECTORY_IS_A_REPARSE_POINT ||
ioSB.Status == STATUS_REPARSE_OBJECT)
{
LogEntry(LOG_LEVEL_DEBUG,“CreateFile: FAILED %wZ Status: %08lX”, uniFileName, Status);
return Status;
}
memory dump
INVALID_KERNEL_HANDLE (93)
This message occurs if kernel code (server, redirector, other driver, etc.)
attempts to close a handle that is not a valid handle.
Arguments:
Arg1: 0000000000000cc8, The handle that NtClose was called with.
Arg2: 0000000000000001, means an invalid handle was closed.
Arg3: 0000000000000000
Arg4: 0000000000000000