Skip to content

fix: report native status and privilege errors accurately - #205

Open
MataM15 wants to merge 1 commit into
IgorMundstein:mainfrom
MataM15:fix/native-status-errors
Open

fix: report native status and privilege errors accurately#205
MataM15 wants to merge 1 commit into
IgorMundstein:mainfrom
MataM15:fix/native-status-errors

Conversation

@MataM15

@MataM15 MataM15 commented Sep 6, 2026

Copy link
Copy Markdown

Summary

Report native memory-operation failures using the correct Windows error semantics. This independent contribution is based on upstream main; candidate commit: 16f2026.

Related Issue

No exact issue identified. The two GCHandle initialization fixes already proposed in #195 and #203 are intentionally excluded to avoid duplicating that work.

Changes

  • Convert NTSTATUS through RtlNtStatusToDosError instead of reading unrelated last-error state.
  • Require both a successful AdjustTokenPrivileges call and ERROR_SUCCESS; capture the error immediately.
  • Correct the working-set privilege name in its diagnostic.
  • Add seven focused regression tests for status mapping and privilege-result combinations.

Checklist

  • My code follows the project’s coding style and conventions.
  • I have tested the changes locally.
  • I have updated documentation if necessary. No user-facing configuration change is introduced.
  • This PR does not introduce any breaking changes.
  • I have added unit tests if applicable.

Additional Notes

Standalone hosted Windows validation: Release build with 0 warnings and 0 errors; all 7 selected NUnit tests passed on this exact candidate. These are focused tests, not a claim that the entire suite or live cleanup scenarios were exercised.

The fork-only validation workflow, benchmark, packaging tools, and unrelated fork changes are not included. Scope: 5 files, 133 changed lines.

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.

1 participant