mirror of
https://github.com/reactos/reactos.git
synced 2025-07-07 07:18:53 +00:00
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:
parent
b0a663b4a6
commit
b5c636ee01
1 changed files with 46 additions and 38 deletions
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue