mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 20:15:39 +00:00
ntdll: Fix protection flags for uninitialized sections.
This commit is contained in:
parent
8d50342858
commit
33b0f0edff
|
@ -1341,8 +1341,14 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz
|
||||||
size = ROUND_SIZE( sec->VirtualAddress, sec->SizeOfRawData );
|
size = ROUND_SIZE( sec->VirtualAddress, sec->SizeOfRawData );
|
||||||
|
|
||||||
if (sec->Characteristics & IMAGE_SCN_MEM_READ) vprot |= VPROT_READ;
|
if (sec->Characteristics & IMAGE_SCN_MEM_READ) vprot |= VPROT_READ;
|
||||||
if (sec->Characteristics & IMAGE_SCN_MEM_WRITE) vprot |= VPROT_READ | VPROT_WRITECOPY;
|
|
||||||
if (sec->Characteristics & IMAGE_SCN_MEM_EXECUTE) vprot |= VPROT_EXEC;
|
if (sec->Characteristics & IMAGE_SCN_MEM_EXECUTE) vprot |= VPROT_EXEC;
|
||||||
|
if (sec->Characteristics & IMAGE_SCN_MEM_WRITE)
|
||||||
|
{
|
||||||
|
if (sec->Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
|
||||||
|
vprot |= VPROT_READ | VPROT_WRITE;
|
||||||
|
else
|
||||||
|
vprot |= VPROT_READ | VPROT_WRITECOPY;
|
||||||
|
}
|
||||||
|
|
||||||
/* Dumb game crack lets the AOEP point into a data section. Adjust. */
|
/* Dumb game crack lets the AOEP point into a data section. Adjust. */
|
||||||
if ((nt->OptionalHeader.AddressOfEntryPoint >= sec->VirtualAddress) &&
|
if ((nt->OptionalHeader.AddressOfEntryPoint >= sec->VirtualAddress) &&
|
||||||
|
|
Loading…
Reference in a new issue