[NTOS:MM]
[reactos.git] / reactos / ntoskrnl / mm / ARM3 / sysldr.c
index a21e552..0b929f7 100644 (file)
@@ -178,19 +178,6 @@ MiLoadImageSection(IN OUT PVOID *SectionPtr,
     /* Lock the PFN database */
     OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
 
-    /* Some debug stuff */
-    MI_SET_USAGE(MI_USAGE_DRIVER_PAGE);
-#if MI_TRACE_PFNS
-    if (FileName->Buffer)
-    {
-        PWCHAR pos = NULL;
-        ULONG len = 0;
-        pos = wcsrchr(FileName->Buffer, '\\');
-        len = wcslen(pos) * sizeof(WCHAR);
-        if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S", pos);
-    }
-#endif
-
     /* Loop the new driver PTEs */
     TempPte = ValidKernelPte;
     while (PointerPte < LastPte)
@@ -198,6 +185,19 @@ MiLoadImageSection(IN OUT PVOID *SectionPtr,
         /* Make sure the PTE is not valid for whatever reason */
         ASSERT(PointerPte->u.Hard.Valid == 0);
 
+        /* Some debug stuff */
+        MI_SET_USAGE(MI_USAGE_DRIVER_PAGE);
+#if MI_TRACE_PFNS
+        if (FileName->Buffer)
+        {
+            PWCHAR pos = NULL;
+            ULONG len = 0;
+            pos = wcsrchr(FileName->Buffer, '\\');
+            len = wcslen(pos) * sizeof(WCHAR);
+            if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S", pos);
+        }
+#endif
+
         /* Grab a page */
         PageFrameIndex = MiRemoveAnyPage(MI_GET_NEXT_COLOR());