ModeToCreateFileFlags

Go to Home Page

Convert a set of STGM_ flags to their CreateFile equivalents

Syntax

HRESULT WINAPI ModeToCreateFileFlags (
    DWORD grfFlags,
    BOOL bCreate,
    DWORD* pDesiredAccess,
    DWORD* pShareMode,
    DWORD* pDisposition
)

Parameters

grfFlags
The collection of STGM_ openmode bit flags
bCreate
If grfFlags doesn't include STGM_CREATE, this flag should be nonzero to specify that the subsequent CreateFile will be to create a file, or zero to simple open an existing one.
pDesiredAccess
Pointer that receives the generic flags to be passed to CreateFile as the dwDesiredAccess parameter
pShareMode
Receives the sharing mode to be passed to CreateFile as the dwShareMode parameter
pDisposition
Receives the open disposition to be passed to CreateFile as the dwCreationDisposition parameter

Return Value

S_OK on success, a standard COM error on failure

Remarks

This function is also known as _ModeToCreateFileFlags@20.