Merge freeldr from amd64 branch:
[reactos.git] / reactos / lib / rtl / image.c
index 5f79b7e..844fbca 100644 (file)
@@ -16,6 +16,8 @@
 #define NDEBUG
 #include <debug.h>
 
+#define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
+
 /* FUNCTIONS *****************************************************************/
 
 BOOLEAN
@@ -175,6 +177,7 @@ LdrProcessRelocationBlockLongLong(
     USHORT i;
     PUSHORT ShortPtr;
     PULONG LongPtr;
+    PULONGLONG LongLongPtr;
 
     for (i = 0; i < Count; i++)
     {
@@ -212,6 +215,11 @@ LdrProcessRelocationBlockLongLong(
             *LongPtr = SWAPD(*LongPtr) + (ULONG)Delta;
             break;
 
+        case IMAGE_REL_BASED_DIR64:
+            LongLongPtr = (PUINT64)RVA(Address, Offset);
+            *LongLongPtr = SWAPQ(*LongLongPtr) + Delta;
+            break;
+
         case IMAGE_REL_BASED_HIGHADJ:
         case IMAGE_REL_BASED_MIPS_JMPADDR:
         default: