4 ms·
I think it would have been nicer if this platform took the enum, and didn't the integer conversion at the FFI level, no? That should all be elided by optimisati
by alexchamberlain 3y ago
I think it would have been nicer if this platform took the enum, and didn't the integer conversion at the FFI level, no? That should all be elided by optimisations.
- jeroenhd 3y agoNTSTATUS is actually a combination of five types of information: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781 https://learn.microsoft.com/en-us/openspecs/windows_protocol... The first two bits indicate severity, the next bit identifies if it was OS generated or not, then there's an indicator to see if it can be turned into a HRESULT or not, then a bunch of bits indicating the source of the error, and lastly the error code relevant given the previously set bits. The Windows status codes could be converted, but the status codes generated by other drivers can't be. Even then the conversion would be far from free, you'd need to keep a close eye on your optimisations with every compiler version to keep them free. That also ignores the possibility programs have to classify their own status codes, so you'd need some kind of "unconvertible" object to indicate that you can't reliably parse the faculty ID, and that you have to treat it like a simple integer.