mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +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
|
* Type = Type of the whole structure
|
||||||
* Field = Name of the field whose address is none
|
* Field = Name of the field whose address is none
|
||||||
*/
|
*/
|
||||||
#define CONTAINING_RECORD(Address,Type,Field) \
|
#define CONTAINING_RECORD(address, type, field) \
|
||||||
(Type *)(((LONG)Address) - FIELD_OFFSET(Type,Field))
|
((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
||||||
|
|
||||||
|
|
||||||
#define REG_NONE 0
|
#define REG_NONE 0
|
||||||
|
|
|
@ -4744,8 +4744,8 @@ KfReleaseSpinLock(
|
||||||
* IN PCHAR Field);
|
* IN PCHAR Field);
|
||||||
*/
|
*/
|
||||||
#ifndef CONTAINING_RECORD
|
#ifndef CONTAINING_RECORD
|
||||||
#define CONTAINING_RECORD(Address, Type, Field) \
|
#define CONTAINING_RECORD(address, type, field) \
|
||||||
((Type *) (((ULONG_PTR) Address) - FIELD_OFFSET(Type, Field)))
|
((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LONG
|
/* LONG
|
||||||
|
|
|
@ -890,7 +890,7 @@ typedef enum
|
||||||
#define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f))
|
#define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f))
|
||||||
#ifndef CONTAINING_RECORD
|
#ifndef CONTAINING_RECORD
|
||||||
#define CONTAINING_RECORD(address, type, field) \
|
#define CONTAINING_RECORD(address, type, field) \
|
||||||
((type*)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
|
((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
|
||||||
#endif
|
#endif
|
||||||
/* end winddk.h */
|
/* end winddk.h */
|
||||||
#define IMAGE_SIZEOF_FILE_HEADER 20
|
#define IMAGE_SIZEOF_FILE_HEADER 20
|
||||||
|
|
Loading…
Reference in a new issue