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
4df0162c
Commit
4df0162c
authored
Sep 25, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Test NtQueryVolumeInformationFile calls on named pipe object.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b2554c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
9 deletions
+56
-9
pipe.c
dlls/ntdll/tests/pipe.c
+41
-0
winternl.h
include/winternl.h
+15
-9
No files found.
dlls/ntdll/tests/pipe.c
View file @
4df0162c
...
...
@@ -73,6 +73,7 @@ static NTSTATUS (WINAPI *pNtCreateNamedPipeFile) (PHANDLE handle, ULONG access,
ULONG
inbound_quota
,
ULONG
outbound_quota
,
PLARGE_INTEGER
timeout
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationFile
)
(
IN
HANDLE
FileHandle
,
OUT
PIO_STATUS_BLOCK
IoStatusBlock
,
OUT
PVOID
FileInformation
,
IN
ULONG
Length
,
IN
FILE_INFORMATION_CLASS
FileInformationClass
);
static
NTSTATUS
(
WINAPI
*
pNtQueryVolumeInformationFile
)(
HANDLE
handle
,
PIO_STATUS_BLOCK
io
,
void
*
buffer
,
ULONG
length
,
FS_INFORMATION_CLASS
info_class
);
static
NTSTATUS
(
WINAPI
*
pNtSetInformationFile
)
(
HANDLE
handle
,
PIO_STATUS_BLOCK
io
,
PVOID
ptr
,
ULONG
len
,
FILE_INFORMATION_CLASS
class
);
static
NTSTATUS
(
WINAPI
*
pNtCancelIoFile
)
(
HANDLE
hFile
,
PIO_STATUS_BLOCK
io_status
);
static
NTSTATUS
(
WINAPI
*
pNtCancelIoFileEx
)
(
HANDLE
hFile
,
IO_STATUS_BLOCK
*
iosb
,
IO_STATUS_BLOCK
*
io_status
);
...
...
@@ -94,6 +95,7 @@ static BOOL init_func_ptrs(void)
loadfunc
(
NtFsControlFile
)
loadfunc
(
NtCreateNamedPipeFile
)
loadfunc
(
NtQueryInformationFile
)
loadfunc
(
NtQueryVolumeInformationFile
)
loadfunc
(
NtSetInformationFile
)
loadfunc
(
NtCancelIoFile
)
loadfunc
(
NtCancelIoFileEx
)
...
...
@@ -1100,6 +1102,43 @@ static void read_pipe_test(ULONG pipe_flags, ULONG pipe_type)
CloseHandle
(
event
);
}
static
void
test_volume_info
(
void
)
{
FILE_FS_DEVICE_INFORMATION
*
device_info
;
IO_STATUS_BLOCK
iosb
;
HANDLE
read
,
write
;
char
buffer
[
128
];
NTSTATUS
status
;
if
(
!
create_pipe_pair
(
&
read
,
&
write
,
FILE_FLAG_OVERLAPPED
|
PIPE_ACCESS_INBOUND
,
PIPE_TYPE_MESSAGE
,
4096
))
return
;
memset
(
buffer
,
0xaa
,
sizeof
(
buffer
)
);
status
=
pNtQueryVolumeInformationFile
(
read
,
&
iosb
,
buffer
,
sizeof
(
buffer
),
FileFsDeviceInformation
);
todo_wine
{
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryVolumeInformationFile failed: %x
\n
"
,
status
);
ok
(
iosb
.
Information
==
sizeof
(
*
device_info
),
"Information = %lu
\n
"
,
iosb
.
Information
);
device_info
=
(
FILE_FS_DEVICE_INFORMATION
*
)
buffer
;
ok
(
device_info
->
DeviceType
==
FILE_DEVICE_NAMED_PIPE
,
"DeviceType = %u
\n
"
,
device_info
->
DeviceType
);
ok
(
!
(
device_info
->
Characteristics
&
~
FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
),
"Characteristics = %x
\n
"
,
device_info
->
Characteristics
);
}
memset
(
buffer
,
0xaa
,
sizeof
(
buffer
)
);
status
=
pNtQueryVolumeInformationFile
(
write
,
&
iosb
,
buffer
,
sizeof
(
buffer
),
FileFsDeviceInformation
);
todo_wine
{
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryVolumeInformationFile failed: %x
\n
"
,
status
);
ok
(
iosb
.
Information
==
sizeof
(
*
device_info
),
"Information = %lu
\n
"
,
iosb
.
Information
);
device_info
=
(
FILE_FS_DEVICE_INFORMATION
*
)
buffer
;
ok
(
device_info
->
DeviceType
==
FILE_DEVICE_NAMED_PIPE
,
"DeviceType = %u
\n
"
,
device_info
->
DeviceType
);
ok
(
!
(
device_info
->
Characteristics
&
~
FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
),
"Characteristics = %x
\n
"
,
device_info
->
Characteristics
);
}
CloseHandle
(
read
);
CloseHandle
(
write
);
}
START_TEST
(
pipe
)
{
if
(
!
init_func_ptrs
())
...
...
@@ -1141,4 +1180,6 @@ START_TEST(pipe)
read_pipe_test
(
PIPE_ACCESS_OUTBOUND
,
PIPE_TYPE_MESSAGE
);
trace
(
"starting message read in message mode server -> client
\n
"
);
read_pipe_test
(
PIPE_ACCESS_OUTBOUND
,
PIPE_TYPE_MESSAGE
|
PIPE_READMODE_MESSAGE
);
test_volume_info
();
}
include/winternl.h
View file @
4df0162c
...
...
@@ -1715,15 +1715,21 @@ typedef struct _RTL_HANDLE_TABLE
#define FILE_MAXIMUM_DISPOSITION 5
/* Characteristics of a File System */
#define FILE_REMOVABLE_MEDIA 0x00000001
#define FILE_READ_ONLY_DEVICE 0x00000002
#define FILE_FLOPPY_DISKETTE 0x00000004
#define FILE_WRITE_ONE_MEDIA 0x00000008
#define FILE_REMOTE_DEVICE 0x00000010
#define FILE_DEVICE_IS_MOUNTED 0x00000020
#define FILE_VIRTUAL_VOLUME 0x00000040
#define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
#define FILE_DEVICE_SECURE_OPEN 0x00000100
#define FILE_REMOVABLE_MEDIA 0x00000001
#define FILE_READ_ONLY_DEVICE 0x00000002
#define FILE_FLOPPY_DISKETTE 0x00000004
#define FILE_WRITE_ONE_MEDIA 0x00000008
#define FILE_REMOTE_DEVICE 0x00000010
#define FILE_DEVICE_IS_MOUNTED 0x00000020
#define FILE_VIRTUAL_VOLUME 0x00000040
#define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080
#define FILE_DEVICE_SECURE_OPEN 0x00000100
#define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800
#define FILE_CHARACTERISTIC_TS_DEVICE 0x00001000
#define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000
#define FILE_CHARACTERISTIC_CSV 0x00010000
#define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000
#define FILE_PORTABLE_DEVICE 0x00040000
/* options for NtCreateNamedPipeFile */
#define FILE_PIPE_INBOUND 0x00000000
...
...
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