File tree Expand file tree Collapse file tree
resources/windows_firewall/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ impl SafeVariant {
2121 Self ( VARIANT :: default ( ) )
2222 }
2323
24- fn as_mut_ptr ( & mut self ) -> * mut VARIANT {
24+ fn as_mut ( & mut self ) -> & mut VARIANT {
2525 & mut self . 0
2626 }
2727
@@ -33,7 +33,7 @@ impl SafeVariant {
3333impl Drop for SafeVariant {
3434 fn drop ( & mut self ) {
3535 if let Err ( e) = unsafe { VariantClear ( & mut self . 0 ) } {
36- crate :: write_error ( & format ! ( "Warning: VariantClear failed with HRESULT: {:#010x}" , e. code( ) . 0 ) ) ;
36+ crate :: write_error ( & format ! ( "Warning: VariantClear failed with HRESULT: {:#010x}" , e. code( ) . 0 as u32 ) ) ;
3737 }
3838 }
3939}
@@ -81,8 +81,7 @@ impl FirewallStore {
8181 loop {
8282 let mut fetched = 0u32 ;
8383 let mut safe_variant = SafeVariant :: new ( ) ;
84- let variant_slice = unsafe { std:: slice:: from_raw_parts_mut ( safe_variant. as_mut_ptr ( ) , 1 ) } ;
85- let hr = unsafe { enum_variant. Next ( variant_slice, & mut fetched) } ;
84+ let hr = unsafe { enum_variant. Next ( std:: slice:: from_mut ( safe_variant. as_mut ( ) ) , & mut fetched) } ;
8685 if hr == S_FALSE || fetched == 0 {
8786 break ;
8887 }
You can’t perform that action at this time.
0 commit comments