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
85aa2067
Commit
85aa2067
authored
Mar 01, 2017
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add test for NtFlushBuffersFile error conditions.
Signed-off-by:
Paul Gofman
<
gofmanp@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
50a047b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
file.c
dlls/ntdll/tests/file.c
+43
-0
No files found.
dlls/ntdll/tests/file.c
View file @
85aa2067
...
...
@@ -80,6 +80,7 @@ static NTSTATUS (WINAPI *pNtQueryDirectoryFile)(HANDLE,HANDLE,PIO_APC_ROUTINE,PV
PVOID
,
ULONG
,
FILE_INFORMATION_CLASS
,
BOOLEAN
,
PUNICODE_STRING
,
BOOLEAN
);
static
NTSTATUS
(
WINAPI
*
pNtQueryVolumeInformationFile
)(
HANDLE
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
FS_INFORMATION_CLASS
);
static
NTSTATUS
(
WINAPI
*
pNtQueryFullAttributesFile
)(
const
OBJECT_ATTRIBUTES
*
,
FILE_NETWORK_OPEN_INFORMATION
*
);
static
NTSTATUS
(
WINAPI
*
pNtFlushBuffersFile
)(
HANDLE
,
IO_STATUS_BLOCK
*
);
static
inline
BOOL
is_signaled
(
HANDLE
obj
)
{
...
...
@@ -4399,6 +4400,46 @@ static void test_ioctl(void)
CloseHandle
(
file
);
}
static
void
test_flush_buffers_file
(
void
)
{
char
path
[
MAX_PATH
],
buffer
[
MAX_PATH
];
HANDLE
hfile
,
hfileread
;
NTSTATUS
status
;
IO_STATUS_BLOCK
io_status_block
;
GetTempPathA
(
MAX_PATH
,
path
);
GetTempFileNameA
(
path
,
"foo"
,
0
,
buffer
);
hfile
=
CreateFileA
(
buffer
,
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
0
);
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"failed to create temp file.
\n
"
);
hfileread
=
CreateFileA
(
buffer
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hfileread
!=
INVALID_HANDLE_VALUE
,
"could not open temp file, error %d.
\n
"
,
GetLastError
());
status
=
pNtFlushBuffersFile
(
hfile
,
NULL
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"expected STATUS_ACCESS_VIOLATION, got %#x.
\n
"
,
status
);
status
=
pNtFlushBuffersFile
(
hfile
,
(
IO_STATUS_BLOCK
*
)
0xdeadbeaf
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"expected STATUS_ACCESS_VIOLATION, got %#x.
\n
"
,
status
);
status
=
pNtFlushBuffersFile
(
hfile
,
&
io_status_block
);
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#x.
\n
"
,
status
);
status
=
pNtFlushBuffersFile
(
hfileread
,
&
io_status_block
);
todo_wine
ok
(
status
==
STATUS_ACCESS_DENIED
,
"expected STATUS_ACCESS_DENIED, got %#x.
\n
"
,
status
);
status
=
pNtFlushBuffersFile
(
NULL
,
&
io_status_block
);
ok
(
status
==
STATUS_INVALID_HANDLE
,
"expected STATUS_INVALID_HANDLE, got %#x.
\n
"
,
status
);
CloseHandle
(
hfileread
);
CloseHandle
(
hfile
);
DeleteFileA
(
buffer
);
}
START_TEST
(
file
)
{
HMODULE
hkernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
...
...
@@ -4436,6 +4477,7 @@ START_TEST(file)
pNtQueryDirectoryFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryDirectoryFile"
);
pNtQueryVolumeInformationFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryVolumeInformationFile"
);
pNtQueryFullAttributesFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryFullAttributesFile"
);
pNtFlushBuffersFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtFlushBuffersFile"
);
test_read_write
();
test_NtCreateFile
();
...
...
@@ -4460,4 +4502,5 @@ START_TEST(file)
test_query_volume_information_file
();
test_query_attribute_information_file
();
test_ioctl
();
test_flush_buffers_file
();
}
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