数组个数
#ifndef ARRAYSIZE
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
#endif
获得结构体首地址
#define CONTAINING_RECORD(address, type, field) ((type *)( \
(PCHAR)(address) - \
(ULONG_PTR)(&((type *)0)->field)))
eg:ScanMessage = CONTAINING_RECORD(Overlapped, SCAN_MESSAGE, Overlapped);
获得距离结构体首地址的偏移
#define FIELD_OFFSET(type, field) ((LONG)(LONG_PTR)&(((type *)0)->field))
eg:FIELD_OFFSET(SCAN_MESSAGE, Overlapped)