forked from enlightenment/efl
Evil: fix mmap() and define HAVE_MMAP
Summary: add size of file mapping to fix invalid parameter Test Plan: compilation (edje succeeds) and elm_test Reviewers: zmike, cedric, raster Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9913
This commit is contained in:
parent
3307e55874
commit
c00d70982f
|
@ -58,6 +58,8 @@ mmap(void *addr EVIL_UNUSED,
|
|||
DWORD acs = 0;
|
||||
HANDLE handle;
|
||||
void *data;
|
||||
DWORD low;
|
||||
DWORD high;
|
||||
|
||||
/* get protection */
|
||||
protect = _evil_mmap_protection_get(prot);
|
||||
|
@ -89,7 +91,15 @@ mmap(void *addr EVIL_UNUSED,
|
|||
}
|
||||
}
|
||||
|
||||
fm = CreateFileMapping(handle, NULL, protect, 0, 0, NULL);
|
||||
#ifdef _WIN64
|
||||
low = (DWORD)((len >> 32) & 0x00000000ffffffff);
|
||||
low = (DWORD)(len & 0x00000000ffffffff);
|
||||
#else
|
||||
high = 0L;
|
||||
low = len;
|
||||
#endif
|
||||
|
||||
fm = CreateFileMapping(handle, NULL, protect, high, low, NULL);
|
||||
if (!fm)
|
||||
{
|
||||
fprintf(stderr, "[Evil] [mmap] CreateFileMapping failed: %s\n",
|
||||
|
|
|
@ -114,6 +114,10 @@ EAPI void *mmap(void *addr,
|
|||
int fd,
|
||||
off_t offset);
|
||||
|
||||
#ifndef HAVE_MMAP
|
||||
# define HAVE_MMAP 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Unmaps a mapped view of a file from the calling process's
|
||||
* address space.
|
||||
|
|
Loading…
Reference in New Issue