Driver sometimes unloaded on Windows XP

I have strange problem when driver sometimes unable unregisters on XP:

  1. The problem occurs only on XP, not on Windows 7 kernel.
  2. All communication ports are closed before (unfortunately FltCloseCommunicationPort() has not return code).

But (only sometimes!) FltUnregisterFilter() does not returns!?!

Which other reasons (beside not closed ports) may be for this problem?

Thanks for advise,
Michael.

Look at the call stack.

Function names from MS’s symbols are rather speaking often :slight_smile:

wrote in message news:xxxxx@ntfsd…
>I have strange problem when driver sometimes unable unregisters on XP:
>
> 1. The problem occurs only on XP, not on Windows 7 kernel.
> 2. All communication ports are closed before (unfortunately FltCloseCommunicationPort() has not return code).
>
> But (only sometimes!) FltUnregisterFilter() does not returns!?!
>
> Which other reasons (beside not closed ports) may be for this problem?
>
> Thanks for advise,
> Michael.
>
>
>

Can you attach debugger to this machine? If it’s possible, you can check
!fltkd.filter output (see number of open handles, open ports, etc), you can
also turn on verifier. FltUnregisterFilter usually “hangs” when you’re still
keeping some references to volume/filter/file/… objects. You should
disable some parts of your driver and see if it helps and then try to find
out the leaking code.

Petr,
Thanks a lot!

I did not know about these commands :frowning: and now try to understand its (not short!) output using http://fsfilters.blogspot.co.il/2011/12/debugging-minifilters-using-fltkdfilter.html :slight_smile:

I afraid only, if I would see that, for example, not all ports are closed.
What I may do in this case?
Way it’s occurred sometimes?

But my current problem is reproduce the problem, it’s not easy.
I will try. :slight_smile:

Regards,
Michael.

Probably I found the solution.
But I don’t sure that it’s right and correct.

The solution is I added sleep 1sec. between FltCloseCommunicationPort() and FltUnregisterFilter().
It’s seen that problem disappear!?!

But I like to here Experts, is it possible that port does not closed synchronously, inside FltCloseCommunicationPort()?
For example, if application sends something to driver, but driver try to close port inside other port before the message has been processed?

Regards,
Michael.