summaryrefslogtreecommitdiff
path: root/mmap
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-06-06 16:05:26 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-06-06 16:05:26 +0000
commit1f803c0151f1006bc872d9c06607928fd71c53a5 (patch)
treee2cf1112fcc2cf93079ee76cbd7f94b9622f8325 /mmap
parenta8d2db45ab599607495f7f65e22c589fc632f4fc (diff)
downloadlibapr-1f803c0151f1006bc872d9c06607928fd71c53a5.tar.gz
*) Complete the implementation of LARGEFILE support on Win32, although
the mmap semantics still need a touch of work. *) Fix the APR_XTHREAD support, and apr_sendfile mechanics, so we can handle cross-threaded file handles on Win32. Sorry, it's rather hard to untangle one from the other to create two patches. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61712 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'mmap')
-rw-r--r--mmap/win32/mmap.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
index 6060e0c9d..cab53992d 100644
--- a/mmap/win32/mmap.c
+++ b/mmap/win32/mmap.c
@@ -96,7 +96,10 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file,
apr_int32_t flag, apr_pool_t *cont)
{
static DWORD memblock = 0;
- DWORD fmaccess = 0, mvaccess = 0;
+ DWORD fmaccess = 0;
+ DWORD mvaccess = 0;
+ DWORD offlo;
+ DWORD offhi;
if (flag & APR_MMAP_WRITE)
fmaccess |= PAGE_READWRITE;
@@ -121,19 +124,23 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file,
*new = apr_pcalloc(cont, sizeof(apr_mmap_t));
(*new)->pstart = (offset / memblock) * memblock;
- (*new)->psize = (offset % memblock) + size;
+ (*new)->psize = (apr_size_t)(offset % memblock) + size;
(*new)->poffset = offset - (*new)->pstart;
+ offlo = (DWORD)(*new)->psize;
+ offhi = (DWORD)((*new)->psize << 32);
(*new)->mhandle = CreateFileMapping(file->filehand, NULL, fmaccess,
- 0, (*new)->psize, NULL);
+ offhi, offlo, NULL);
if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE)
{
*new = NULL;
return apr_get_os_error();
}
- (*new)->mv = MapViewOfFile((*new)->mhandle, mvaccess, 0,
- (*new)->poffset, (*new)->psize);
+ offlo = (DWORD)(*new)->poffset;
+ offhi = (DWORD)((*new)->poffset << 32);
+ (*new)->mv = MapViewOfFile((*new)->mhandle, mvaccess, offhi,
+ offlo, (*new)->psize);
if (!(*new)->mv)
{
apr_status_t rv = apr_get_os_error();