summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2022-06-20 21:58:49 +0000
committerivan <ivan@13f79535-47bb-0310-9956-ffa450edef68>2022-06-20 21:58:49 +0000
commit713c80a0150355c9c685b37a07a6c803daaa90fd (patch)
tree6ccff05a6f6fd41b5e74e8e07e7d19a69cb0bf15
parent7212cf412f2133f0e7bd838ef3318249957cedbf (diff)
downloadlibapr-713c80a0150355c9c685b37a07a6c803daaa90fd.tar.gz
On 1.8.x branch: Merge r1774923 from trunk:
Use CreateFileMappingW on Unicode capable Windows. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1902121 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--mmap/win32/mmap.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
index d5d88aebd..8fbb2f25b 100644
--- a/mmap/win32/mmap.c
+++ b/mmap/win32/mmap.c
@@ -108,8 +108,20 @@ APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file,
* of the mapped region!
*/
- (*new)->mhandle = CreateFileMapping(file->filehand, NULL, fmaccess,
- 0, 0, NULL);
+#if APR_HAS_UNICODE_FS
+ IF_WIN_OS_IS_UNICODE
+ {
+ (*new)->mhandle = CreateFileMappingW(file->filehand, NULL, fmaccess,
+ 0, 0, NULL);
+ }
+#endif
+#if APR_HAS_ANSI_FS
+ ELSE_WIN_OS_IS_ANSI
+ {
+ (*new)->mhandle = CreateFileMappingA(file->filehand, NULL, fmaccess,
+ 0, 0, NULL);
+ }
+#endif
if (!(*new)->mhandle || (*new)->mhandle == INVALID_HANDLE_VALUE)
{
*new = NULL;