KSPIN_LOCK ModuleListLock;
LIST_ENTRY ModuleTextListHead;
+#ifndef LIBCAPTIVE
STATIC MODULE_TEXT_SECTION NtoskrnlTextSection;
STATIC MODULE_TEXT_SECTION LdrHalTextSection;
+#endif /* LIBCAPTIVE */
ULONG_PTR LdrHalBase;
#define TAG_DRIVER_MEM TAG('D', 'R', 'V', 'M')
PCHAR Name,
USHORT Hint);
+#ifndef LIBCAPTIVE
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
PCHAR Name,
USHORT Hint);
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEFixupForward(PCHAR ForwardName);
/* FUNCTIONS *****************************************************************/
+#ifndef LIBCAPTIVE
+
VOID
LdrInitDebug(PLOADER_MODULE Module, PWCH Name)
{
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
LdrUnloadModule(PMODULE_OBJECT ModuleObject)
return(STATUS_SUCCESS);
}
+#ifndef LIBCAPTIVE
NTSTATUS
LdrInitializeBootStartDriver(PVOID ModuleLoadBase,
return(Status);
}
+#endif /* LIBCAPTIVE */
NTSTATUS
LdrProcessModule(PVOID ModuleLoadBase,
}
}
+#ifndef LIBCAPTIVE
NTSTATUS
LdrpQueryModuleInformation(PVOID Buffer,
return(STATUS_SUCCESS);
}
+#endif /* LIBCAPTIVE */
static VOID
LdrpBuildModuleBaseName(PUNICODE_STRING BaseName,
{
NumRelocs = (RelocDir->SizeOfBlock - sizeof(RELOCATION_DIRECTORY)) /
sizeof(WORD);
-/* DPRINT("RelocDir at %08lx for VA %08lx with %08lx relocs\n",
+ DPRINT("RelocDir at %08lx for VA %08lx with %08lx relocs\n",
RelocDir,
RelocDir->VirtualAddress,
- NumRelocs);*/
+ NumRelocs);
RelocEntry = (PRELOCATION_ENTRY) ((DWORD)RelocDir +
sizeof(RELOCATION_DIRECTORY));
for (Idx = 0; Idx < NumRelocs; Idx++)
Type = (RelocEntry[Idx].TypeOffset >> 12) & 0xf;
RelocItem = (PDWORD)(DriverBase + RelocDir->VirtualAddress +
Offset);
-/* DPRINT(" reloc at %08lx %x %s old:%08lx new:%08lx\n",
+ DPRINT(" reloc at %08lx %x %s old:%08lx new:%08lx\n",
RelocItem,
Type,
Type ? "HIGHLOW" : "ABS",
*RelocItem,
- (*RelocItem) + RelocDelta); */
+ (*RelocItem) + RelocDelta);
if (Type == 3)
{
(*RelocItem) += RelocDelta;
if (LibraryModuleObject == NULL)
{
CPRINT("Module '%wZ' not loaded yet\n", &ModuleName);
- wcscpy(NameBuffer, L"\\SystemRoot\\system32\\drivers\\");
+ wcscpy(NameBuffer, REACTOS_UCS2(L"\\SystemRoot\\system32\\drivers\\"));
wcscat(NameBuffer, ModuleName.Buffer);
RtlInitUnicodeString(&NameString, NameBuffer);
Status = LdrLoadModule(&NameString, &LibraryModuleObject);
return STATUS_SUCCESS;
}
+#ifndef LIBCAPTIVE
PVOID
LdrSafePEProcessModule(PVOID ModuleLoadBase,
return(0);
}
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEGetExportAddress(PMODULE_OBJECT ModuleObject,
}
else /* use hint */
{
+#ifndef LIBCAPTIVE
ExportAddress = (PVOID) ((DWORD)ModuleObject->Base +
FunctionList[Hint - ExportDir->Base]);
+#else /* !LIBCAPTIVE */
+ /* Ordinals not supported by libcaptive */
+#endif /* !LIBCAPTIVE */
}
if (ExportAddress == NULL)
return(ExportAddress);
}
+#ifndef LIBCAPTIVE
static PVOID
LdrSafePEGetExportAddress(PVOID ImportModuleBase,
return ExportAddress;
}
+#endif /* LIBCAPTIVE */
static PVOID
LdrPEFixupForward(PCHAR ForwardName)