Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
eb11dee4
Commit
eb11dee4
authored
Jan 12, 2011
by
Matteo Bruni
Committed by
Alexandre Julliard
Jan 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add a FILE_APPEND_DATA test.
parent
e86353fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
file.c
dlls/ntdll/tests/file.c
+41
-0
No files found.
dlls/ntdll/tests/file.c
View file @
eb11dee4
...
...
@@ -816,6 +816,46 @@ static void read_file_test(void)
CloseHandle
(
event
);
}
static
void
append_file_test
(
void
)
{
const
char
text
[]
=
"foobar"
;
HANDLE
handle
;
NTSTATUS
status
;
IO_STATUS_BLOCK
iosb
;
DWORD
written
;
char
buffer
[
128
];
GetTempFileNameA
(
"."
,
"foo"
,
0
,
buffer
);
/* It is possible to open a file with only FILE_APPEND_DATA access flags.
It matches the O_WRONLY|O_APPEND open() posix behavior */
handle
=
CreateFileA
(
buffer
,
FILE_APPEND_DATA
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_FLAG_DELETE_ON_CLOSE
,
0
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"Failed to create a temp file in FILE_APPEND_DATA mode.
\n
"
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
{
skip
(
"Couldn't create a temporary file, skipping FILE_APPEND_DATA test
\n
"
);
return
;
}
iosb
.
Status
=
STATUS_PENDING
;
iosb
.
Information
=
0
;
status
=
NtWriteFile
(
handle
,
NULL
,
NULL
,
NULL
,
&
iosb
,
text
,
sizeof
(
text
),
NULL
,
NULL
);
if
(
status
==
STATUS_PENDING
)
{
WaitForSingleObject
(
handle
,
INFINITE
);
status
=
iosb
.
Status
;
}
written
=
iosb
.
Information
;
todo_wine
ok
(
status
==
STATUS_SUCCESS
&&
written
==
sizeof
(
text
),
"FILE_APPEND_DATA NtWriteFile failed
\n
"
);
CloseHandle
(
handle
);
}
static
void
nt_mailslot_test
(
void
)
{
HANDLE
hslot
;
...
...
@@ -1555,6 +1595,7 @@ START_TEST(file)
open_file_test
();
delete_file_test
();
read_file_test
();
append_file_test
();
nt_mailslot_test
();
test_iocompletion
();
test_file_basic_information
();
...
...
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