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
a5229fc5
Commit
a5229fc5
authored
Sep 11, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Sep 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add NtCreateFile tests for invalid chars in file/dir name.
parent
195ee2f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
file.c
dlls/ntdll/tests/file.c
+32
-1
No files found.
dlls/ntdll/tests/file.c
View file @
a5229fc5
...
...
@@ -160,8 +160,10 @@ static void create_file_test(void)
{
static
const
WCHAR
systemrootW
[]
=
{
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'R'
,
'o'
,
'o'
,
't'
,
'\\'
,
'f'
,
'a'
,
'i'
,
'l'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
questionmarkInvalidNameW
[]
=
{
'a'
,
'f'
,
'i'
,
'l'
,
'e'
,
'?'
,
0
};
static
const
WCHAR
pipeInvalidNameW
[]
=
{
'a'
,
'|'
,
'b'
,
0
};
NTSTATUS
status
;
HANDLE
dir
;
HANDLE
dir
,
file
;
WCHAR
path
[
MAX_PATH
];
OBJECT_ATTRIBUTES
attr
;
IO_STATUS_BLOCK
io
;
...
...
@@ -249,6 +251,35 @@ static void create_file_test(void)
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"open %s failed %x
\n
"
,
wine_dbgstr_w
(
nameW
.
Buffer
),
status
);
/* Invalid chars in file/dirnames */
pRtlDosPathNameToNtPathName_U
(
questionmarkInvalidNameW
,
&
nameW
,
NULL
,
NULL
);
attr
.
ObjectName
=
&
nameW
;
status
=
pNtCreateFile
(
&
dir
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
NULL
,
0
,
FILE_SHARE_READ
,
FILE_CREATE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
,
NULL
,
0
);
ok
(
status
==
STATUS_OBJECT_NAME_INVALID
,
"open %s failed %x
\n
"
,
wine_dbgstr_w
(
nameW
.
Buffer
),
status
);
status
=
pNtCreateFile
(
&
file
,
GENERIC_WRITE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
NULL
,
0
,
0
,
FILE_CREATE
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
,
NULL
,
0
);
ok
(
status
==
STATUS_OBJECT_NAME_INVALID
,
"open %s failed %x
\n
"
,
wine_dbgstr_w
(
nameW
.
Buffer
),
status
);
pRtlDosPathNameToNtPathName_U
(
pipeInvalidNameW
,
&
nameW
,
NULL
,
NULL
);
attr
.
ObjectName
=
&
nameW
;
status
=
pNtCreateFile
(
&
dir
,
GENERIC_READ
|
SYNCHRONIZE
,
&
attr
,
&
io
,
NULL
,
0
,
FILE_SHARE_READ
,
FILE_CREATE
,
FILE_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
,
NULL
,
0
);
ok
(
status
==
STATUS_OBJECT_NAME_INVALID
,
"open %s failed %x
\n
"
,
wine_dbgstr_w
(
nameW
.
Buffer
),
status
);
status
=
pNtCreateFile
(
&
file
,
GENERIC_WRITE
|
SYNCHRONIZE
,
&
attr
,
&
io
,
NULL
,
0
,
0
,
FILE_CREATE
,
FILE_NON_DIRECTORY_FILE
|
FILE_SYNCHRONOUS_IO_NONALERT
,
NULL
,
0
);
ok
(
status
==
STATUS_OBJECT_NAME_INVALID
,
"open %s failed %x
\n
"
,
wine_dbgstr_w
(
nameW
.
Buffer
),
status
);
}
static
void
open_file_test
(
void
)
...
...
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