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
98c929d7
Commit
98c929d7
authored
Aug 30, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Sep 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Test NtQueryDirectoryFile with wildcards.
parent
9e04cd31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
3 deletions
+33
-3
directory.c
dlls/ntdll/tests/directory.c
+33
-3
No files found.
dlls/ntdll/tests/directory.c
View file @
98c929d7
...
...
@@ -70,6 +70,7 @@ static struct testfile_s {
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
0xe9
,
'a'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
0xc9
,
'b'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'e'
,
'a'
,
'.'
,
't'
,
'm'
,
'p'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_NORMAL
,
{
'e'
,
'a'
},
"normal"
},
{
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'.'
},
". directory"
},
{
0
,
FILE_ATTRIBUTE_DIRECTORY
,
{
'.'
,
'.'
},
".. directory"
}
};
...
...
@@ -237,13 +238,13 @@ static void test_flags_NtQueryDirectoryFile(OBJECT_ATTRIBUTES *attr, const char
}
ok
(
numfiles
<
max_test_dir_size
,
"too many loops
\n
"
);
if
(
mask
)
if
(
mask
&&
!
wcspbrk
(
mask
->
Buffer
,
L"*?"
)
)
for
(
i
=
0
;
i
<
test_dir_count
;
i
++
)
ok
(
testfiles
[
i
].
nfound
==
(
testfiles
[
i
].
name
==
mask
->
Buffer
),
"Wrong number %d of %s files found (single_entry=%d,mask=%s)
\n
"
,
testfiles
[
i
].
nfound
,
testfiles
[
i
].
description
,
single_entry
,
wine_dbgstr_wn
(
mask
->
Buffer
,
mask
->
Length
/
sizeof
(
WCHAR
)
));
else
else
if
(
!
mask
)
for
(
i
=
0
;
i
<
test_dir_count
;
i
++
)
ok
(
testfiles
[
i
].
nfound
==
1
,
"Wrong number %d of %s files found (single_entry=%d,restart=%d)
\n
"
,
testfiles
[
i
].
nfound
,
testfiles
[
i
].
description
,
single_entry
,
restart_flag
);
...
...
@@ -448,11 +449,27 @@ static void test_NtQueryDirectoryFile_classes( HANDLE handle, UNICODE_STRING *ma
static
void
test_NtQueryDirectoryFile
(
void
)
{
static
const
struct
{
const
WCHAR
*
mask
;
int
found
[
ARRAY_SIZE
(
testfiles
)];
BOOL
todo_missing
;
}
mask_tests
[]
=
{
{
L"*."
,
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
},
TRUE
},
{
L"*.*"
,
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
},
TRUE
},
{
L"*.**"
,
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
1
,
1
},
TRUE
},
{
L"*"
,
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
}},
{
L"**"
,
{
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
}},
{
L"??.???"
,
{
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
0
,
0
}},
};
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
ntdirname
,
mask
;
char
testdirA
[
MAX_PATH
],
buffer
[
MAX_PATH
];
WCHAR
testdirW
[
MAX_PATH
];
int
i
;
int
i
,
j
;
IO_STATUS_BLOCK
io
;
WCHAR
short_name
[
12
];
UINT
data_size
;
...
...
@@ -494,6 +511,19 @@ static void test_NtQueryDirectoryFile(void)
test_flags_NtQueryDirectoryFile
(
&
attr
,
testdirA
,
&
mask
,
TRUE
,
FALSE
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
mask_tests
);
++
i
)
{
winetest_push_context
(
"mask %s"
,
debugstr_w
(
mask_tests
[
i
].
mask
));
RtlInitUnicodeString
(
&
mask
,
mask_tests
[
i
].
mask
);
test_flags_NtQueryDirectoryFile
(
&
attr
,
testdirA
,
&
mask
,
FALSE
,
TRUE
);
for
(
j
=
0
;
j
<
test_dir_count
;
j
++
)
{
todo_wine_if
(
mask_tests
[
i
].
todo_missing
&&
!
mask_tests
[
i
].
found
[
j
])
ok
(
testfiles
[
j
].
nfound
==
mask_tests
[
i
].
found
[
j
],
"%S, got %d.
\n
"
,
testfiles
[
j
].
name
,
testfiles
[
j
].
nfound
);
}
winetest_pop_context
();
}
/* short path passed as mask */
status
=
pNtOpenFile
(
&
dirh
,
SYNCHRONIZE
|
FILE_LIST_DIRECTORY
,
&
attr
,
&
io
,
FILE_SHARE_READ
,
FILE_SYNCHRONOUS_IO_NONALERT
|
FILE_OPEN_FOR_BACKUP_INTENT
|
FILE_DIRECTORY_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