Resend - Winnt.h - CONTAINING_RECORD

Steven Edwards <steven_ed4153-/[email protected]> Wed, 8 Oct 2003 18:14:13 -0700 (PDT)
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <[email protected]>
Hello Danny,
I know this is already defined in winddk.h but it is also defined in
winnt.h in the PSDK. I need the macro in winnt.h to be able to build
imagehlp.dll from WINE for ReactOS. I dont think I am going to be able
to get the WINE people to use the w32api DDK and besides it is in the
real header so there might be apps out there that need this.

Thanks
Steven

2003-10-08  Steven Edwards  <Steven_Ed4153-/[email protected]>

	* include/winnt.h (CONTAINING_RECORD): Add Macro

Index: winnt.h
===================================================================
RCS file: /cvs/src/src/winsup/w32api/include/winnt.h,v
retrieving revision 1.78
diff -u -r1.78 winnt.h
--- winnt.h	7 Oct 2003 12:55:00 -0000	1.78
+++ winnt.h	9 Oct 2003 01:12:11 -0000
@@ -813,6 +813,11 @@
 #define RTL_CRITSECT_TYPE 0
 #define RTL_RESOURCE_TYPE 1
 #define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f))
+/* Also in winddk.h */
+#ifndef CONTAINING_RECORD
+#define CONTAINING_RECORD(address, type, field) ((type
*)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
+#endif /* CONTAINING_RECORD */
+/* Also in winddk.h */
 #define IMAGE_SIZEOF_FILE_HEADER	20
 #define IMAGE_FILE_RELOCS_STRIPPED	1
 #define IMAGE_FILE_EXECUTABLE_IMAGE	2




__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php