[kernel32]
authorGregor Schneider <grschneider@gmail.com>
Thu, 3 Dec 2009 21:50:52 +0000 (21:50 +0000)
committerGregor Schneider <grschneider@gmail.com>
Thu, 3 Dec 2009 21:50:52 +0000 (21:50 +0000)
- OpenFile: set the structure size after doing basic parameter checks
- Fixes two kernel32 file tests

svn path=/trunk/; revision=44394

reactos/dll/win32/kernel32/file/file.c

index 838741f..6604662 100644 (file)
@@ -239,7 +239,6 @@ OpenFile(LPCSTR lpFileName,
                return HFILE_ERROR;
        }
 
-    lpReOpenBuff->cBytes = sizeof(OFSTRUCT);
     lpReOpenBuff->nErrCode = 0;
 
        if (uStyle & OF_REOPEN) lpFileName = lpReOpenBuff->szPathName;
@@ -282,10 +281,11 @@ OpenFile(LPCSTR lpFileName,
                 return -1;
 
             default:
+                lpReOpenBuff->cBytes = sizeof(OFSTRUCT);
                 return 1;
         }
     }
-
+    lpReOpenBuff->cBytes = sizeof(OFSTRUCT);
        if ((uStyle & OF_CREATE) == OF_CREATE)
        {
                DWORD Sharing;