fix(windows): cast COINIT_APARTMENTTHREADED to u32 for windows-sys 0.61.2

windows-sys 0.61.2 changed CoInitializeEx's dwcoinit parameter type
from i32 to u32, causing a mismatched types compile error on Windows.

https://claude.ai/code/session_01F7yMUY48VuGNUF1Q3ma2cZ
This commit is contained in:
Claude committed 2026-06-12 11:47:52 +00:00
1 parent e07aae60f0
commit d0870745f2
1 file changed
+1 -1
+1 -1
View File
@@ -143,7 +143,7 @@ mod windows_impl {
pub(super) fn set_default() -> Result<String, String> {
unsafe {
let co = CoInitializeEx(std::ptr::null(), COINIT_APARTMENTTHREADED);
let co = CoInitializeEx(std::ptr::null(), COINIT_APARTMENTTHREADED as u32);
// S_OK (0) / S_FALSE (1) mean we initialised COM and must balance it
// with CoUninitialize. Any other value: another init already owns the
// thread's apartment, so we leave it alone.