Skip to content

Commit cbc7aa0

Browse files
github-actions[bot]Copilotjkotas
authored
[release/10.0] Add ERROR_NETNAME_DELETED to IsPathUnreachableError for Windows localhost removal (#124869)
Backport of #121569 to release/10.0 /cc @jozkee @Copilot ## Customer Impact - [ ] Customer reported - [x] Found internally This only affects `ResolveLinkTarget(returnFinalTarget: true)`. Code first tries to open the final file via `OpenSafeFileHandle` as an optimized approach, and when that fails it checks IsPathUnreachableError to decide whether to fall back to manually traversal with `DeviceIoControl`. Since `ERROR_NETNAME_DELETED` was not being categorized as a path unreachable error, the fallback never happens and an `IOException` is thrown instead. We don't have customer reports yet, but we expect them to come eventually, and this is technically a `regression-from-last-release`. ## Regression - [x] Yes - [ ] No This is a regression caused by a Windows OS update that removed localhost support. The error started appearing in CI builds around October 2025. ## Testing The original PR #121569 was merged to main on November 13, 2025 and resolved the CI failures. ## Risk Low. The change adds a single error code constant (ERROR_NETNAME_DELETED = 0x40) and includes it in the existing `IsPathUnreachableError` pattern match alongside other similar network path error codes (ERROR_BAD_NETPATH, ERROR_BAD_NET_NAME, ERROR_NETWORK_ACCESS_DENIED, etc.) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
1 parent 19e7456 commit cbc7aa0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/libraries/Common/src/Interop/Windows/Interop.Errors.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ internal static partial class Errors
2626
internal const int ERROR_HANDLE_EOF = 0x26;
2727
internal const int ERROR_NOT_SUPPORTED = 0x32;
2828
internal const int ERROR_BAD_NETPATH = 0x35;
29+
internal const int ERROR_NETNAME_DELETED = 0x40;
2930
internal const int ERROR_NETWORK_ACCESS_DENIED = 0x41;
3031
internal const int ERROR_BAD_NET_NAME = 0x43;
3132
internal const int ERROR_FILE_EXISTS = 0x50;

src/libraries/Common/src/System/IO/FileSystem.Attributes.Windows.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Interop.Errors.ERROR_INVALID_NAME or
121121
Interop.Errors.ERROR_BAD_PATHNAME or
122122
Interop.Errors.ERROR_BAD_NETPATH or
123123
Interop.Errors.ERROR_BAD_NET_NAME or
124+
Interop.Errors.ERROR_NETNAME_DELETED or
124125
Interop.Errors.ERROR_INVALID_PARAMETER or
125126
Interop.Errors.ERROR_NETWORK_UNREACHABLE or
126127
Interop.Errors.ERROR_NETWORK_ACCESS_DENIED or

0 commit comments

Comments
 (0)