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
5b75d943
Commit
5b75d943
authored
Mar 10, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add tests for linking a file to the same name.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bc9d4eb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
file.c
dlls/ntdll/tests/file.c
+30
-0
No files found.
dlls/ntdll/tests/file.c
View file @
5b75d943
...
...
@@ -2759,6 +2759,36 @@ static void test_file_link_information(void)
HeapFree
(
GetProcessHeap
(),
0
,
fli
);
delete_object
(
oldpath
);
delete_object
(
newpath
);
/* oldpath == newpath */
res
=
GetTempFileNameW
(
tmp_path
,
fooW
,
0
,
oldpath
);
ok
(
res
!=
0
,
"failed to create temp file
\n
"
);
handle
=
CreateFileW
(
oldpath
,
GENERIC_WRITE
|
DELETE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"CreateFileW failed
\n
"
);
pRtlDosPathNameToNtPathName_U
(
oldpath
,
&
name_str
,
NULL
,
NULL
);
fli
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
FILE_RENAME_INFORMATION
)
+
name_str
.
Length
);
fli
->
ReplaceIfExists
=
FALSE
;
fli
->
RootDirectory
=
NULL
;
fli
->
FileNameLength
=
name_str
.
Length
;
memcpy
(
fli
->
FileName
,
name_str
.
Buffer
,
name_str
.
Length
);
pRtlFreeUnicodeString
(
&
name_str
);
U
(
io
).
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fli
,
sizeof
(
FILE_LINK_INFORMATION
)
+
fli
->
FileNameLength
,
FileLinkInformation
);
todo_wine
ok
(
U
(
io
).
Status
==
0xdeadbeef
,
"got io status %#x
\n
"
,
U
(
io
).
Status
);
ok
(
res
==
STATUS_OBJECT_NAME_COLLISION
,
"got status %x
\n
"
,
res
);
fli
->
ReplaceIfExists
=
TRUE
;
U
(
io
).
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
fli
,
sizeof
(
FILE_LINK_INFORMATION
)
+
fli
->
FileNameLength
,
FileLinkInformation
);
todo_wine
ok
(
U
(
io
).
Status
==
STATUS_SUCCESS
,
"got io status %#x
\n
"
,
U
(
io
).
Status
);
todo_wine
ok
(
res
==
STATUS_SUCCESS
,
"got status %x
\n
"
,
res
);
ok
(
GetFileAttributesW
(
oldpath
)
!=
INVALID_FILE_ATTRIBUTES
,
"file should exist
\n
"
);
CloseHandle
(
handle
);
HeapFree
(
GetProcessHeap
(),
0
,
fli
);
delete_object
(
oldpath
);
}
static
void
test_file_both_information
(
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