3
3
use std:: mem;
4
4
use std:: os:: windows:: io:: HandleOrInvalid ;
5
5
use std:: ptr:: null_mut;
6
+ use windows_sys:: Wdk :: Foundation :: OBJECT_ATTRIBUTES ;
7
+ use windows_sys:: Wdk :: Storage :: FileSystem :: {
8
+ NtCreateFile , FILE_CREATE , FILE_DELETE_ON_CLOSE , FILE_NON_DIRECTORY_FILE ,
9
+ FILE_NO_INTERMEDIATE_BUFFERING , FILE_OPEN , FILE_OPEN_FOR_BACKUP_INTENT , FILE_OPEN_IF ,
10
+ FILE_OPEN_REPARSE_POINT , FILE_OVERWRITE , FILE_OVERWRITE_IF , FILE_RANDOM_ACCESS ,
11
+ FILE_SEQUENTIAL_ONLY , FILE_SYNCHRONOUS_IO_NONALERT , FILE_WRITE_THROUGH ,
12
+ } ;
6
13
use windows_sys:: Win32 :: Foundation :: {
7
14
RtlNtStatusToDosError , SetLastError , ERROR_ALREADY_EXISTS , ERROR_FILE_EXISTS ,
8
15
ERROR_INVALID_NAME , ERROR_INVALID_PARAMETER , ERROR_NOT_SUPPORTED , GENERIC_ALL , GENERIC_READ ,
@@ -14,29 +21,26 @@ use windows_sys::Win32::Security::{
14
21
SECURITY_STATIC_TRACKING ,
15
22
} ;
16
23
use windows_sys:: Win32 :: Storage :: FileSystem :: {
17
- NtCreateFile , CREATE_ALWAYS , CREATE_NEW , DELETE , FILE_ATTRIBUTE_ARCHIVE ,
18
- FILE_ATTRIBUTE_COMPRESSED , FILE_ATTRIBUTE_DEVICE , FILE_ATTRIBUTE_DIRECTORY , FILE_ATTRIBUTE_EA ,
19
- FILE_ATTRIBUTE_ENCRYPTED , FILE_ATTRIBUTE_HIDDEN , FILE_ATTRIBUTE_INTEGRITY_STREAM ,
20
- FILE_ATTRIBUTE_NORMAL , FILE_ATTRIBUTE_NOT_CONTENT_INDEXED , FILE_ATTRIBUTE_NO_SCRUB_DATA ,
21
- FILE_ATTRIBUTE_OFFLINE , FILE_ATTRIBUTE_PINNED , FILE_ATTRIBUTE_READONLY ,
22
- FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS , FILE_ATTRIBUTE_RECALL_ON_OPEN ,
23
- FILE_ATTRIBUTE_REPARSE_POINT , FILE_ATTRIBUTE_SPARSE_FILE , FILE_ATTRIBUTE_SYSTEM ,
24
- FILE_ATTRIBUTE_TEMPORARY , FILE_ATTRIBUTE_UNPINNED , FILE_ATTRIBUTE_VIRTUAL , FILE_CREATE ,
25
- FILE_CREATION_DISPOSITION , FILE_FLAGS_AND_ATTRIBUTES , FILE_FLAG_BACKUP_SEMANTICS ,
26
- FILE_FLAG_DELETE_ON_CLOSE , FILE_FLAG_NO_BUFFERING , FILE_FLAG_OPEN_NO_RECALL ,
27
- FILE_FLAG_OPEN_REPARSE_POINT , FILE_FLAG_OVERLAPPED , FILE_FLAG_POSIX_SEMANTICS ,
28
- FILE_FLAG_RANDOM_ACCESS , FILE_FLAG_SEQUENTIAL_SCAN , FILE_FLAG_SESSION_AWARE ,
29
- FILE_FLAG_WRITE_THROUGH , FILE_OPEN , FILE_OPEN_IF , FILE_OVERWRITE , FILE_OVERWRITE_IF ,
30
- FILE_READ_ATTRIBUTES , FILE_SHARE_MODE , OPEN_ALWAYS , OPEN_EXISTING , SECURITY_CONTEXT_TRACKING ,
31
- SECURITY_EFFECTIVE_ONLY , SECURITY_SQOS_PRESENT , SYNCHRONIZE , TRUNCATE_EXISTING ,
24
+ CREATE_ALWAYS , CREATE_NEW , DELETE , FILE_ATTRIBUTE_ARCHIVE , FILE_ATTRIBUTE_COMPRESSED ,
25
+ FILE_ATTRIBUTE_DEVICE , FILE_ATTRIBUTE_DIRECTORY , FILE_ATTRIBUTE_EA , FILE_ATTRIBUTE_ENCRYPTED ,
26
+ FILE_ATTRIBUTE_HIDDEN , FILE_ATTRIBUTE_INTEGRITY_STREAM , FILE_ATTRIBUTE_NORMAL ,
27
+ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED , FILE_ATTRIBUTE_NO_SCRUB_DATA , FILE_ATTRIBUTE_OFFLINE ,
28
+ FILE_ATTRIBUTE_PINNED , FILE_ATTRIBUTE_READONLY , FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS ,
29
+ FILE_ATTRIBUTE_RECALL_ON_OPEN , FILE_ATTRIBUTE_REPARSE_POINT , FILE_ATTRIBUTE_SPARSE_FILE ,
30
+ FILE_ATTRIBUTE_SYSTEM , FILE_ATTRIBUTE_TEMPORARY , FILE_ATTRIBUTE_UNPINNED ,
31
+ FILE_ATTRIBUTE_VIRTUAL , FILE_CREATION_DISPOSITION , FILE_FLAGS_AND_ATTRIBUTES ,
32
+ FILE_FLAG_BACKUP_SEMANTICS , FILE_FLAG_DELETE_ON_CLOSE , FILE_FLAG_NO_BUFFERING ,
33
+ FILE_FLAG_OPEN_NO_RECALL , FILE_FLAG_OPEN_REPARSE_POINT , FILE_FLAG_OVERLAPPED ,
34
+ FILE_FLAG_POSIX_SEMANTICS , FILE_FLAG_RANDOM_ACCESS , FILE_FLAG_SEQUENTIAL_SCAN ,
35
+ FILE_FLAG_SESSION_AWARE , FILE_FLAG_WRITE_THROUGH , FILE_READ_ATTRIBUTES , FILE_SHARE_MODE ,
36
+ OPEN_ALWAYS , OPEN_EXISTING , SECURITY_CONTEXT_TRACKING , SECURITY_EFFECTIVE_ONLY ,
37
+ SECURITY_SQOS_PRESENT , SYNCHRONIZE , TRUNCATE_EXISTING ,
32
38
} ;
33
39
use windows_sys:: Win32 :: System :: Kernel :: { OBJ_CASE_INSENSITIVE , OBJ_INHERIT } ;
34
40
use windows_sys:: Win32 :: System :: WindowsProgramming :: {
35
- FILE_DELETE_ON_CLOSE , FILE_NON_DIRECTORY_FILE , FILE_NO_INTERMEDIATE_BUFFERING , FILE_OPENED ,
36
- FILE_OPEN_FOR_BACKUP_INTENT , FILE_OPEN_NO_RECALL , FILE_OPEN_REMOTE_INSTANCE ,
37
- FILE_OPEN_REPARSE_POINT , FILE_OVERWRITTEN , FILE_RANDOM_ACCESS , FILE_SEQUENTIAL_ONLY ,
38
- FILE_SYNCHRONOUS_IO_NONALERT , FILE_WRITE_THROUGH , IO_STATUS_BLOCK , OBJECT_ATTRIBUTES ,
41
+ FILE_OPENED , FILE_OPEN_NO_RECALL , FILE_OPEN_REMOTE_INSTANCE , FILE_OVERWRITTEN ,
39
42
} ;
43
+ use windows_sys:: Win32 :: System :: IO :: IO_STATUS_BLOCK ;
40
44
41
45
// All currently known `FILE_ATTRIBUTE_*` constants, according to
42
46
// windows-sys' documentation.
0 commit comments