Re: User Access Rights



Gary Larimer <GaryLarimer@xxxxxxxxxxxxxxxxxxxxxxxxx> writes:

What is the correct method for using CreateFile() to open a file when the
user access rights may vary. Do you call function GetFileSecurity()
followed by an if() else construct which selects the proper form of
CreateFile():

You could use MAXIMUM_ALLOWED as the access mask in CreateFile.
However, that could also give extra permissions such as WRITE_DAC,
and I don't know if there is a way to check the actual permissions
assigned to a handle, other than by calling e.g. WriteFile and
checking for errors.
.