Minifilter Driver hang while unload, enabled driver verifier

Hi,

my driver hanged during unload, WinDBG warns for leaked references.
Here is output of for leaked references,
it shows FLT_CONTEXT type refrences are leaked but I have used them at variuos places, is it possible which exact FltGetStreamHandleContext() leaked out of multiple calls
kd> !fltkd.filter FFFFFA80037F4CC0 8 1

*** Extension DLL(6721 Free) does not match target system(7600 Free)

FLT_FILTER: fffffa80037f4cc0 “myflt” “321480”
InstanceList : (fffffa80037f4d18)
Resource (fffffa80037f4d80) List [fffffa80037f4d80-fffffa80037f4d80] rCount=0
Object usage/reference information:
References to FLT_CONTEXT : 20
Allocations of FLT_CALLBACK_DATA : 0
Allocations of FLT_DEFERRED_IO_WORKITEM : 0
Allocations of FLT_GENERIC_WORKITEM : 0
References to FLT_FILE_NAME_INFORMATION : 0
Open files : 0
References to FLT_OBJECT : 0
List of objects used/referenced::
FLT_VERIFIER_OBJECT: fffffa800358d440
Object: fffffa8002531720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa80029e5130
Object: fffffa800258c720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa8003d23e40
Object: fffffa800266f720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa800418dc40
Object: fffffa800267b720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa8003b95d40
Object: fffffa800267d720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa8002f1c430
Object: fffffa8002683720 Type: FLT_CONTEXT RefCount: 00000001

many more

Thanks in advance.
~Sachin

Unrelated, but update your debugger. Looks like you’re using a very old
version

I’m not sure what your question is, this is pretty clearly saying you have a
reference leak in your code…Have you looked at the Context sample?

https://github.com/Microsoft/Windows-driver-samples/tree/master/filesys/miniFilter/ctx

-scott
OSR
@OSRDrivers

wrote in message news:xxxxx@windbg…

Hi,

my driver hanged during unload, WinDBG warns for leaked references.
Here is output of for leaked references,
it shows FLT_CONTEXT type refrences are leaked but I have used them at
variuos places, is it possible which exact FltGetStreamHandleContext()
leaked out of multiple calls
kd> !fltkd.filter FFFFFA80037F4CC0 8 1

*** Extension DLL(6721 Free) does not match target system(7600 Free)

FLT_FILTER: fffffa80037f4cc0 “myflt” “321480”
InstanceList : (fffffa80037f4d18)
Resource (fffffa80037f4d80) List [fffffa80037f4d80-fffffa80037f4d80]
rCount=0
Object usage/reference information:
References to FLT_CONTEXT : 20
Allocations of FLT_CALLBACK_DATA : 0
Allocations of FLT_DEFERRED_IO_WORKITEM : 0
Allocations of FLT_GENERIC_WORKITEM : 0
References to FLT_FILE_NAME_INFORMATION : 0
Open files : 0
References to FLT_OBJECT : 0
List of objects used/referenced::
FLT_VERIFIER_OBJECT: fffffa800358d440
Object: fffffa8002531720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa80029e5130
Object: fffffa800258c720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa8003d23e40
Object: fffffa800266f720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa800418dc40
Object: fffffa800267b720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa8003b95d40
Object: fffffa800267d720 Type: FLT_CONTEXT RefCount: 00000001
FLT_VERIFIER_OBJECT: fffffa8002f1c430
Object: fffffa8002683720 Type: FLT_CONTEXT RefCount: 00000001

many more

Thanks in advance.
~Sachin