Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
91ff09b6
Commit
91ff09b6
authored
Oct 10, 2005
by
Maxime Bellengé
Committed by
Alexandre Julliard
Oct 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In case of failure and OF_EXIST is specified, return FALSE instead of
HFILE_ERROR.
parent
8e1fa187
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
file.c
dlls/kernel/file.c
+4
-1
file.c
dlls/kernel/tests/file.c
+25
-0
No files found.
dlls/kernel/file.c
View file @
91ff09b6
...
...
@@ -2071,5 +2071,8 @@ HFILE WINAPI OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
error:
/* We get here if there was an error opening the file */
ofs
->
nErrCode
=
GetLastError
();
WARN
(
"(%s): return = HFILE_ERROR error= %d
\n
"
,
name
,
ofs
->
nErrCode
);
return
HFILE_ERROR
;
if
(
mode
&
OF_EXIST
)
return
FALSE
;
else
return
HFILE_ERROR
;
}
dlls/kernel/tests/file.c
View file @
91ff09b6
...
...
@@ -1390,6 +1390,30 @@ static void test_read_write(void)
ok
(
ret
,
"DeleteFileA: error %ld
\n
"
,
GetLastError
());
}
static
void
test_OpenFile_exists
(
void
)
{
HFILE
hFile
;
OFSTRUCT
ofs
;
static
const
char
*
file
=
"
\\
winver.exe"
;
char
buff
[
MAX_PATH
];
UINT
length
;
length
=
GetSystemDirectoryA
(
buff
,
MAX_PATH
);
if
((
length
+
lstrlen
(
file
)
<
MAX_PATH
))
{
lstrcat
(
buff
,
file
);
hFile
=
OpenFile
(
buff
,
&
ofs
,
OF_EXIST
);
ok
(
hFile
==
TRUE
,
"%s not found : %ld
\n
"
,
buff
,
GetLastError
());
}
hFile
=
OpenFile
(
".
\\
foo-bar-foo.baz"
,
&
ofs
,
OF_EXIST
);
ok
(
hFile
==
FALSE
,
"hFile != FALSE : %ld
\n
"
,
GetLastError
());
}
START_TEST
(
file
)
{
test__hread
(
);
...
...
@@ -1418,4 +1442,5 @@ START_TEST(file)
test_GetFileType
();
test_async_file_errors
();
test_read_write
();
test_OpenFile_exists
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment