fixed the CONTAINING_RECORD macro
Modified: trunk/reactos/tools/mkhive/registry.h
Modified: trunk/reactos/w32api/include/ddk/winddk.h
Modified: trunk/reactos/w32api/include/winnt.h

Modified: trunk/reactos/tools/mkhive/registry.h
--- trunk/reactos/tools/mkhive/registry.h	2005-08-02 03:56:29 UTC (rev 16965)
+++ trunk/reactos/tools/mkhive/registry.h	2005-08-02 11:23:40 UTC (rev 16966)
@@ -213,8 +213,8 @@
  *          Type = Type of the whole structure
  *          Field = Name of the field whose address is none
  */
-#define CONTAINING_RECORD(Address,Type,Field) \
-	(Type *)(((LONG)Address) - FIELD_OFFSET(Type,Field))
+#define CONTAINING_RECORD(address, type, field) \
+    ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
 
 
 #define REG_NONE 0

Modified: trunk/reactos/w32api/include/ddk/winddk.h
--- trunk/reactos/w32api/include/ddk/winddk.h	2005-08-02 03:56:29 UTC (rev 16965)
+++ trunk/reactos/w32api/include/ddk/winddk.h	2005-08-02 11:23:40 UTC (rev 16966)
@@ -4744,8 +4744,8 @@
  *   IN PCHAR  Field);
  */
 #ifndef CONTAINING_RECORD
-#define CONTAINING_RECORD(Address, Type, Field) \
-  ((Type *) (((ULONG_PTR) Address) - FIELD_OFFSET(Type, Field)))
+#define CONTAINING_RECORD(address, type, field) \
+  ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
 #endif
 
 /* LONG

Modified: trunk/reactos/w32api/include/winnt.h
--- trunk/reactos/w32api/include/winnt.h	2005-08-02 03:56:29 UTC (rev 16965)
+++ trunk/reactos/w32api/include/winnt.h	2005-08-02 11:23:40 UTC (rev 16966)
@@ -890,7 +890,7 @@
 #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)))
+  ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
 #endif
 /* end winddk.h */
 #define IMAGE_SIZEOF_FILE_HEADER	20