From 1ce59749178ef237c865de563ce35d2d7ef6a478 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Sun, 9 Nov 2025 11:29:39 +0000 Subject: [PATCH] Fix crash during drag-and-drop on Windows (#42227) (cherry-pick to preview) (#42301) Cherry-pick of #42227 to preview ---- The HGLOBAL is itself the HDROP. Do not dereference it. Release Notes: - windows: Fixed crashes during drag-and-drop operations Co-authored-by: John Tur --- crates/gpui/src/platform/windows/window.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/platform/windows/window.rs b/crates/gpui/src/platform/windows/window.rs index ea1027f826ae91516d00993115673d2e3f61879b..cbf9cc77cf416f7ed8971548f62b72176ff00765 100644 --- a/crates/gpui/src/platform/windows/window.rs +++ b/crates/gpui/src/platform/windows/window.rs @@ -900,9 +900,9 @@ impl IDropTarget_Impl for WindowsDragDropHandler_Impl { if idata.u.hGlobal.is_invalid() { return Ok(()); } - let hdrop = idata.u.hGlobal.0 as *mut HDROP; + let hdrop = HDROP(idata.u.hGlobal.0); let mut paths = SmallVec::<[PathBuf; 2]>::new(); - with_file_names(*hdrop, |file_name| { + with_file_names(hdrop, |file_name| { if let Some(path) = PathBuf::from_str(&file_name).log_err() { paths.push(path); }