Opens a new file, an existing file, or a replacement for an existing file and returns a protected file handle. An open file can have extended attributes.
#define INCL_DOSFILEMGR
#include <os2.h>
PSZ pszFileName; /* Address of the ASCIIZ path name of the file or device to be opened. */
PHFILE phf; /* Address of the handle for the file. */
PULONG pulAction; /* A pointer to the ULONG in which the value that specifies the action taken by DosProtectOpen is returned. */
ULONG cbFile; /* New logical size of the file (end of data, EOD), in bytes. */
ULONG ulAttribute; /* File attributes. */
ULONG fsOpenFlags; /* The action to be taken depending on whether the file exists or does not exist. */
ULONG fsOpenMode; /* The mode of the open function. */
PEAOP2 peaop2; /* A pointer to an extended attribute buffer. */
PFHLOCK pfhFileHandleLockID;
APIRET ulrc; /* Return Code. */
ulrc = DosProtectOpen(pszFileName, phf, pulAction,
cbFile, ulAttribute, fsOpenFlags,
fsOpenMode, peaop2, pfhFileHandleLockID);