# std.os.windows: handle OBJECT_NAME_INVALID in OpenFile \(\#19288\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 32f602ad167e90825ef1f980046a7611cfcfb5fe

Requested commit: 32f602ad167e90825ef1f980046a7611cfcfb5fe

Commit: 32f602ad167e90825ef1f980046a7611cfcfb5fe

Tree: 82f2eac428620e992caba8031953561b4f8e25a8

Author: Jonathan Marler

Committer: GitHub

## Message

```
std.os.windows: handle OBJECT_NAME_INVALID in OpenFile (#19288)

It's been seen on Windows 11 (22H2) Build 22621.3155 that NtCreateFile
will return the OBJECT_NAME_INVALID error code with certain path names.
The path name we saw this with started with `C:Users` (rather than
`C:\Users`) and also contained a `$` character.  This PR updates our
OpenFile wrapper to propagate this error code as `error.BadPathName`
instead of making it `unreachable`.

see https://github.com/marler8997/zigup/issues/114#issuecomment-1994420791
```

## Parents

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

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