From 07203a50c10fff633082179e871d42b3fda115d4 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 24 Jul 2009 10:25:53 +0000 Subject: [PATCH] [delayimp] - move IndexFromPImgThunkData and PFromRva to delayimp.h - use __ImageBase insetad of _image_base__ - fix include guard - RVA is a DWORD, not a PVOID svn path=/trunk/; revision=42172 --- reactos/lib/sdk/delayimp/delayimp.c | 15 --------------- reactos/lib/sdk/delayimp/delayimp.h | 30 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/reactos/lib/sdk/delayimp/delayimp.c b/reactos/lib/sdk/delayimp/delayimp.c index 5afa32e17a6..4e279224c1f 100644 --- a/reactos/lib/sdk/delayimp/delayimp.c +++ b/reactos/lib/sdk/delayimp/delayimp.c @@ -10,21 +10,6 @@ #include #include "delayimp.h" -inline -unsigned -IndexFromPImgThunkData(PCImgThunkData pData, PCImgThunkData pBase) -{ - return pData - pBase; -} - -extern const IMAGE_DOS_HEADER _image_base__; - -inline PVOID -PFromRva(RVA rva) -{ - return (PVOID)(((ULONG_PTR)(rva)) + ((ULONG_PTR)&_image_base__)); -} - /**** load helper ****/ FARPROC WINAPI diff --git a/reactos/lib/sdk/delayimp/delayimp.h b/reactos/lib/sdk/delayimp/delayimp.h index fd8566dd1b3..4fddee37157 100644 --- a/reactos/lib/sdk/delayimp/delayimp.h +++ b/reactos/lib/sdk/delayimp/delayimp.h @@ -1,14 +1,15 @@ -#ifndef _DELAYIMP_H_ -#define _DELAYIMP_H_ +#ifndef _delayimp_h +#define _delayimp_h -typedef void *RVA; +#define DELAYLOAD_VERSION 0x200 +typedef DWORD RVA; typedef IMAGE_THUNK_DATA *PImgThunkData; typedef const IMAGE_THUNK_DATA *PCImgThunkData; -enum +enum DLAttr { - dlattrRva + dlattrRva = 0x1, }; /* Notification codes */ @@ -59,7 +60,24 @@ typedef struct DelayLoadInfo typedef FARPROC (WINAPI *PfnDliHook)(unsigned, PDelayLoadInfo); +static __inline__ +unsigned +IndexFromPImgThunkData(PCImgThunkData pData, PCImgThunkData pBase) +{ + return pData - pBase; +} + +extern const IMAGE_DOS_HEADER __ImageBase; + +static __inline__ +PVOID +PFromRva(RVA rva) +{ + return (PVOID)(((ULONG_PTR)(rva)) + ((ULONG_PTR)&__ImageBase)); +} + + extern PfnDliHook __pfnDliNotifyHook2; extern PfnDliHook __pfnDliFailureHook2; -#endif /* not _DELAYIMP_H_ */ +#endif /* not _delayimp_h */