CONTAINING_RECORD - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#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.