#ifndef _NTRTL_H #define RtlPointerToOffset(Base, Pointer) ((ULONG)(((PUCHAR)(Pointer)) - ((PUCHAR)(Base)))) #endif View code on GitHub
This function is documented in Windows Driver Kit.