# os.windows.OpenFile: Add \`USER_MAPPED_FILE\` as a possible error · gitcafe/zig

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

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

Visibility: public

Requested revision: 5404d06ea9fe5f2c40e41adf7b8c15322c365ca8

Requested commit: 5404d06ea9fe5f2c40e41adf7b8c15322c365ca8

Commit: 5404d06ea9fe5f2c40e41adf7b8c15322c365ca8

Tree: 6a589bd2eebb26db207f3f4e10ee242f796c352c

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

````
os.windows.OpenFile: Add `USER_MAPPED_FILE` as a possible error

Ran into this when using a program that uses CreateFileMapping and then trying to call `std.fs.createFile` on the mapped file. More info can be found here:

https://stackoverflow.com/questions/41844842/when-error-1224-error-user-mapped-file-occurs

Before:

```
error.Unexpected NTSTATUS=0xc0000243
C:\Users\Ryan\Programming\Zig\zig\lib\std\os\windows.zig:138:40: 0x7ff74e957466 in OpenFile (test.exe.obj)
        else => return unexpectedStatus(rc),
                                       ^
```

After:

```
FAIL (AccessDenied)
C:\Users\Ryan\Programming\Zig\zig\lib\std\os\windows.zig:137:30: 0x7ff7f5b776ea in OpenFile (test.exe.obj)
        .USER_MAPPED_FILE => return error.AccessDenied,
                             ^
```

````

## Parents

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

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