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
0e6b5811
Commit
0e6b5811
authored
Jun 20, 2023
by
Joel Holdsworth
Committed by
Alexandre Julliard
Jun 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add tests for FILE_DISPOSITION_POSIX_SEMANTICS.
Signed-off-by:
Joel Holdsworth
<
joel@airwebreathe.org.uk
>
parent
146333fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
file.c
dlls/ntdll/tests/file.c
+41
-0
No files found.
dlls/ntdll/tests/file.c
View file @
0e6b5811
...
...
@@ -3061,6 +3061,47 @@ static void test_file_disposition_information(void)
fileDeleted
=
GetFileAttributesA
(
buffer
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
fileDeleted
,
"File should have been deleted
\n
"
);
/* file is deleted after handle with FILE_DISPOSITION_POSIX_SEMANTICS is closed */
/* FileDispositionInformationEx is only supported on Windows 10 build 1809 and later */
GetTempFileNameA
(
tmp_path
,
"dis"
,
0
,
buffer
);
handle
=
CreateFileA
(
buffer
,
GENERIC_WRITE
|
DELETE
,
FILE_SHARE_DELETE
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"failed to create temp file
\n
"
);
handle2
=
CreateFileA
(
buffer
,
DELETE
,
FILE_SHARE_DELETE
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
handle2
!=
INVALID_HANDLE_VALUE
,
"failed to open temp file
\n
"
);
fdie
.
Flags
=
FILE_DISPOSITION_DELETE
|
FILE_DISPOSITION_POSIX_SEMANTICS
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
&
fdie
,
sizeof
fdie
,
FileDispositionInformationEx
);
ok
(
res
==
STATUS_INVALID_INFO_CLASS
||
res
==
STATUS_SUCCESS
,
"unexpected FileDispositionInformationEx result (expected STATUS_SUCCESS or SSTATUS_INVALID_INFO_CLASS, got %lx)
\n
"
,
res
);
CloseHandle
(
handle
);
if
(
res
==
STATUS_SUCCESS
)
{
fileDeleted
=
GetFileAttributesA
(
buffer
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
todo_wine
ok
(
fileDeleted
,
"File should have been deleted
\n
"
);
}
CloseHandle
(
handle2
);
/* file is deleted after handle with FILE_DISPOSITION_POSIX_SEMANTICS is closed */
/* FileDispositionInformationEx is only supported on Windows 10 build 1809 and later */
GetTempFileNameA
(
tmp_path
,
"dis"
,
0
,
buffer
);
handle
=
CreateFileA
(
buffer
,
GENERIC_WRITE
|
DELETE
,
FILE_SHARE_DELETE
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"failed to create temp file
\n
"
);
handle2
=
CreateFileA
(
buffer
,
DELETE
,
FILE_SHARE_DELETE
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
handle2
!=
INVALID_HANDLE_VALUE
,
"failed to open temp file
\n
"
);
fdie
.
Flags
=
FILE_DISPOSITION_DELETE
|
FILE_DISPOSITION_POSIX_SEMANTICS
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
&
fdie
,
sizeof
fdie
,
FileDispositionInformationEx
);
ok
(
res
==
STATUS_INVALID_INFO_CLASS
||
res
==
STATUS_SUCCESS
,
"unexpected FileDispositionInformationEx result (expected STATUS_SUCCESS or SSTATUS_INVALID_INFO_CLASS, got %lx)
\n
"
,
res
);
CloseHandle
(
handle2
);
fileDeleted
=
GetFileAttributesA
(
buffer
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
!
fileDeleted
,
"File shouldn't have been deleted
\n
"
);
CloseHandle
(
handle
);
if
(
res
==
STATUS_SUCCESS
)
{
fileDeleted
=
GetFileAttributesA
(
buffer
)
==
INVALID_FILE_ATTRIBUTES
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
;
ok
(
fileDeleted
,
"File should have been deleted
\n
"
);
}
/* cannot set disposition on readonly file */
GetTempFileNameA
(
tmp_path
,
"dis"
,
0
,
buffer
);
DeleteFileA
(
buffer
);
...
...
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