mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[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
This commit is contained in:
parent
9e27cfbe88
commit
07203a50c1
2 changed files with 24 additions and 21 deletions
|
@ -10,21 +10,6 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "delayimp.h"
|
#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 ****/
|
/**** load helper ****/
|
||||||
|
|
||||||
FARPROC WINAPI
|
FARPROC WINAPI
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
#ifndef _DELAYIMP_H_
|
#ifndef _delayimp_h
|
||||||
#define _DELAYIMP_H_
|
#define _delayimp_h
|
||||||
|
|
||||||
typedef void *RVA;
|
#define DELAYLOAD_VERSION 0x200
|
||||||
|
|
||||||
|
typedef DWORD RVA;
|
||||||
typedef IMAGE_THUNK_DATA *PImgThunkData;
|
typedef IMAGE_THUNK_DATA *PImgThunkData;
|
||||||
typedef const IMAGE_THUNK_DATA *PCImgThunkData;
|
typedef const IMAGE_THUNK_DATA *PCImgThunkData;
|
||||||
|
|
||||||
enum
|
enum DLAttr
|
||||||
{
|
{
|
||||||
dlattrRva
|
dlattrRva = 0x1,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Notification codes */
|
/* Notification codes */
|
||||||
|
@ -59,7 +60,24 @@ typedef struct DelayLoadInfo
|
||||||
|
|
||||||
typedef FARPROC (WINAPI *PfnDliHook)(unsigned, PDelayLoadInfo);
|
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 __pfnDliNotifyHook2;
|
||||||
extern PfnDliHook __pfnDliFailureHook2;
|
extern PfnDliHook __pfnDliFailureHook2;
|
||||||
|
|
||||||
#endif /* not _DELAYIMP_H_ */
|
#endif /* not _delayimp_h */
|
||||||
|
|
Loading…
Reference in a new issue