fixed the CONTAINING_RECORD macro

svn path=/trunk/; revision=16966
This commit is contained in:
Thomas Bluemel 2005-08-02 11:23:40 +00:00
parent 91907678f1
commit 0f4524a978
3 changed files with 5 additions and 5 deletions

View file

@ -213,8 +213,8 @@ typedef struct _REG_VALUE
* 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

View file

@ -4744,8 +4744,8 @@ KfReleaseSpinLock(
* 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

View file

@ -890,7 +890,7 @@ typedef enum
#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