From e3454c78ba61e4185a0565202643d0ab835005c4 Mon Sep 17 00:00:00 2001 From: Peter Hunnisett Date: Tue, 10 Jul 2001 19:03:46 +0000 Subject: [PATCH] CreateFile should be called with security attributes in _open. --- dlls/msvcrt/file.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index c0c49150f6b..fa3749372fc 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -724,7 +724,8 @@ int _open(const char *path,int flags,...) DWORD access = 0, creation = 0; int ioflag = 0, fd; HANDLE hand; - + SECURITY_ATTRIBUTES sa; + TRACE(":file (%s) mode 0x%04x\n",path,flags); switch(flags & (_O_RDONLY | _O_WRONLY | _O_RDWR)) @@ -776,9 +777,13 @@ int _open(const char *path,int flags,...) if (flags & ~(_O_BINARY|_O_TEXT|_O_APPEND|_O_TRUNC|_O_EXCL |_O_CREAT|_O_RDWR|_O_TEMPORARY)) TRACE(":unsupported flags 0x%04x\n",flags); + + sa.nLength = sizeof( SECURITY_ATTRIBUTES ); + sa.lpSecurityDescriptor = NULL; + sa.bInheritHandle = TRUE; hand = CreateFileA(path, access, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, creation, FILE_ATTRIBUTE_NORMAL, 0); + &sa, creation, FILE_ATTRIBUTE_NORMAL, 0); if (hand == INVALID_HANDLE_VALUE) {