From 29598fc7e089ff7fddb7a1bf4ac5b61600b5c132 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Mon, 13 Oct 2003 05:22:30 +0000 Subject: [PATCH] 2003-10-13 Steven Edwards * include/winnt.h (CONTAINING_RECORD): Add macro. --- winsup/w32api/ChangeLog | 4 ++++ winsup/w32api/include/winnt.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog index 52864d790..0bfeb685c 100644 --- a/winsup/w32api/ChangeLog +++ b/winsup/w32api/ChangeLog @@ -1,3 +1,7 @@ +2003-10-13 Steven Edwards + + * include/winnt.h (CONTAINING_RECORD): Add macro. + 2003-10-13 Danny Smith * include/winnt.h: (FILE_SUPERSEDED, FILE_OPENED, FILE_CREATED, diff --git a/winsup/w32api/include/winnt.h b/winsup/w32api/include/winnt.h index a376cfe4d..9002aa885 100644 --- a/winsup/w32api/include/winnt.h +++ b/winsup/w32api/include/winnt.h @@ -806,7 +806,13 @@ typedef DWORD FLONG; #define MESSAGE_RESOURCE_UNICODE 1 #define RTL_CRITSECT_TYPE 0 #define RTL_RESOURCE_TYPE 1 +/* Also in winddk.h */ #define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f)) +#ifndef CONTAINING_RECORD +#define CONTAINING_RECORD(address, type, field) \ + ((type*)((PCHAR)(address) - (PCHAR)(&((type *)0)->field))) +#endif +/* end winddk.h */ #define IMAGE_SIZEOF_FILE_HEADER 20 #define IMAGE_FILE_RELOCS_STRIPPED 1 #define IMAGE_FILE_EXECUTABLE_IMAGE 2 -- 2.43.5