// ntifs.h
// CTL_CODE(0x0009, 0x09c, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define FSCTL_SET_PURGE_FAILURE_MODE 0x00090270
View the official Windows Driver Kit DDI referenceNo description available.
Filter Manager uses the FSCTL_SET_PURGE_FAILURE_MODE control code to synchronize operations during the lifetime of a section created for data scan. Filters should never issue this control code.
A SET_PURGE_FAILURE_MODE_INPUT structure.
Size in bytes of SET_PURGE_FAILURE_MODE_INPUT.
None
n/a
None
n/a
Reserved for system use.
Filter Manager uses this control code with IRP_MJ_FILE_SYSTEM_CONTROL calls to bracket the life of the section. These calls serve to instruct a file system (and, rarely, minifilters) to behave in the following manner if it fails to purge the Cache Manager caches.
For every FSCTL_SET_PURGE_FAILURE_MODE issued with SET_PURGE_FAILURE_MODE_ENABLED set, a FSCTL_SET_PURGE_FAILURE_MODE will be issued with the SET_PURGE_FAILURE_MODE_DISABLED set. While there is an outstanding SET_PURGE_FAILURE_MODE_ENABLED, Filter Manager responds as follows to certain failure statuses for certain types of operations (see below table):
To trigger the Filter Manager to respond accordingly, the file system (or filter) responds to a failure to purge a section in the following ways:
| Operation | Required return status |
|---|---|
| IRP_MJ_CREATE (destructive operations) | STATUS_USER_MAPPED_FILE |
| IRP_MJ_WRITE (unbuffered operations only) | STATUS_PURGE_FAILED |
| IRP_MJ_SET_INFORMATION | STATUS_PURGE_FAILED |
These statuses should only be returned while there is an outstanding SET_PURGE_FAILURE_MODE_ENABLED (no balancing SET_PURGE_FAILURE_MODE_DISABLED received). In all other cases, error statuses will be returned to the application.
For any other operation (for instance, a cached write), if the filesystem (or filter) fails to purge a section while there is an FSCTL_SET_PURGE_FAILURE_MODE outstanding then it is responsible for pending the operation and reissuing it when the count of outstanding FSCTL_SET_PURGE_FAILURE_MODE drops to zero. If the filesystem (or filter) just returns a failure status (including those listed above), that status will be returned to the application.
The error status is processed entirely within Filter Manager, as is the requeuing of the failed operation. This means that neither are visible to filters, which has the following important implications: