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
d97e7baa
Commit
d97e7baa
authored
Mar 06, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add some tests for CreateFile called on a directory instead of a file.
parent
865b503a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
file.c
dlls/kernel32/tests/file.c
+40
-0
No files found.
dlls/kernel32/tests/file.c
View file @
d97e7baa
...
...
@@ -3560,6 +3560,46 @@ static void test_CreateFile(void)
GetTempPathA
(
MAX_PATH
,
temp_path
);
GetTempFileNameA
(
temp_path
,
"tmp"
,
0
,
file_name
);
i
=
strlen
(
temp_path
);
if
(
i
&&
temp_path
[
i
-
1
]
==
'\\'
)
temp_path
[
i
-
1
]
=
0
;
for
(
i
=
0
;
i
<=
5
;
i
++
)
{
SetLastError
(
0xdeadbeef
);
hfile
=
CreateFileA
(
temp_path
,
GENERIC_READ
,
0
,
NULL
,
i
,
0
,
0
);
ok
(
hfile
==
INVALID_HANDLE_VALUE
,
"CreateFile should fail
\n
"
);
if
(
i
==
0
||
i
==
5
)
{
/* FIXME: remove once Wine is fixed */
if
(
i
==
5
)
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d: expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
i
,
GetLastError
());
else
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d: expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
i
,
GetLastError
());
}
else
{
/* FIXME: remove once Wine is fixed */
if
(
i
==
1
)
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"%d: expected ERROR_ACCESS_DENIED, got %d
\n
"
,
i
,
GetLastError
());
else
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"%d: expected ERROR_ACCESS_DENIED, got %d
\n
"
,
i
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
hfile
=
CreateFileA
(
temp_path
,
GENERIC_WRITE
,
0
,
NULL
,
i
,
0
,
0
);
ok
(
hfile
==
INVALID_HANDLE_VALUE
,
"CreateFile should fail
\n
"
);
if
(
i
==
0
)
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d: expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
i
,
GetLastError
());
else
{
/* FIXME: remove once Wine is fixed */
if
(
i
==
1
)
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"%d: expected ERROR_ACCESS_DENIED, got %d
\n
"
,
i
,
GetLastError
());
else
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"%d: expected ERROR_ACCESS_DENIED, got %d
\n
"
,
i
,
GetLastError
());
}
}
for
(
i
=
0
;
i
<
sizeof
(
td
)
/
sizeof
(
td
[
0
]);
i
++
)
{
SetLastError
(
0xdeadbeef
);
...
...
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