FlushFileBuffers in non-privileged user mode
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:[url]http://homepages.tesco.net./~J.deBoynePollard/FGA/put-down-the-[/url]
chocolate-covered-banana.html>
Re: FlushFileBuffers in non-privileged user mode
On Oct 17, 8:00 pm, J de Boyne Pollard <j.deboynepoll...@tesco.net>
wrote:[color=blue]
> 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:[url]http://homepages.tesco.net./~J.deBoynePollard/FGA/put-down-the-[/url]
> chocolate-covered-banana.html>[/color]
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.
Re: FlushFileBuffers in non-privileged user mode
"Hirakawa" <hirakawa@csc.jp> wrote in message
news:1192632302.589691.319490@k35g2000prh.googlegroups.com...[color=blue]
> On Oct 17, 8:00 pm, J de Boyne Pollard <j.deboynepoll...@tesco.net>
> wrote:[color=green]
>> 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:[url]http://homepages.tesco.net./~J.deBoynePollard/FGA/put-down-the-[/url]
>> chocolate-covered-banana.html>[/color]
>
> 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.[/color]
Firstly this is something the "Safely Remove hardware" is there for. Use it!
Secondly, before you close your file you should FlushFileBuffers() before
you close a file.
Thirtdly, i think you could use DeviceIoControl with FSCTL_DISMOUNT_VOLUME
yourself... after asking the user if (s)he really want to disconnect the
device....and you have to convince why they would use your tool to do it
while Windows already have such a tool.
- Sten