We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Sharing Constants

Constants for file-sharing modes.

#include <share.h>

The shflag argument determines the sharing mode, which consists of one or more manifest constants. These can be combined with the oflag arguments (see File Constants).

The following table lists the constants and their meanings:




Denies read and write access to file


Denies write access to file


Denies read access to file


Permits read and write access


Sets secure mode (shared read, exclusive write access).