Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FlushViewOfFile() fails with error 33

88 views
Skip to first unread message

The Joe

unread,
Jun 18, 2003, 11:59:13 AM6/18/03
to
Hi All,
I wrote a dll which maps and unmaps different portions of
a filemapping (MapViewOfFile, UnmapViewOfFile with
different offsets). Periodically, a thread of the dll
flushes all the protions which are currently mapped
(FlushViewOfFile). However, this thread often fails to map
some views of the mapping. The last error in those cases
is 33 : ERROR_LOCK_VIOLATION.
Does anyone have a clue how to resolve this problem?

Thanks for your help,

Tony Proctor

unread,
Jun 20, 2003, 4:54:40 AM6/20/03
to
I believe I've come up against this same problem myself about 1 year ago.
It happened under W2K, but not NT4, and only when the process got to a
certain size. My diagnosis was that the normal virtual memory paging was
already flushing selected pages back to disk from my 'view' when I'd called
FlushViewOfFile.

My fix was to trap this error, wait a very short interval, and repeat the
flush. It always worked on the 2nd attempt.

I didn't like this fix, but I could find no documentation or "PRB:" reports
suggesting that the situation was even a possibility.

Tony Proctor

"The Joe" <er...@nice.com> wrote in message
news:088b01c335b2$90561fc0$a001...@phx.gbl...

0 new messages