fix a version info winetest by allowing non dll files to be loaded with LOAD_LIBRARY_AS_DATAFILE

svn path=/trunk/; revision=35976
This commit is contained in:
Christoph von Wittich 2008-09-06 10:27:40 +00:00
parent b0a663b4a6
commit b5c636ee01

View file

@ -650,6 +650,9 @@ LdrpMapDllImageFile(IN PWSTR SearchPath OPTIONAL,
0, 0,
FullNtFileName.Buffer); FullNtFileName.Buffer);
if (!MapAsDataFile)
{
Status = NtReadFile(FileHandle, Status = NtReadFile(FileHandle,
NULL, NULL,
NULL, NULL,
@ -665,6 +668,7 @@ LdrpMapDllImageFile(IN PWSTR SearchPath OPTIONAL,
NtClose(FileHandle); NtClose(FileHandle);
return Status; return Status;
} }
/* /*
* Overlay DOS and NT headers structures to the * Overlay DOS and NT headers structures to the
* buffer with DLL's header raw data. * buffer with DLL's header raw data.
@ -683,6 +687,7 @@ LdrpMapDllImageFile(IN PWSTR SearchPath OPTIONAL,
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
}
/* /*
* Create a section for dll. * Create a section for dll.
@ -2058,6 +2063,8 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
{ {
*BaseAddress = ImageBase; *BaseAddress = ImageBase;
} }
if (!MappedAsDataFile)
{
/* Get and check the NT headers */ /* Get and check the NT headers */
NtHeaders = RtlImageNtHeader(ImageBase); NtHeaders = RtlImageNtHeader(ImageBase);
if (NtHeaders == NULL) if (NtHeaders == NULL)
@ -2068,6 +2075,7 @@ LdrpLoadModule(IN PWSTR SearchPath OPTIONAL,
RtlFreeUnicodeString(&FullDosName); RtlFreeUnicodeString(&FullDosName);
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
}
DPRINT("Mapped %wZ at %x\n", &FullDosName, ImageBase); DPRINT("Mapped %wZ at %x\n", &FullDosName, ImageBase);
if (MappedAsDataFile) if (MappedAsDataFile)
{ {