Small msvcrt _open patch

Peter Hunnisett hunnise at yahoo.com
Mon Jul 9 21:41:43 CDT 2001


Hi,
  this makes the call to CreateFileA the same as windows by passing a
security parameter.


Ciao,
Peter Hunnisett
hunnise at yahoo.com
-------------- next part --------------
--- ChangeLog	2001/07/06 20:06:34	1.1
+++ ChangeLog	2001/07/10 02:10:28
@@ -1,3 +1,8 @@
+
+	* dlls/msvcrt/file.c
+	Peter Hunnisett <hunnise at yahoo.com>
+	CreateFile should be called with security attributes in _open
+
 ----------------------------------------------------------------
 2001-06-29  Alexandre Julliard  <julliard at winehq.com>
 
--- file.c	2001/07/09 19:53:07	1.1
+++ file.c	2001/07/10 02:05:38
@@ -724,7 +724,8 @@
   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 @@
   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)
   {


More information about the wine-patches mailing list