From 2bc35e62995c59872a7aec8367934a37b3b786d9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 21 Apr 2008 13:17:36 +0000 Subject: [PATCH] * kernel32.cc (CreateFileMappingW): Fix bug in reserve/commit handling. --- winsup/cygwin/ChangeLog | 6 +++++- winsup/cygwin/kernel32.cc | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d36d11f41..117839c51 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,4 +1,8 @@ -2008-04-20 Corinna Vinschen +2008-04-21 Corinna Vinschen + + * kernel32.cc (CreateFileMappingW): Fix bug in reserve/commit handling. + +2008-04-21 Corinna Vinschen * Makefile.in (DLL_OFILES): Add kernel32.o. * autoload.cc (WSACloseEvent): Remove. diff --git a/winsup/cygwin/kernel32.cc b/winsup/cygwin/kernel32.cc index f8953327d..525432a00 100644 --- a/winsup/cygwin/kernel32.cc +++ b/winsup/cygwin/kernel32.cc @@ -331,8 +331,8 @@ CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, lpAttributes ? lpAttributes->lpSecurityDescriptor : NULL); - if (!attribs) - attribs = SEC_COMMIT; + if (!(attribs & (SEC_RESERVE | SEC_COMMIT))) + attribs |= SEC_COMMIT; if (hFile == INVALID_HANDLE_VALUE) hFile = NULL; status = NtCreateSection (§, access, &attr, psize, prot, attribs, hFile);