Consider the following scenario:
- You open or create a file by calling a function and setting the FILE_FLAG_DELETE_ON_CLOSE flag on a computer that is running Windows Server 2003, Windows Vista, or Windows Server 2003.
- You create a file mapping object for the file and then create a mapped view object for the file mapping object.
- You close the file before the mapped view is unmapped.
- You try to lock the volume that stores the file by calling the DeviceIoControl function together with a FSCTL_LOCK_VOLUME control code.
In this scenario, the DeviceIoControl function fails and an ERROR_ACCESS_DENIED error is returned.
This problem affects applications that use the DeviceIoControl function to lock a volume. For example, some backup applications may crash or raise exceptions unexpectedly.