mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Fix LdrAccessResource for ordinary mapped files.
svn path=/trunk/; revision=16935
This commit is contained in:
parent
4f9fb92e50
commit
e18c5c1218
1 changed files with 3 additions and 3 deletions
|
@ -43,10 +43,10 @@ LdrAccessResource(IN PVOID BaseAddress,
|
|||
if (Data == 0)
|
||||
return STATUS_RESOURCE_DATA_NOT_FOUND;
|
||||
|
||||
if ((ULONG)BaseAddress & 1)
|
||||
if ((ULONG_PTR)BaseAddress & 1)
|
||||
{
|
||||
/* loaded as ordinary file */
|
||||
NtHeader = RtlImageNtHeader((PVOID)((ULONG)BaseAddress & ~1UL));
|
||||
NtHeader = RtlImageNtHeader((PVOID)((ULONG_PTR)BaseAddress & ~1));
|
||||
Offset = (ULONG)BaseAddress - Data + NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress;
|
||||
Section = RtlImageRvaToSection (NtHeader, BaseAddress, NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress);
|
||||
if (Section == NULL)
|
||||
|
@ -64,7 +64,7 @@ LdrAccessResource(IN PVOID BaseAddress,
|
|||
|
||||
if (Resource)
|
||||
{
|
||||
*Resource = (PVOID)(ResourceDataEntry->OffsetToData - Offset + (ULONG)BaseAddress);
|
||||
*Resource = (PVOID)(ResourceDataEntry->OffsetToData - Offset + ((ULONG_PTR)BaseAddress & ~1));
|
||||
}
|
||||
|
||||
if (Size)
|
||||
|
|
Loading…
Reference in a new issue