After successful MrxCreateSrvCall no MrxUnload is called

Hi at all,

i’m new here and i’m going to write a network redirector. i hope you can help me.
My problem is that i successfully can create a SRV_CALL and RDBSS calls the right funtions (MRxSrvCallWinnerNotify, MRxExtractNetRootName, MRxCreateVNetRoot). Every function returns with ERROR_SUCCESS. Now everthing is fine BUT if i try to shutdown the driver not all necessary handles are closed so that no MrxUnload (it’s the function for DriverUnload) is called.
My question is, what have i to do or deallocate or destroy or decrement so that no handle is remaining?

>BUT if i try to shutdown the driver
What do you mean by this? Do you call RxStopMinirdr and then SCM? Take look into MRxSmb sample. It is present in the pre WDK 7000.

Anyway you must be extremely careful while you are unloading File System driver and I think it is not supported, but doable. I personally use it only in development environment.

Bronislav Gabrhelik

Thanks for answering.
To shutdown the driver i first call RxStopMinirdr and then send SERVICE_CONTROL_STOP, right. i have studied the SmbMrx sample very carefully.
Curiously if a MrxCreateSrvCall fails, unloading is no problem, but if it succeeds the minirdr won’t unload anymore. Any ideas?


Don’t you keep opened handle to your control device while unloading?

I have reported some bugs for mini-redirector samples. You can find links in this thread.

I suspect that the latest one can be your problem. It causes that scavenger doesn’t purge file from the system cache, so you never get IRP_MJ_CLOSE for opened file.

Bronislav Gabrhelik

i already read this list of bugs and this was very helpful.
Very interesting is the last bug, it might be the reason… i will test the redirector on server 2008.

thank you very much for your help!