FlushFileBuffers in non-privileged user mode - Programmer

This is a discussion on FlushFileBuffers in non-privileged user mode - Programmer ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: FlushFileBuffers in non-privileged user mode

  1. 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?

    http://homepages.tesco.net./~J.deBoy.../put-down-the-
    chocolate-covered-banana.html>


  2. Re: FlushFileBuffers in non-privileged user mode

    On Oct 17, 8:00 pm, J de Boyne Pollard
    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?
    >
    > http://homepages.tesco.net./~J.deBoy.../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.



  3. Re: FlushFileBuffers in non-privileged user mode


    "Hirakawa" wrote in message
    news:1192632302.589691.319490@k35g2000prh.googlegr oups.com...
    > On Oct 17, 8:00 pm, J de Boyne Pollard
    > 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?
    >>
    >> http://homepages.tesco.net./~J.deBoy.../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.


    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



+ Reply to Thread