summaryrefslogtreecommitdiff
path: root/src/unexw32.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2005-06-06 19:28:02 +0000
committerEli Zaretskii <eliz@gnu.org>2005-06-06 19:28:02 +0000
commite9bdb9c9f79bfb31977501ef5aebd53f1505718a (patch)
tree4764984c062a16410292bdbed216ef99bc2b4754 /src/unexw32.c
parenta74089f7a13e594c51388f74fc5222d908262c2b (diff)
(RVA_TO_PTR): Moved here from w32heap.h.
Diffstat (limited to 'src/unexw32.c')
-rw-r--r--src/unexw32.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/unexw32.c b/src/unexw32.c
index b183864496..1b2dbe74c3 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -325,6 +325,9 @@ relocate_offset (DWORD offset,
/* Convert address in executing image to RVA. */
#define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL))
+#define RVA_TO_PTR(var,section,filedata) \
+ ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base))
+
#define PTR_TO_OFFSET(ptr, pfile_data) \
((unsigned char *)(ptr) - (pfile_data)->file_base)