Supporting Special Files
Special files include paging files, dump files, and hibernation files. If the target device for your driver is a storage device that the system might use for these files, the driver must do the following:
Call WdfDeviceSetSpecialFileSupport to enable or disable support for each type of special file. (Each driver's support for special files is disabled by default.)
A bus driver that enumerates child devices should also call WdfDeviceSetSpecialFileSupport for each child device that can support special files.
Call WdfDeviceAddDependentUsageDeviceObject, if one device is dependent on another device when supporting special files.
Optionally provide an EvtDeviceUsageNotification or (starting in KMDF 1.11) EvtDeviceUsageNotificationEx callback function, so the driver will be notified when a special file is created or removed.
If your driver calls WdfDeviceSetSpecialFileSupport for a device, and if a special file is open on the device, the framework does not allow the PnP manager to remove or stop the device.
After a driver has called WdfDeviceAddDependentUsageDeviceObject, it can call WdfDeviceRemoveDependentUsageDeviceObject to remove a device's dependency on another device.