pinvoke
pinvoke copied to clipboard
Change NTSTATUS/HResult FACILITY_CODE to match CsWin32 definitions
- [ ] Move shift operation by FacilityShift to Get property accessor
- [ ] (Optional) Add bit mask of 0xC0000000
e.g. property generated by CsWin32:
public Severity SeverityCode => (Severity)(((uint)this.Value & 0xc0000000) >> 30);
Why?
I was having trouble determining the "true" values of the Facility Codes and nearly opened a separate issue after seeing FACILITY_DEBUGGER was not assigned 1.
Can you send a PR with the proposed change?
Sure! I should have time to work on it in the next few days.
While working on it, I noticed a minor compatibility issue. If a downstream library explicitly depends on the existing, bit-shifted enum values, the library/app will no longer behave as expected when they update their package references.
In light of this, I'll submit a followup PR for ~~SeverityCode~~ FacilityCode so these two compatibility changes can be published together.
I'll leave fields such as CustomerCode as-is for now. "*Shifted" properties can be added later if needed e.g. "CustomerCodeShifted".
P.S. I've been spending a lot of today figuring out a GPG issue that's preventing me from committing.
P.P.S. Finally re-learned that Git needs gpg4win registered as its gpg application. Haven't done that in a few years.