ntapi
ntapi copied to clipboard
Fix temporary references for volatile read
Taking a reference to an unaligned field is an undefined behavior, even if it is converted to a pointer immediately. Although the memory access here must be aligned given the fixed base address and the offset of the field, rustc still issue a warning due to the struct being 4 packed. Here we can use core::ptr::addr_of to create a pointer to a field without introducing a reference.
Fixes #11.