- Simplified version of _lcreat.
authorFilip Navara <filip.navara@gmail.com>
Sat, 28 Aug 2004 22:08:54 +0000 (22:08 +0000)
committerFilip Navara <filip.navara@gmail.com>
Sat, 28 Aug 2004 22:08:54 +0000 (22:08 +0000)
svn path=/trunk/; revision=10723

reactos/lib/kernel32/file/lfile.c

index 9ce6fc7..cd75ea9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lfile.c,v 1.9 2003/07/10 18:50:51 chorns Exp $
+/* $Id: lfile.c,v 1.10 2004/08/28 22:08:54 navaraf Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -39,25 +39,6 @@ _hread(
 }
 
 
-/*
-//19990828.EA: aliased in DEF
-UINT
-STDCALL
-_lread (
-       HFILE   fd,
-       LPVOID  buffer,
-       UINT    count
-       )
-{
-       return _hread(
-                fd,
-                buffer,
-                count
-                );
-}
-*/
-
-
 /*
  * @implemented
  */
@@ -93,22 +74,6 @@ _hwrite (
 }
 
 
-/*
-//19990828.EA: aliased in DEF
-
-UINT
-STDCALL
-_lwrite(
-       HFILE   hFile,
-       LPCSTR  lpBuffer,
-       UINT    uBytes
-       )
-{
-       return _hwrite(hFile,lpBuffer,uBytes);
-}
-*/
-
-
 /*
  * @implemented
  */
@@ -140,7 +105,6 @@ _lopen (
        else if ((iReadWrite & OF_SHARE_EXCLUSIVE) == OF_SHARE_EXCLUSIVE)
                dwShareMode = 0;
 
-       SetLastError (ERROR_SUCCESS);
        return (HFILE) CreateFileA(
                        lpPathName,
                        dwAccessMask,
@@ -162,25 +126,13 @@ _lcreat (
        int     iAttribute
        )
 {
-
-       DWORD FileAttributes = 0;
-       
-       if (  iAttribute == 0 )
-               FileAttributes |= FILE_ATTRIBUTE_NORMAL;
-       else if (  iAttribute == 1 )
-               FileAttributes |= FILE_ATTRIBUTE_READONLY;
-       else if (  iAttribute == 2 )
-               FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
-       else if (  iAttribute == 4 )
-               FileAttributes |= FILE_ATTRIBUTE_SYSTEM;
-
        return (HFILE) CreateFileA(
                        lpPathName,
                        GENERIC_ALL,
                        (FILE_SHARE_READ | FILE_SHARE_WRITE),
                        NULL,
                        CREATE_ALWAYS,
-                       iAttribute,
+                       iAttribute & FILE_ATTRIBUTE_VALID_FLAGS,
                        NULL);
 }