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
5eac14f1
Commit
5eac14f1
authored
Nov 22, 2010
by
Louis Lenders
Committed by
Alexandre Julliard
Nov 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add tests for NtQueryVolumeInformationFile with FileFsVolumeInformation class.
parent
d360b6f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
file.c
dlls/ntdll/tests/file.c
+59
-0
No files found.
dlls/ntdll/tests/file.c
View file @
5eac14f1
...
...
@@ -35,6 +35,7 @@
#include "wine/test.h"
#include "winternl.h"
#include "winuser.h"
#include "winioctl.h"
#ifndef IO_COMPLETION_ALL_ACCESS
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
...
...
@@ -75,6 +76,7 @@ static NTSTATUS (WINAPI *pNtSetInformationFile)(HANDLE, PIO_STATUS_BLOCK, PVOID,
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationFile
)(
HANDLE
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
FILE_INFORMATION_CLASS
);
static
NTSTATUS
(
WINAPI
*
pNtQueryDirectoryFile
)(
HANDLE
,
HANDLE
,
PIO_APC_ROUTINE
,
PVOID
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
FILE_INFORMATION_CLASS
,
BOOLEAN
,
PUNICODE_STRING
,
BOOLEAN
);
static
NTSTATUS
(
WINAPI
*
pNtQueryVolumeInformationFile
)(
HANDLE
,
PIO_STATUS_BLOCK
,
PVOID
,
ULONG
,
FS_INFORMATION_CLASS
);
static
inline
BOOL
is_signaled
(
HANDLE
obj
)
{
...
...
@@ -1458,6 +1460,61 @@ static void test_file_all_name_information(void)
HeapFree
(
GetProcessHeap
(),
0
,
file_name
);
}
static
void
test_query_volume_information_file
(
void
)
{
NTSTATUS
status
;
HANDLE
dir
;
WCHAR
path
[
MAX_PATH
];
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
io
;
UNICODE_STRING
nameW
;
UINT
len
;
FILE_FS_VOLUME_INFORMATION
*
ffvi
;
BYTE
buf
[
sizeof
(
FILE_FS_VOLUME_INFORMATION
)
+
MAX_PATH
*
sizeof
(
WCHAR
)];
len
=
GetWindowsDirectoryW
(
path
,
MAX_PATH
);
pRtlDosPathNameToNtPathName_U
(
path
,
&
nameW
,
NULL
,
NULL
);
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
&
nameW
;
attr
.
Attributes
=
OBJ_CASE_INSENSITIVE
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
status
=
pNtOpenFile
(
&
dir
,
SYNCHRONIZE
|
FILE_LIST_DIRECTORY
,
&
attr
,
&
io
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
);
ok
(
!
status
,
"open %s failed %x
\n
"
,
wine_dbgstr_w
(
nameW
.
Buffer
),
status
);
pRtlFreeUnicodeString
(
&
nameW
);
ZeroMemory
(
buf
,
sizeof
(
buf
)
);
U
(
io
).
Status
=
0xdadadada
;
io
.
Information
=
0xcacacaca
;
status
=
pNtQueryVolumeInformationFile
(
dir
,
&
io
,
buf
,
sizeof
(
buf
),
FileFsVolumeInformation
);
ffvi
=
(
FILE_FS_VOLUME_INFORMATION
*
)
buf
;
todo_wine
{
ok
(
status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %d
\n
"
,
status
);
ok
(
U
(
io
).
Status
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %d
\n
"
,
U
(
io
).
Status
);
ok
(
io
.
Information
==
(
FIELD_OFFSET
(
FILE_FS_VOLUME_INFORMATION
,
VolumeLabel
)
+
ffvi
->
VolumeLabelLength
),
"expected %d, got %lu
\n
"
,
(
FIELD_OFFSET
(
FILE_FS_VOLUME_INFORMATION
,
VolumeLabel
)
+
ffvi
->
VolumeLabelLength
),
io
.
Information
);
ok
(
ffvi
->
VolumeCreationTime
.
QuadPart
!=
0
,
"Missing VolumeCreationTime
\n
"
);
ok
(
ffvi
->
VolumeSerialNumber
!=
0
,
"Missing VolumeSerialNumber
\n
"
);
ok
(
ffvi
->
SupportsObjects
==
1
,
"expected 1, got %d
\n
"
,
ffvi
->
SupportsObjects
);
}
ok
(
ffvi
->
VolumeLabelLength
==
lstrlenW
(
ffvi
->
VolumeLabel
)
*
sizeof
(
WCHAR
),
"expected %d, got %d"
,
lstrlenW
(
ffvi
->
VolumeLabel
)
*
sizeof
(
WCHAR
),
ffvi
->
VolumeLabelLength
);
trace
(
"VolumeSerialNumber: %x VolumeLabelName: %s
\n
"
,
ffvi
->
VolumeSerialNumber
,
wine_dbgstr_w
(
ffvi
->
VolumeLabel
));
CloseHandle
(
dir
);
}
START_TEST
(
file
)
{
HMODULE
hkernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
...
...
@@ -1492,6 +1549,7 @@ START_TEST(file)
pNtSetInformationFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtSetInformationFile"
);
pNtQueryInformationFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryInformationFile"
);
pNtQueryDirectoryFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryDirectoryFile"
);
pNtQueryVolumeInformationFile
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtQueryVolumeInformationFile"
);
create_file_test
();
open_file_test
();
...
...
@@ -1504,4 +1562,5 @@ START_TEST(file)
test_file_both_information
();
test_file_name_information
();
test_file_all_name_information
();
test_query_volume_information_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