Skip to content

Commit

Permalink
Use CreateFileMappingW on Unicode capable Windows.
Browse files Browse the repository at this point in the history
* mmap/win32/mmap.c
  (apr_mmap_create): Use CreateFileMappingW() if APR_HAS_UNICODE_FS and   
  IF_WIN_OS_IS_UNICODE.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1774923 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Ivan Zhakov committed Dec 18, 2016
1 parent 64f8924 commit fbdeead
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mmap/win32/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fbdeead

Please sign in to comment.