I need to design a special file system that automatically close the FCB( by IRP_MJ_CLOSE ) when the user Close the File Handle or the Memory Mapping Handle or the user application crashed.
Usually at this time the system will holding one or more FCB reference. But my file system can not allow the system to retain FCB reference. It must be released immediately.
This file system is now nearing completion, but the above-mentioned features can not.
Note that this can only work if the user has not created a mapped view.
If the user did create a mapped view a) the purge could fail and b) it
wouldn’t matter since the user section will retain a reference anyway.
Expecting IRP_MJ_CLEANUP and IRP_MJ_CLOSE to mean one and the same thing
seems like a design that can’t really work (unless mapped sections are
disallowed.)