Skip to content

Commit

Permalink
Update windows-rs to 0.59 (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex authored Jan 3, 2025
1 parent 6ab069c commit a846f86
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 84 deletions.
90 changes: 12 additions & 78 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ core-foundation = "0.10.0"
core-foundation-sys = "0.8.7"

[target.'cfg(target_os = "windows")'.dependencies]
windows-sys = { version = "0.48", features = [
windows-sys = { version = "0.59", features = [
"Win32_Foundation",
"Win32_System_Com",
"Win32_UI_Shell_Common",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/win_cid/file_dialog/dialog_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl DialogInner {
#[inline]
unsafe fn show(&self, parent: Option<HWND>) -> Result<()> {
let (d, v) = self.fd();
wrap_err((v.base.Show)(d, parent.unwrap_or_default()))
wrap_err((v.base.Show)(d, parent.unwrap_or(std::ptr::null_mut())))
}

#[inline]
Expand Down
6 changes: 3 additions & 3 deletions src/backend/win_cid/message_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl WinMessageDialog {

let task_dialog_config = TASKDIALOGCONFIG {
cbSize: core::mem::size_of::<TASKDIALOGCONFIG>() as u32,
hwndParent: self.parent.unwrap_or_default(),
hwndParent: self.parent.unwrap_or(std::ptr::null_mut()),
dwFlags: TDF_ALLOW_DIALOG_CANCELLATION | TDF_SIZE_TO_CONTENT,
pszWindowTitle: self.caption.as_ptr(),
pszContent: self.text.as_ptr(),
Expand All @@ -150,7 +150,7 @@ impl WinMessageDialog {
pRadioButtons: std::ptr::null(),
cRadioButtons: 0,
cxWidth: 0,
hInstance: 0,
hInstance: std::ptr::null_mut(),
pfCallback: None,
lpCallbackData: 0,
nDefaultButton: 0,
Expand Down Expand Up @@ -206,7 +206,7 @@ impl WinMessageDialog {
pub fn run(self) -> MessageDialogResult {
let ret = unsafe {
MessageBoxW(
self.parent.unwrap_or_default(),
self.parent.unwrap_or(std::ptr::null_mut()),
self.text.as_ptr(),
self.caption.as_ptr(),
self.flags,
Expand Down
2 changes: 1 addition & 1 deletion src/backend/win_cid/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn init_com<T, F: FnOnce() -> T>(f: F) -> Result<T, HRESULT> {
let res = unsafe {
CoInitializeEx(
std::ptr::null(),
COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE,
(COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE) as u32,
)
};

Expand Down

0 comments on commit a846f86

Please sign in to comment.