diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-06-06 19:56:41 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-06-06 19:56:41 +0000 |
commit | f985cc1c535516836e4bb323b0498255ce7a8b6b (patch) | |
tree | b31b1a94c267ed859da4938874a668b01aca3630 | |
parent | c05f7ba26e312a7a0010b9400c16f2263db27313 (diff) | |
download | cygnal-f985cc1c535516836e4bb323b0498255ce7a8b6b.tar.gz cygnal-f985cc1c535516836e4bb323b0498255ce7a8b6b.tar.bz2 cygnal-f985cc1c535516836e4bb323b0498255ce7a8b6b.zip |
* mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile
throughout for symmetry.
(fhandler_dev_mem::munmap): Use correct process handle in call to
NtUnmapViewOfSection.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/mmap.cc | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 478170ec5..e11466cbc 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2009-06-06 Corinna Vinschen <corinna@vinschen.de> + * mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile + throughout for symmetry. + (fhandler_dev_mem::munmap): Use correct process handle in call to + NtUnmapViewOfSection. + +2009-06-06 Corinna Vinschen <corinna@vinschen.de> + * dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY. * dll_init.cc: Fix formatting. (dll_list::alloc): Only allocate as much memory for struct dll as diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 30410692f..799b3f701 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -1480,7 +1480,7 @@ fhandler_dev_zero::mmap (caddr_t *addr, size_t len, int prot, __seterrno (); else { - UnmapViewOfFile (base); + NtUnmapViewOfSection (GetCurrentProcess (), base); set_errno (EINVAL); debug_printf ("MapView: address shift with MAP_FIXED given"); } @@ -1499,7 +1499,7 @@ fhandler_dev_zero::munmap (HANDLE h, caddr_t addr, size_t len) VirtualFree (addr, 0, MEM_RELEASE); else { - UnmapViewOfFile (addr); + NtUnmapViewOfSection (GetCurrentProcess (), addr); NtClose (h); } return 0; @@ -1560,7 +1560,7 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, int prot, __seterrno (); else { - UnmapViewOfFile (base); + NtUnmapViewOfSection (GetCurrentProcess (), base); set_errno (EINVAL); debug_printf ("MapView: address shift with MAP_FIXED given"); } @@ -1575,7 +1575,7 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, int prot, int fhandler_disk_file::munmap (HANDLE h, caddr_t addr, size_t len) { - UnmapViewOfFile (addr); + NtUnmapViewOfSection (GetCurrentProcess (), addr); NtClose (h); return 0; } @@ -1673,7 +1673,7 @@ int fhandler_dev_mem::munmap (HANDLE h, caddr_t addr, size_t len) { NTSTATUS ret; - if (!NT_SUCCESS (ret = NtUnmapViewOfSection (INVALID_HANDLE_VALUE, addr))) + if (!NT_SUCCESS (ret = NtUnmapViewOfSection (GetCurrentProcess (), addr))) { __seterrno_from_nt_status (ret); return -1; |