#ifndef _PHNT_WINDOWS_H #define CONTAINING_RECORD(address, type, field) \ ((type *)((ULONG_PTR)(address) - UFIELD_OFFSET(type, field))) #endif View code on GitHub
This macro is documented in Windows SDK.