This is called the Standby List under the windows. You can flush it globally, either for a single volume or for a single file descriptor.
Globally
You can do this using an easily accessible program from Microsoft Technet by choosing Empty → Empty Standby List
Programmatically, you can achieve the same by using the undocumented function NtSetSystemInformation , for details, see line 239 in a program that performs, among other things, as mentioned earlier.
For one file descriptor
Open the file with FILE_FLAG_NO_BUFFERING . The documentation lies to the extent that it says that you open the file without buffering, but the true, observed behavior in all versions of Windows from Windows 98 to Windows 8 is that it simply discards the full cache contents for this file (for everyone! ) and does not overwrite the cache from reading using this descriptor.
For one full volume
A volume descriptor is just a file descriptor (somewhat special, but still), so assuming you have the appropriate privileges to open a volume descriptor, you can do the same for a full volume.
Also, as pointed out by Mehrdad, the answer here seems to be a function / error (function-error?) That allows you to invalidate cache volumes even without proper privileges, simply by opening it without shared records, at least under one last Windows version.
Obviously, this happens when any open that is writable is successful, since you can change the internal data of the file system (if it is a function), but it also seems to work when the volume fails (which is an error) .
Damon Apr 15 '14 at 13:23 2014-04-15 13:23
source share