* JF 26/01/2000 Recoded some parts to retrieve export details correctly
* DW 27/06/2000 Removed redundant header files
* CSH 11/04/2001 Added automatic loading of module symbols if they exist
+ * KJK 02/04/2003 Nebbet-ized a couple of type names
*/
#define NDEBUG
#include <internal/debug.h>
+#ifdef LIBCAPTIVE
+#include <glib/gmessages.h>
+#endif /* LIBCAPTIVE */
+
/* GLOBALS *******************************************************************/
LIST_ENTRY ModuleListHead;
Length = wcslen(Start);
wcsncpy(Buffer, Start, Length);
+ Buffer[Length] = 0;
RtlCreateUnicodeString(&DeviceNode->ServiceName, Buffer);
Status = IopInitializeDriver(ModuleObject->EntryPoint,
- DeviceNode, FALSE);
+ DeviceNode, FALSE,
+ ModuleObject->Base,
+ ModuleObject->Length);
if (!NT_SUCCESS(Status))
{
IopFreeDeviceNode(DeviceNode);
}
*ReqSize = sizeof(SYSTEM_MODULE_INFORMATION)+
- (ModuleCount - 1) * sizeof(SYSTEM_MODULE_ENTRY);
+ (ModuleCount - 1) * sizeof(SYSTEM_MODULE_INFORMATION_ENTRY);
if (Size < *ReqSize)
{
{
current = CONTAINING_RECORD(current_entry,MODULE_OBJECT,ListEntry);
+ Smi->Module[ModuleCount].Unknown1 = 0; /* Always 0 */
Smi->Module[ModuleCount].Unknown2 = 0; /* Always 0 */
- Smi->Module[ModuleCount].BaseAddress = current->Base;
+ Smi->Module[ModuleCount].Base = current->Base;
Smi->Module[ModuleCount].Size = current->Length;
Smi->Module[ModuleCount].Flags = 0; /* Flags ??? (GN) */
- Smi->Module[ModuleCount].EntryIndex = ModuleCount;
+ 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->Module[ModuleCount].Name;
+ AnsiName.Buffer = Smi->Module[ModuleCount].ImageName;
RtlUnicodeStringToAnsiString(&AnsiName,
¤t->FullName,
FALSE);
if (p == NULL)
{
Smi->Module[ModuleCount].PathLength = 0;
- Smi->Module[ModuleCount].NameLength = strlen(AnsiName.Buffer);
}
else
{
p++;
Smi->Module[ModuleCount].PathLength = p - AnsiName.Buffer;
- Smi->Module[ModuleCount].NameLength = strlen(p);
}
ModuleCount++;
LibraryModuleObject = LdrGetModuleObject(&ModuleName);
if (LibraryModuleObject == NULL)
{
- CPRINT("Module '%wZ' not loaded yet\n", &ModuleName);
+ DPRINT("Module '%wZ' not loaded yet\n", &ModuleName);
wcscpy(NameBuffer, REACTOS_UCS2(L"\\SystemRoot\\system32\\drivers\\"));
wcscat(NameBuffer, ModuleName.Buffer);
RtlInitUnicodeString(&NameString, NameBuffer);
Status = LdrLoadModule(&NameString, &LibraryModuleObject);
if (!NT_SUCCESS(Status))
{
- CPRINT("Unknown import module: %wZ (Status %lx)\n", &ModuleName, Status);
- return(Status);
+ wcscpy(NameBuffer, REACTOS_UCS2(L"\\SystemRoot\\system32\\"));
+ wcscat(NameBuffer, ModuleName.Buffer);
+ RtlInitUnicodeString(&NameString, NameBuffer);
+ Status = LdrLoadModule(&NameString, &LibraryModuleObject);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Unknown import module: %wZ (Status %lx)\n", &ModuleName, Status);
+ return(Status);
+ }
}
}
/* Get the import address list */
{
ULONG Offset;
ULONG Type;
- PDWORD RelocItem;
+ PULONG RelocItem;
Offset = RelocEntry[Idx].TypeOffset & 0xfff;
Type = (RelocEntry[Idx].TypeOffset >> 12) & 0xf;
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);
+#ifdef LIBCAPTIVE
+ g_error("Please check the versions of \"ntfs.sys\" and \"ntoskrnl.exe\" - do they match each other?\n"
+ "Because export not found for: %d:%s",Hint,(Name ? Name : "(Ordinal)"));
+#endif /* LIBCAPTIVE */
+ KEBUGCHECK(0);
}
return(ExportAddress);
ps("Export not found for %d:%s\n",
Hint,
Name != NULL ? Name : "(Ordinal)");
- KeBugCheck(0);
+ KEBUGCHECK(0);
}
return ExportAddress;
}