# HG changeset patch # User Eli Zaretskii # Date 1118086082 0 # Node ID 96407b6847514a3e966cbb2fc4d60d32470ddd50 # Parent 42efa87075efaa98a646fab359a1cc5ec44abb8b (RVA_TO_PTR): Moved here from w32heap.h. diff -r 42efa87075ef -r 96407b684751 src/unexw32.c --- a/src/unexw32.c Mon Jun 06 19:27:37 2005 +0000 +++ b/src/unexw32.c Mon Jun 06 19:28:02 2005 +0000 @@ -325,6 +325,9 @@ /* 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)