Skip to content

DiskUtils: size Windows real-path buffers precisely - #255

Open
hamdiakin wants to merge 1 commit into
ForNeVeR:mainfrom
hamdiakin:perf/windows-real-path-buffer
Open

hamdiakin wants to merge 1 commit into
ForNeVeR:mainfrom
hamdiakin:perf/windows-real-path-buffer

Conversation

@hamdiakin

Copy link
Copy Markdown
Contributor

Closes #252.

Separates a hard GetFinalPathNameByHandle failure from an insufficient buffer response. Hard failures now return immediately, while long paths retry once with the exact size reported by Windows instead of renting the maximum 32K-character buffer. The pooled buffer is returned through finally on every path.

Adds a Windows integration test covering canonicalization beyond the initial 256-character buffer and records the behavior change in the changelog.

Verification:

  • dotnet test --configuration Release — 493 passed locally
  • dotnet build -p:CheckXmlDoc=true --no-incremental — 0 warnings, 0 errors
  • git diff --check

@ForNeVeR
ForNeVeR self-requested a review October 26, 2026 21:54
@ForNeVeR ForNeVeR self-assigned this Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DiskUtils.GetWindowsRealPathByHandle retries GetFinalPathNameByHandle after a hard failure and ignores the required buffer size

2 participants