mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
fixed the CONTAINING_RECORD macro
svn path=/trunk/; revision=16966
This commit is contained in:
parent
91907678f1
commit
0f4524a978
3 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue