Hi,

Some ANSI APIs like CreateFileMappingA is not available on Windows
Nano Server, while APR code in mmap/win32/mmap.c use
CreateFileMappingA unconditionally. Attached patch fixes this problem.
APR already has similar code in shmem/win32/shm.c.

-- 
Ivan Zhakov
Index: mmap/win32/mmap.c
===================================================================
--- mmap/win32/mmap.c   (revision 1755968)
+++ mmap/win32/mmap.c   (working copy)
@@ -108,8 +108,20 @@
      * 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;

Reply via email to