PRB: Opening a File Twice with Compatible Sharing Modes Fails

ID: Q195606

The information in this article applies to:

SYMPTOMS

When one or more processes try to open the same file more than once with compatible access and sharing modes at nearly the same time, sometimes the second attempt to open the file fails with error 32 (ERROR_SHARING_VIOLATION).

CAUSE

This behavior can be caused by applications that are running that intercept calls to open a file to do their own processing first. These applications can open the file in an incompatible mode, causing subsequent attempts to open the file to fail with a sharing violation. A typical example of this type of application is a virus scanner.

RESOLUTION

To open the file without the error, do one of the following:

MORE INFORMATION

If an application, such as a virus scanner, is set up to check files when they are opened, the application might hold the file open in an incompatible mode while processing the file, causing other applications to receive sharing violations when attempting to open the file.

Additional query words:

Keywords          : kbAPI kbFileIO kbKernBase kbNTOS350 kbNTOS351 kbNTOS400 kbWinOS95 kbWinOS98 
Issue type        : kbprb

Last Reviewed: November 11, 1998