DesiredAccess
Specifies an ACCESS_MASK value that determines the requested access to the object. In addition to the access rights that are defined for all types of objects (see ACCESS_MASK), the caller can specify any of the following access rights, which are specific to files: ACCESS_MASK Flag Allows Caller to Do This
FILE_READ_DATA Read data from the file.
FILE_READ_ATTRIBUTES Read the file's attributes. (For more information, see the description of the FileAttributes parameter.)
FILE_READ_EA Read the file's extended attributes (EAs). This flag is irrelevant for device and intermediate drivers.
FILE_WRITE_DATA Write data to the file.
FILE_WRITE_ATTRIBUTES Write the file's attributes. (For more information, see the description of the FileAttributes parameter.)
FILE_WRITE_EA Change the file's extended attributes (EAs). This flag is irrelevant for device and intermediate drivers.
FILE_APPEND_DATA Append data to the file.
FILE_EXECUTE Use system paging I/O to read data from the file into memory. This flag is irrelevant for device and intermediate drivers.
Caution Do not specify FILE_READ_DATA, FILE_WRITE_DATA, FILE_APPEND_DATA, or FILE_EXECUTE when creating or opening a directory.
The caller can only specifies a generic access right, GENERIC_XXX, for a file, not a directory. Generic access rights corresponds to specific access rights as follows:
Generic Access Right Set of Specific Access Rights
GENERIC_READ STANDARD_RIGHTS_READ, FILE_READ_DATA, FILE_READ_ATTRIBUTES, FILE_READ_EA, and SYNCHRONIZE.
GENERIC_WRITE STANDARD_RIGHTS_WRITE, FILE_WRITE_DATA, FILE_WRITE_ATTRIBUTES, FILE_WRITE_EA, FILE_APPEND_DATA, and SYNCHRONIZE.
GENERIC_EXECUTE STANDARD_RIGHTS_EXECUTE, FILE_EXECUTE, FILE_READ_ATTRIBUTES, and SYNCHRONIZE. This value is irrelevant for device and intermediate drivers.
GENERIC_ALL FILE_ALL_ACCESS. //这个权限你怎么判断后续操作
If the file is actually a directory, the caller can also specify the following generic access rights:
DesiredAccess Flag Allows Caller to Do This
FILE_LIST_DIRECTORY List the files in the directory.
FILE_TRAVERSE Traverse the directory—in other words, include the directory in the path of a file.