...
Access permissions for new created files are influenced controlled by a combination of the dwShareMode
and lpSecurityAttributes
, lpSecurityAttributes
, and {dwFlagsAndAttributes}} parameters.
The dwSharedMode
parameter is known as the sharing mode of a file. According to Microsoft, "An open file that is not shared cannot be opened again, either by the application that opened it or by another application, until its handle has been closed."
The lpSecurityAttributes
parameter is used to specify access controls for the newly created file. If this parameter is NULL
, the created file is assigned default access controls, which is inherited from the parent directory of the file.
The dwFlagsAndAttributes
is used to set the file attributes of the created file. For instance, this parameter can be used to specify whether or not a file is read only.
Risk Assessment
Creating files without appropriate access permissions may allow unintended access to those files.
...