update for HEAD-2003091401
[reactos.git] / ntoskrnl / ldr / loader.c
index 031f23c..71adba9 100644 (file)
@@ -538,7 +538,9 @@ LdrInitializeBootStartDriver(PVOID ModuleLoadBase,
   RtlCreateUnicodeString(&DeviceNode->ServiceName, Buffer);
 
   Status = IopInitializeDriver(ModuleObject->EntryPoint,
-                              DeviceNode, FALSE);
+                              DeviceNode, FALSE,
+                              ModuleObject->Base,
+                              ModuleObject->Length);
   if (!NT_SUCCESS(Status))
     {
       IopFreeDeviceNode(DeviceNode);
@@ -594,7 +596,7 @@ LdrpQueryModuleInformation(PVOID Buffer,
   PLIST_ENTRY current_entry;
   PMODULE_OBJECT current;
   ULONG ModuleCount = 0;
-  PSYSTEM_MODULES Smi;
+  PSYSTEM_MODULE_INFORMATION Smi;
   ANSI_STRING AnsiName;
   PCHAR p;
   KIRQL Irql;
@@ -609,8 +611,8 @@ LdrpQueryModuleInformation(PVOID Buffer,
       current_entry = current_entry->Flink;
     }
 
-  *ReqSize = sizeof(SYSTEM_MODULES)+
-    (ModuleCount - 1) * sizeof(SYSTEM_MODULE_INFORMATION);
+  *ReqSize = sizeof(SYSTEM_MODULE_INFORMATION)+
+    (ModuleCount - 1) * sizeof(SYSTEM_MODULE_INFORMATION_ENTRY);
 
   if (Size < *ReqSize)
     {
@@ -621,7 +623,7 @@ LdrpQueryModuleInformation(PVOID Buffer,
   /* fill the buffer */
   memset(Buffer, '=', Size);
 
-  Smi = (PSYSTEM_MODULES)Buffer;
+  Smi = (PSYSTEM_MODULE_INFORMATION)Buffer;
   Smi->Count = ModuleCount;
 
   ModuleCount = 0;
@@ -630,18 +632,18 @@ LdrpQueryModuleInformation(PVOID Buffer,
     {
       current = CONTAINING_RECORD(current_entry,MODULE_OBJECT,ListEntry);
 
-      Smi->Modules[ModuleCount].Reserved[0] = 0;               /* Always 0 */
-      Smi->Modules[ModuleCount].Reserved[1] = 0;               /* Always 0 */
-      Smi->Modules[ModuleCount].Base = current->Base;
-      Smi->Modules[ModuleCount].Size = current->Length;
-      Smi->Modules[ModuleCount].Flags = 0;             /* Flags ??? (GN) */
-      Smi->Modules[ModuleCount].Index = ModuleCount;
-      Smi->Modules[ModuleCount].Unknown = 0;
-      Smi->Modules[ModuleCount].LoadCount = 0; /* FIXME */
+      Smi->Module[ModuleCount].Unknown1 = 0;           /* Always 0 */
+      Smi->Module[ModuleCount].Unknown2 = 0;           /* Always 0 */
+      Smi->Module[ModuleCount].Base = current->Base;
+      Smi->Module[ModuleCount].Size = current->Length;
+      Smi->Module[ModuleCount].Flags = 0;              /* Flags ??? (GN) */
+      Smi->Module[ModuleCount].Index = ModuleCount;
+      Smi->Module[ModuleCount].NameLength = 0;
+      Smi->Module[ModuleCount].LoadCount = 0; /* FIXME */
 
       AnsiName.Length = 0;
       AnsiName.MaximumLength = 256;
-      AnsiName.Buffer = Smi->Modules[ModuleCount].ImageName;
+      AnsiName.Buffer = Smi->Module[ModuleCount].ImageName;
       RtlUnicodeStringToAnsiString(&AnsiName,
                                   &current->FullName,
                                   FALSE);
@@ -649,12 +651,12 @@ LdrpQueryModuleInformation(PVOID Buffer,
       p = strrchr(AnsiName.Buffer, '\\');
       if (p == NULL)
        {
-         Smi->Modules[ModuleCount].ModuleNameOffset = 0;
+         Smi->Module[ModuleCount].PathLength = 0;
        }
       else
        {
          p++;
-         Smi->Modules[ModuleCount].ModuleNameOffset = p - AnsiName.Buffer;
+         Smi->Module[ModuleCount].PathLength = p - AnsiName.Buffer;
        }
 
       ModuleCount++;
@@ -1556,10 +1558,10 @@ LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
 
   if (ExportAddress == NULL)
     {
-      CPRINT("Export not found for %d:%s\n",
+      DbgPrint("Export not found for %d:%s\n",
             Hint,
             Name != NULL ? Name : "(Ordinal)");
-      KeBugCheck(0);
+      KEBUGCHECK(0);
     }
 
   return(ExportAddress);
@@ -1621,7 +1623,7 @@ LdrSafePEGetExportAddress(PVOID ImportModuleBase,
       ps("Export not found for %d:%s\n",
         Hint,
         Name != NULL ? Name : "(Ordinal)");
-      KeBugCheck(0);
+      KEBUGCHECK(0);
     }
   return ExportAddress;
 }