前言:2014-08-06记录在hi baidu上,现在移过来
winnt.h中定义的宏
//
// Calculate the address of the base of the structure given its type, and an
// address of a field within the structure.
//
#define CONTAINING_RECORD(address, type, field) ((type *)( \
(PCHAR)(address) - \
(ULONG_PTR)(&((type *)0)->field)))
(ULONG_PTR)(&((type*)0)->field) 计算field相对于基地址的偏移