Author: dchapyshev
Date: Sat Jan 10 06:33:22 2009
New Revision: 38678
URL:
http://svn.reactos.org/svn/reactos?rev=38678&view=rev
Log:
- Fix 3 wine tests for OpenFile function
Modified:
trunk/reactos/dll/win32/kernel32/file/file.c
Modified: trunk/reactos/dll/win32/kernel32/file/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/fi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] Sat Jan 10 06:33:22 2009
@@ -263,6 +263,27 @@
lpReOpenBuff->fFixedDisk = (GetDriveTypeA(lpReOpenBuff->szPathName) !=
DRIVE_REMOVABLE);
TRACE("(%s): OF_PARSE, res = '%s'\n", lpFileName,
lpReOpenBuff->szPathName);
return 0;
+ }
+
+ if ((uStyle & OF_EXIST) && !(uStyle & OF_CREATE))
+ {
+ DWORD dwAttributes = GetFileAttributesA(lpReOpenBuff->szPathName);
+
+ switch (dwAttributes)
+ {
+ case 0xFFFFFFFF: /* File does not exist */
+ SetLastError(ERROR_FILE_NOT_FOUND);
+ lpReOpenBuff->nErrCode = (WORD) ERROR_FILE_NOT_FOUND;
+ return -1;
+
+ case FILE_ATTRIBUTE_DIRECTORY:
+ SetLastError(ERROR_ACCESS_DENIED);
+ lpReOpenBuff->nErrCode = (WORD) ERROR_ACCESS_DENIED;
+ return -1;
+
+ default:
+ return 1;
+ }
}
if ((uStyle & OF_CREATE) == OF_CREATE)
@@ -371,7 +392,7 @@
if (uStyle & OF_EXIST)
{
NtClose(FileHandle);
- return TRUE;
+ return (HFILE)1;
}
return (HFILE)FileHandle;