Error 1224 (ERROR_USER_MAPPED_FILE) - what is it?

2060 views
Skip to first unread message

Charlie Gibbs

unread,
Feb 1, 2008, 9:17:51 PM2/1/08
to
Occasionally, when I try to open a file for writing, I get error code
1224 (ERROR_USER_MAPPED_FILE). The full text corresponding to this
code is "The requested operation cannot be performed on a file with
a user-mapped section open."

This condition only occurs once in a while, at a couple of the 2000
or so installations where this program runs (under Win2K or XP).
There's nothing special about the file; it's a text file containing
data which I want to preserve from run to run. During initialization,
my program opens this file, reads its contents into memory, then
closes it. The memory image contains totals that are updated while
the program runs. Upon shutdown (usually after running for several
hours to a day), the program opens the file for output, writes out
the updated totals, then closes the file. No other program uses
this file - or even knows that it exists - and the one program that
maintains it only has it open for a fraction of a second at startup
and again at shutdown. There are no known resource leaks, and I'm
quite meticulous about closing files as soon as I'm done with them.

I've tried adding error handling code that displays the file's
attribute bits (only FILE_ATTRIBUTE_ARCHIVE is set), as well as
running Sysinternals utility HANDLE.EXE, which states that nobody
has the file open.

Does anyone have any idea what this error means?

--
/~\ cgi...@kltpzyxm.invalid (Charlie Gibbs)
\ / I'm really at ac.dekanfrus if you read it the right way.
X Top-posted messages will probably be ignored. See RFC1855.
/ \ HTML will DEFINITELY be ignored. Join the ASCII ribbon campaign!

David Lowndes

unread,
Feb 2, 2008, 4:47:12 AM2/2/08
to
>Occasionally, when I try to open a file for writing, I get error code
>1224 (ERROR_USER_MAPPED_FILE). The full text corresponding to this
>code is "The requested operation cannot be performed on a file with
>a user-mapped section open."
>
>This condition only occurs once in a while, at a couple of the 2000
>or so installations where this program runs (under Win2K or XP).

I'd suspect interference from an anti-virus program. Can you check if
these users have an AV installed, and whether the problem disappears
if they remove it.

Dave

Charlie Gibbs

unread,
Feb 4, 2008, 1:31:50 PM2/4/08
to
In article <dte8q397ojqa5lotc...@4ax.com>,
Dav...@example.invalid (David Lowndes) writes:

Thanks, I'll check that one out.

nicolas....@gmail.com

unread,
Feb 6, 2008, 2:09:56 PM2/6/08
to
On Feb 4, 10:31 am, "Charlie Gibbs" <cgi...@kltpzyxm.invalid> wrote:
> In article <dte8q397ojqa5lotc64ieojt56atgua...@4ax.com>,
>
> Dav...@example.invalid (David Lowndes) writes:
> >> Occasionally, when I try toopenafilefor writing, I get error code

> >> 1224 (ERROR_USER_MAPPED_FILE). The full text corresponding to this
> >> code is "Therequestedoperationcannotbeperformedon afilewith
> >> auser-mappedsectionopen."
>
> >> This condition only occurs once in a while, at a couple of the 2000
> >> or so installations where this program runs (under Win2K or XP).
>
> > I'd suspect interference from an anti-virus program. Can you check if
> > these users have an AV installed, and whether the problem disappears
> > if they remove it.
>
> Thanks, I'll check that one out.

I've had this, and initially thought that I had too many files open
(forgot to close some files)
Actually, when reading other answers, I realized I have a regular
automatic backup that runs on the affected files.

Pooja Batra

unread,
Jan 30, 2021, 12:44:48 PMJan 30
to
How the issue got resolved? I am getting same error randomly

Pooja Batra

unread,
Feb 5, 2021, 1:18:35 AMFeb 5
to
Please revert
Reply all
Reply to author
Forward
0 new messages