The KeMemoryBarrierWithoutFence routine creates a barrier at its position in the code—across which the compiler cannot move any operations.
This routine has no parameters.
The compiler can optimize your code by reordering the execution of operations. You can inhibit this behavior by calling KeMemoryBarrierWithoutFence—which prevents the compiler from moving any operation that appears before the call to a position after that call, and vice versa.
However, note that the processor can reorder operations as it executes them. To prevent the both the processor and the compiler from reordering operations, call the KeMemoryBarrier routine.
|Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)