From 649c982e60d312e0a539f0c20d6ee4f2ea37ba40 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Mon, 10 Dec 2012 23:15:36 +0100 Subject: [PATCH] include: Define CONTAINING_RECORD using the standard offsetof. --- include/winnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/winnt.h b/include/winnt.h index 5f753bca2f5..467b42755b7 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -749,7 +749,7 @@ typedef struct _MEMORY_BASIC_INFORMATION #define FIELD_OFFSET(type, field) ((LONG)offsetof(type, field)) #define CONTAINING_RECORD(address, type, field) \ - ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field))) + ((type *)((PCHAR)(address) - offsetof(type, field))) /* Types */