Re: FlushFileBuffers in non-privileged user mode



Hirakawa wrote:
On Oct 17, 8:00 pm, J de Boyne Pollard <j.deboynepoll...@xxxxxxxxx>
wrote:
H> Good day. I am currently working on an encryption software
H> that need to flush file cache before the software end.

Why do you think that it needs to do that?

H> Is there any other method I can try to make FlushFileBuffers
H> works in non-privileged user mode?

<URL:http://homepages.tesco.net./~J.deBoynePollard/FGA/put-down-the-
chocolate-covered-banana.html>

Hi, thank you for reply.

In Windows 2000 and XP user mode, if the working device that I am
using is a removable disk (either Flash Drive or HDD), I will have the
problem of data corruption or small file (<4k) lost. Therefore I need
to make sure that everything is flush back before user plug out or
safely remove the device.

'Safely remove' is good enough, it flushes for you.

To prevent caching problems at all just use FILE_FLAG_NO_BUFFERING
or FILE_FLAG_WRITE_THROUGH.


Uwe
.


Loading