# Use a specific access mask in \`Dir.openDirListW\` instead of a generic one\. Untested\. · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/51c57408794ae4411a0059d7f9d30b47d83a534e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 51c57408794ae4411a0059d7f9d30b47d83a534e

Requested commit: 51c57408794ae4411a0059d7f9d30b47d83a534e

Commit: 51c57408794ae4411a0059d7f9d30b47d83a534e

Tree: 621db53675761a044714e5138a34bc1b099ea2c3

Author: Jonathan S

Committer: Andrew Kelley

## Message

```
Use a specific access mask in `Dir.openDirListW` instead of a generic one. Untested.

The actual desired access mask in this case seems quite confusing and badly documented. The previous combination of `GENERIC_READ` and `SYNCHRONIZE` seems both illegal and redundant according to the [`ntifs.h` documentation](https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntcreatefile), which specifies that `GENERIC_READ` should not be used for directories and includes `SYNCHRONIZE`. `winnt.h` contains a number of relevant-sounding flags such as `FILE_ADD_FILE`, `FILE_ADD_SUBDIRECTORY`, and `FILE_DELETE_CHILD` that do not show up in documentation at all. These are equal in value to file-specific flags that are documented as flags you should not specify when opening a directory.

```

## Parents

- [07120c87451636f65d2917f0355b4493034a2c0f](https://git.cafe/gitcafe/zig/commit/07120c87451636f65d2917f0355b4493034a2c0f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/51c57408794ae4411a0059d7f9d30b47d83a534e?format=markdown)
