From: Giga Giguashvili [gregoryg@ParadigmGeo.com] Sent: Wednesday, September 01, 1999 6:43 PM To: Rob Green; ntdev@atria.com Subject: Re: [ntdev] What, no ZwFlushFile()? Another thing, I guess ntoskrnl.lib contains some of ZwXxx statically linked, so you really don't need to use special technique to use it. Please, correct me if I'm wrong. Regards, Giga. Rob Green wrote: > The actual call is ZwFlushBuffersFile but it is not exported by ntoskrnl so > is not easily accessible from kernel mode. i posted code several months > back that showed how to call it on Intel but not alpha machines. You > should be able to find it in the archives. The reason i am not posting it > again is that i got several nasty emails stating i shouldn't do it that way > ;( but no one suggested a work-around. The code worked fine on all > service packs up to 5 but could have broke any minute... > > I managed a work around, and if you want it, just email me. > > You can also use FILE_WRITE_THROUGH when creating/opening the file, and it > will keep the system from caching any writes (ie a call to ZwWriteFile will > NOT return until the data has been written to disk). Using > FILE_NO_INTERMEDIATE_BUFFERING will keep the data from being copied into > another buffer (that is paged aligned) before being written (if needed). > > rob > > At 11:32 PM 8/31/99 , Taed Nelson wrote: > >I was surprised at the lack of a ZwFlushFile() kernel function to force a > >given file to be written to disk. I looked at the various parameters for > >ZwCreateFile, and it looks like FILE_WRITE_THROUGH or > >FILE_NO_INTERMEDIATE_BUFFERING might be what I'm looking for, but the docs > >weren't clear enough for me. (Plus the latter one looks icky in that the > >buffers must follow certain rules.) > > > >Does anyone know if these are the right way, or how else I could (easily) > >get file writes to be written to the disk quickly? > > > >Note that I don't need it to be written immediately, but I don't want it > >being cached and not written for more than a minute or so. (Right now, I > >sometimes see it being cached and not written for an hour!) > > > >Thanks for any pointers! > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > >[ To unsubscribe, send email to ntdev-request@atria.com with body > >UNSUBSCRIBE (the subject is ignored). ] > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > [ To unsubscribe, send email to ntdev-request@atria.com with body > UNSUBSCRIBE (the subject is ignored). ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]