mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 01:50:57 +00:00
- Fix 3 wine tests for OpenFile function
svn path=/trunk/; revision=38678
This commit is contained in:
parent
383bd810ce
commit
5d038be948
|
@ -265,6 +265,27 @@ OpenFile(LPCSTR lpFileName,
|
|||
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)
|
||||
{
|
||||
DWORD Sharing;
|
||||
|
@ -371,7 +392,7 @@ OpenFile(LPCSTR lpFileName,
|
|||
if (uStyle & OF_EXIST)
|
||||
{
|
||||
NtClose(FileHandle);
|
||||
return TRUE;
|
||||
return (HFILE)1;
|
||||
}
|
||||
|
||||
return (HFILE)FileHandle;
|
||||
|
|
Loading…
Reference in a new issue