@@ -16,9 +16,10 @@ use windows_sys::Win32::Foundation::{
1616 GENERIC_WRITE , HANDLE , INVALID_HANDLE_VALUE , STATUS_OBJECT_NAME_COLLISION , STATUS_PENDING ,
1717 STATUS_SUCCESS , SUCCESS , UNICODE_STRING ,
1818} ;
19+ use windows_sys:: Win32 :: Foundation :: { OBJ_CASE_INSENSITIVE , OBJ_INHERIT } ;
1920use windows_sys:: Win32 :: Security :: {
20- SECURITY_ATTRIBUTES , SECURITY_DYNAMIC_TRACKING , SECURITY_QUALITY_OF_SERVICE ,
21- SECURITY_STATIC_TRACKING ,
21+ SECURITY_ATTRIBUTES , SECURITY_DESCRIPTOR , SECURITY_DYNAMIC_TRACKING ,
22+ SECURITY_QUALITY_OF_SERVICE , SECURITY_STATIC_TRACKING ,
2223} ;
2324use windows_sys:: Win32 :: Storage :: FileSystem :: {
2425 CREATE_ALWAYS , CREATE_NEW , DELETE , FILE_ATTRIBUTE_ARCHIVE , FILE_ATTRIBUTE_COMPRESSED ,
@@ -36,7 +37,6 @@ use windows_sys::Win32::Storage::FileSystem::{
3637 OPEN_ALWAYS , OPEN_EXISTING , SECURITY_CONTEXT_TRACKING , SECURITY_EFFECTIVE_ONLY ,
3738 SECURITY_SQOS_PRESENT , SYNCHRONIZE , TRUNCATE_EXISTING ,
3839} ;
39- use windows_sys:: Win32 :: System :: Kernel :: { OBJ_CASE_INSENSITIVE , OBJ_INHERIT } ;
4040use windows_sys:: Win32 :: System :: WindowsProgramming :: {
4141 FILE_OPENED , FILE_OPEN_NO_RECALL , FILE_OPEN_REMOTE_INSTANCE , FILE_OVERWRITTEN ,
4242} ;
@@ -159,7 +159,9 @@ pub unsafe fn CreateFileAtW(
159159 objectattributes. ObjectName = & mut unicode_string;
160160 objectattributes. Attributes = attributes;
161161 if !lpsecurityattributes. is_null ( ) {
162- objectattributes. SecurityDescriptor = ( * lpsecurityattributes) . lpSecurityDescriptor ;
162+ objectattributes. SecurityDescriptor = ( * lpsecurityattributes)
163+ . lpSecurityDescriptor
164+ . cast :: < SECURITY_DESCRIPTOR > ( ) ;
163165 }
164166
165167 // If needed, set `objectattributes`' `SecurityQualityOfService` field.
@@ -172,7 +174,7 @@ pub unsafe fn CreateFileAtW(
172174 SECURITY_DYNAMIC_TRACKING
173175 } else {
174176 SECURITY_STATIC_TRACKING
175- } ;
177+ } as u8 ;
176178 qos. EffectiveOnly = ( ( dwflagsandattributes & SECURITY_EFFECTIVE_ONLY ) != 0 ) as _ ;
177179
178180 objectattributes. SecurityQualityOfService =
0 commit comments