From 64496a980d6e6c949f859b84806b42fe19095ce0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 21:28:58 +0000 Subject: [PATCH 1/2] Bump windows from 0.58.0 to 0.61.3 Bumps [windows](https://github.com/microsoft/windows-rs) from 0.58.0 to 0.61.3. - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/commits) --- updated-dependencies: - dependency-name: windows dependency-version: 0.61.3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 112 +++++------------------- apps/desktop-tauri/src-tauri/Cargo.toml | 2 +- rust/Cargo.toml | 2 +- 3 files changed, 26 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 493dd5c8..a660b505 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -689,7 +689,7 @@ dependencies = [ "url", "uuid", "which", - "windows 0.58.0", + "windows", "winreg 0.56.0", ] @@ -711,7 +711,7 @@ dependencies = [ "tokio", "tracing", "uuid", - "windows 0.58.0", + "windows", ] [[package]] @@ -2191,7 +2191,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.61.2", + "windows-core", ] [[package]] @@ -4873,8 +4873,8 @@ dependencies = [ "tao-macros", "unicode-segmentation", "url", - "windows 0.61.3", - "windows-core 0.61.2", + "windows", + "windows-core", "windows-version", "x11-dl", ] @@ -4945,7 +4945,7 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows 0.61.3", + "windows", ] [[package]] @@ -5080,7 +5080,7 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows 0.61.3", + "windows", ] [[package]] @@ -5105,7 +5105,7 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows 0.61.3", + "windows", "wry", ] @@ -6131,10 +6131,10 @@ checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.61.3", - "windows-core 0.61.2", - "windows-implement 0.60.2", - "windows-interface 0.59.3", + "windows", + "windows-core", + "windows-implement", + "windows-interface", ] [[package]] @@ -6155,8 +6155,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" dependencies = [ "thiserror 2.0.18", - "windows 0.61.3", - "windows-core 0.61.2", + "windows", + "windows-core", ] [[package]] @@ -6214,16 +6214,6 @@ dependencies = [ "windows-version", ] -[[package]] -name = "windows" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" -dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.61.3" @@ -6231,7 +6221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ "windows-collections", - "windows-core 0.61.2", + "windows-core", "windows-future", "windows-link 0.1.3", "windows-numerics", @@ -6243,20 +6233,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" -dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", + "windows-core", ] [[package]] @@ -6265,11 +6242,11 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", + "windows-implement", + "windows-interface", "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", + "windows-result", + "windows-strings", ] [[package]] @@ -6278,22 +6255,11 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link 0.1.3", "windows-threading", ] -[[package]] -name = "windows-implement" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "windows-implement" version = "0.60.2" @@ -6305,17 +6271,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "windows-interface" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "windows-interface" version = "0.59.3" @@ -6345,19 +6300,10 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link 0.1.3", ] -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.3.4" @@ -6367,16 +6313,6 @@ dependencies = [ "windows-link 0.1.3", ] -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-strings" version = "0.4.2" @@ -6829,8 +6765,8 @@ dependencies = [ "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.61.3", - "windows-core 0.61.2", + "windows", + "windows-core", "windows-version", "x11-dl", ] diff --git a/apps/desktop-tauri/src-tauri/Cargo.toml b/apps/desktop-tauri/src-tauri/Cargo.toml index a360d196..7dd29984 100644 --- a/apps/desktop-tauri/src-tauri/Cargo.toml +++ b/apps/desktop-tauri/src-tauri/Cargo.toml @@ -21,7 +21,7 @@ tracing = "0.1" uuid = { version = "1", features = ["v4"] } [target.'cfg(windows)'.dependencies] -windows = { version = "0.58", features = [ +windows = { version = "0.61", features = [ "Win32_Foundation", "Win32_System_Com", "Win32_System_Threading", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 09a99d34..ccb713d3 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -92,7 +92,7 @@ libc = "0.2" # Windows-only [target.'cfg(windows)'.dependencies] -windows = { version = "0.58", features = [ +windows = { version = "0.61", features = [ "Win32_Foundation", "Win32_Graphics_Gdi", "Win32_Security", From 9328c876f8c8799b600977abc6bc7612e14c1cb7 Mon Sep 17 00:00:00 2001 From: Tyler South Date: Tue, 15 Sep 2026 17:40:09 -0400 Subject: [PATCH 2/2] Fix Windows API usage for windows crate 0.61 --- apps/desktop-tauri/src-tauri/Cargo.toml | 2 + .../src-tauri/src/floatbar/taskbar.rs | 2 +- rust/Cargo.toml | 2 + rust/src/agent_sessions/focus.rs | 3 +- rust/src/browser/cookies.rs | 2 +- rust/src/notifications.rs | 4 +- .../claude/oauth/credentials_store.rs | 4 +- rust/src/providers/copilot/api.rs | 2 +- rust/src/secure_file.rs | 45 ++++++++----------- rust/src/updater/signature.rs | 4 +- rust/src/windows_security.rs | 21 ++++++--- 11 files changed, 47 insertions(+), 44 deletions(-) diff --git a/apps/desktop-tauri/src-tauri/Cargo.toml b/apps/desktop-tauri/src-tauri/Cargo.toml index 7dd29984..34be8cb3 100644 --- a/apps/desktop-tauri/src-tauri/Cargo.toml +++ b/apps/desktop-tauri/src-tauri/Cargo.toml @@ -24,7 +24,9 @@ uuid = { version = "1", features = ["v4"] } windows = { version = "0.61", features = [ "Win32_Foundation", "Win32_System_Com", + "Win32_System_Ole", "Win32_System_Threading", + "Win32_System_Variant", "Win32_UI_Accessibility", "Win32_UI_WindowsAndMessaging", ] } diff --git a/apps/desktop-tauri/src-tauri/src/floatbar/taskbar.rs b/apps/desktop-tauri/src-tauri/src/floatbar/taskbar.rs index 3ad21440..1201d72e 100644 --- a/apps/desktop-tauri/src-tauri/src/floatbar/taskbar.rs +++ b/apps/desktop-tauri/src-tauri/src/floatbar/taskbar.rs @@ -259,11 +259,11 @@ unsafe fn uia_buttons(hwnd: isize) -> Vec { CLSCTX_INPROC_SERVER, COINIT_MULTITHREADED, CoCreateInstance, CoInitializeEx, CoUninitialize, }; + use windows::Win32::System::Variant::VARIANT; use windows::Win32::UI::Accessibility::{ CUIAutomation8, IUIAutomation, TreeScope_Descendants, UIA_ButtonControlTypeId, UIA_ControlTypePropertyId, }; - use windows::core::VARIANT; unsafe { // Taskbar discovery may run on a short-lived worker thread. Initialize diff --git a/rust/Cargo.toml b/rust/Cargo.toml index ccb713d3..820f6834 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -104,11 +104,13 @@ windows = { version = "0.61", features = [ "Win32_Security_WinTrust", "Win32_Storage_FileSystem", "Win32_System_Com", + "Win32_System_Com_StructuredStorage", "Win32_System_Console", "Win32_System_Memory", "Win32_System_Registry", "Win32_System_SystemServices", "Win32_System_Threading", + "Win32_System_Variant", "Win32_UI_Shell", "Win32_UI_Shell_PropertiesSystem", "Win32_UI_WindowsAndMessaging", diff --git a/rust/src/agent_sessions/focus.rs b/rust/src/agent_sessions/focus.rs index 0b4d9372..d8ee69f6 100644 --- a/rust/src/agent_sessions/focus.rs +++ b/rust/src/agent_sessions/focus.rs @@ -36,11 +36,12 @@ fn is_local_host(host: &str) -> bool { #[cfg(windows)] fn focus_process(pid: u32) -> SessionFocusResult { - use windows::Win32::Foundation::{BOOL, HWND, LPARAM}; + use windows::Win32::Foundation::{HWND, LPARAM}; use windows::Win32::UI::WindowsAndMessaging::{ EnumWindows, GetWindowThreadProcessId, IsWindowVisible, SW_RESTORE, SetForegroundWindow, ShowWindow, }; + use windows::core::BOOL; struct Search { pid: u32, diff --git a/rust/src/browser/cookies.rs b/rust/src/browser/cookies.rs index 488b9d8c..a269bc88 100755 --- a/rust/src/browser/cookies.rs +++ b/rust/src/browser/cookies.rs @@ -432,7 +432,7 @@ impl CookieExtractor { .to_vec(); // Free the DPAPI-allocated buffer to prevent memory leaks - let _ = LocalFree(HLOCAL(output_blob.pbData as *mut _)); + let _ = LocalFree(Some(HLOCAL(output_blob.pbData as *mut _))); Ok(decrypted) } diff --git a/rust/src/notifications.rs b/rust/src/notifications.rs index 44517cc4..7cf83372 100755 --- a/rust/src/notifications.rs +++ b/rust/src/notifications.rs @@ -1459,8 +1459,8 @@ const LEGACY_CEILING_AUMID: &str = "Ceiling"; /// `Win32_Storage_EnhancedStorage` to avoid enabling that feature for one /// constant; the value is fixed by the shell and documented by Microsoft. #[cfg(target_os = "windows")] -const PKEY_APP_USER_MODEL_ID: windows::Win32::UI::Shell::PropertiesSystem::PROPERTYKEY = - windows::Win32::UI::Shell::PropertiesSystem::PROPERTYKEY { +const PKEY_APP_USER_MODEL_ID: windows::Win32::Foundation::PROPERTYKEY = + windows::Win32::Foundation::PROPERTYKEY { fmtid: windows::core::GUID::from_u128(0x9F4C2855_9F79_4B39_A8D0_E1D42DE1D5F3), pid: 5, }; diff --git a/rust/src/providers/claude/oauth/credentials_store.rs b/rust/src/providers/claude/oauth/credentials_store.rs index 8136c4c9..d5c7677c 100644 --- a/rust/src/providers/claude/oauth/credentials_store.rs +++ b/rust/src/providers/claude/oauth/credentials_store.rs @@ -960,7 +960,7 @@ mod tests { let _ = GetFileSecurityW( PCWSTR(wide.as_ptr()), DACL_SECURITY_INFORMATION.0, - PSECURITY_DESCRIPTOR(std::ptr::null_mut()), + None, 0, &mut needed, ); @@ -975,7 +975,7 @@ mod tests { GetFileSecurityW( PCWSTR(wide.as_ptr()), DACL_SECURITY_INFORMATION.0, - descriptor, + Some(descriptor), needed, &mut needed, ) diff --git a/rust/src/providers/copilot/api.rs b/rust/src/providers/copilot/api.rs index 6098865e..83098401 100755 --- a/rust/src/providers/copilot/api.rs +++ b/rust/src/providers/copilot/api.rs @@ -189,7 +189,7 @@ impl CopilotApi { CredReadW( PCWSTR(target_wide.as_ptr()), CRED_TYPE_GENERIC, - 0, + None, &mut credential, ) }; diff --git a/rust/src/secure_file.rs b/rust/src/secure_file.rs index e52c034b..a3a8238d 100644 --- a/rust/src/secure_file.rs +++ b/rust/src/secure_file.rs @@ -879,13 +879,7 @@ fn capture_file_security(path: &Path) -> io::Result { OWNER_SECURITY_INFORMATION.0 | GROUP_SECURITY_INFORMATION.0 | DACL_SECURITY_INFORMATION.0; let mut needed = 0u32; unsafe { - let _ = GetFileSecurityW( - PCWSTR(wide.as_ptr()), - requested, - PSECURITY_DESCRIPTOR(std::ptr::null_mut()), - 0, - &mut needed, - ); + let _ = GetFileSecurityW(PCWSTR(wide.as_ptr()), requested, None, 0, &mut needed); } if needed == 0 { return Err(io::Error::other( @@ -899,7 +893,7 @@ fn capture_file_security(path: &Path) -> io::Result { GetFileSecurityW( PCWSTR(wide.as_ptr()), requested, - PSECURITY_DESCRIPTOR(descriptor.as_mut_ptr().cast()), + Some(PSECURITY_DESCRIPTOR(descriptor.as_mut_ptr().cast())), needed, &mut needed, ) @@ -953,10 +947,9 @@ fn dacl_security_info( fn apply_captured_dacl(path: &Path, captured: &CapturedFileSecurity) -> io::Result<()> { use std::os::windows::ffi::OsStrExt; - use windows::Win32::Foundation::BOOL; use windows::Win32::Security::Authorization::{SE_FILE_OBJECT, SetNamedSecurityInfoW}; - use windows::Win32::Security::{ACL, GetSecurityDescriptorDacl, PSID}; - use windows::core::PCWSTR; + use windows::Win32::Security::{ACL, GetSecurityDescriptorDacl}; + use windows::core::{BOOL, PCWSTR}; let wide: Vec = path.as_os_str().encode_wide().chain(Some(0)).collect(); let descriptor = captured_descriptor(captured); @@ -974,8 +967,8 @@ fn apply_captured_dacl(path: &Path, captured: &CapturedFileSecurity) -> io::Resu PCWSTR(wide.as_ptr()), SE_FILE_OBJECT, dacl_security_info(captured), - PSID::default(), - PSID::default(), + None, + None, (!dacl.is_null()).then_some(dacl.cast_const()), None, ); @@ -993,12 +986,11 @@ fn apply_captured_owner(path: &Path, captured: &CapturedFileSecurity) -> io::Res use std::mem::ManuallyDrop; use std::os::windows::ffi::OsStrExt; - use windows::Win32::Foundation::BOOL; use windows::Win32::Security::Authorization::{SE_FILE_OBJECT, SetNamedSecurityInfoW}; use windows::Win32::Security::{ GetSecurityDescriptorOwner, OBJECT_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION, PSID, }; - use windows::core::PCWSTR; + use windows::core::{BOOL, PCWSTR}; let wide: Vec = path.as_os_str().encode_wide().chain(Some(0)).collect(); let descriptor = captured_descriptor(captured); @@ -1015,8 +1007,8 @@ fn apply_captured_owner(path: &Path, captured: &CapturedFileSecurity) -> io::Res PCWSTR(wide.as_ptr()), SE_FILE_OBJECT, OBJECT_SECURITY_INFORMATION(OWNER_SECURITY_INFORMATION.0), - *owner, - PSID::default(), + Some(*owner), + None, None, None, ); @@ -1279,7 +1271,7 @@ fn protect_with_flags(plain: &[u8], flags: u32) -> io::Result> { let encrypted = std::slice::from_raw_parts(output_blob.pbData, output_blob.cbData as usize).to_vec(); - let _ = LocalFree(HLOCAL(output_blob.pbData as *mut _)); + let _ = LocalFree(Some(HLOCAL(output_blob.pbData as *mut _))); Ok(encrypted) } } @@ -1318,7 +1310,7 @@ fn unprotect(encrypted: &[u8]) -> io::Result> { let plain = std::slice::from_raw_parts(output_blob.pbData, output_blob.cbData as usize).to_vec(); - let _ = LocalFree(HLOCAL(output_blob.pbData as *mut _)); + let _ = LocalFree(Some(HLOCAL(output_blob.pbData as *mut _))); Ok(plain) } } @@ -1533,7 +1525,6 @@ mod tests { use std::mem::size_of; use std::os::windows::ffi::OsStrExt; - use windows::Win32::Foundation::BOOL; use windows::Win32::Security::{ ACCESS_ALLOWED_ACE, ACL, ACL_SIZE_INFORMATION, AclSizeInformation, DACL_SECURITY_INFORMATION, EqualSid, GetAce, GetAclInformation, GetFileSecurityW, @@ -1542,7 +1533,7 @@ mod tests { }; use windows::Win32::Storage::FileSystem::FILE_ALL_ACCESS; use windows::Win32::System::SystemServices::ACCESS_ALLOWED_ACE_TYPE; - use windows::core::PCWSTR; + use windows::core::{BOOL, PCWSTR}; let (_token_buffer, user_sid) = current_user_sid(); let wide_path: Vec = path @@ -1555,7 +1546,7 @@ mod tests { let _ = GetFileSecurityW( PCWSTR(wide_path.as_ptr()), DACL_SECURITY_INFORMATION.0, - PSECURITY_DESCRIPTOR(std::ptr::null_mut()), + None, 0, &mut descriptor_bytes, ); @@ -1569,7 +1560,7 @@ mod tests { GetFileSecurityW( PCWSTR(wide_path.as_ptr()), DACL_SECURITY_INFORMATION.0, - descriptor, + Some(descriptor), descriptor_bytes, &mut descriptor_bytes, ) @@ -1704,7 +1695,7 @@ mod tests { use std::mem::size_of; use std::os::windows::ffi::OsStrExt; - use windows::Win32::Foundation::{BOOL, CloseHandle, HANDLE}; + use windows::Win32::Foundation::{CloseHandle, HANDLE}; use windows::Win32::Security::{ ACCESS_ALLOWED_ACE, ACL, ACL_SIZE_INFORMATION, AclSizeInformation, DACL_SECURITY_INFORMATION, EqualSid, GetAce, GetAclInformation, GetFileSecurityW, @@ -1714,7 +1705,7 @@ mod tests { use windows::Win32::Storage::FileSystem::FILE_ALL_ACCESS; use windows::Win32::System::SystemServices::ACCESS_ALLOWED_ACE_TYPE; use windows::Win32::System::Threading::{GetCurrentProcess, OpenProcessToken}; - use windows::core::PCWSTR; + use windows::core::{BOOL, PCWSTR}; let dir = tempfile::tempdir().unwrap(); let path = dir.path().join("secure.json"); @@ -1734,7 +1725,7 @@ mod tests { let _ = GetFileSecurityW( PCWSTR(wide_path.as_ptr()), DACL_SECURITY_INFORMATION.0, - PSECURITY_DESCRIPTOR(std::ptr::null_mut()), + None, 0, &mut descriptor_bytes, ); @@ -1749,7 +1740,7 @@ mod tests { GetFileSecurityW( PCWSTR(wide_path.as_ptr()), DACL_SECURITY_INFORMATION.0, - descriptor, + Some(descriptor), descriptor_bytes, &mut descriptor_bytes, ) diff --git a/rust/src/updater/signature.rs b/rust/src/updater/signature.rs index 1decbef1..cc1f89d3 100644 --- a/rust/src/updater/signature.rs +++ b/rust/src/updater/signature.rs @@ -12,7 +12,7 @@ use sha2::{Digest, Sha256}; use std::ffi::c_void; use std::os::windows::ffi::OsStrExt; use std::path::Path; -use windows::Win32::Foundation::{BOOL, HWND, TRUST_E_NOSIGNATURE}; +use windows::Win32::Foundation::{HWND, TRUST_E_NOSIGNATURE}; use windows::Win32::Security::WinTrust::{ WINTRUST_ACTION_GENERIC_VERIFY_V2, WINTRUST_DATA, WINTRUST_DATA_0, WINTRUST_FILE_INFO, WTD_CACHE_ONLY_URL_RETRIEVAL, WTD_CHOICE_FILE, WTD_REVOKE_WHOLECHAIN, WTD_STATEACTION_CLOSE, @@ -130,7 +130,7 @@ fn publisher_subject_fingerprint(trust_data: &WINTRUST_DATA) -> Result io::Error { io::Error::other(format!("{context}: {error:?}")) @@ -176,7 +176,7 @@ pub fn path_dacl_is_readable_by_others(path: &Path) -> io::Result { let _ = GetFileSecurityW( PCWSTR(wide_path.as_ptr()), DACL_SECURITY_INFORMATION.0, - PSECURITY_DESCRIPTOR(std::ptr::null_mut()), + None, 0, &mut descriptor_bytes, ); @@ -192,7 +192,7 @@ pub fn path_dacl_is_readable_by_others(path: &Path) -> io::Result { GetFileSecurityW( PCWSTR(wide_path.as_ptr()), DACL_SECURITY_INFORMATION.0, - descriptor, + Some(descriptor), descriptor_bytes, &mut descriptor_bytes, ) @@ -308,13 +308,20 @@ impl OwnedWellKnownSid { fn well_known_sid(kind: WELL_KNOWN_SID_TYPE) -> io::Result { let mut sid_bytes = 0u32; - let _ = unsafe { CreateWellKnownSid(kind, None, PSID(std::ptr::null_mut()), &mut sid_bytes) }; + let _ = unsafe { CreateWellKnownSid(kind, None, None, &mut sid_bytes) }; if sid_bytes == 0 { return Err(io::Error::other("CreateWellKnownSid returned an empty SID")); } let mut buffer = vec![0u8; sid_bytes as usize]; - unsafe { CreateWellKnownSid(kind, None, PSID(buffer.as_mut_ptr().cast()), &mut sid_bytes) } - .map_err(|error| windows_error("CreateWellKnownSid failed", error))?; + unsafe { + CreateWellKnownSid( + kind, + None, + Some(PSID(buffer.as_mut_ptr().cast())), + &mut sid_bytes, + ) + } + .map_err(|error| windows_error("CreateWellKnownSid failed", error))?; Ok(OwnedWellKnownSid { buffer }) }