Fix crash during drag-and-drop on Windows (#42227)

The HGLOBAL is itself the HDROP. Do not dereference it.

Release Notes:

- windows: Fixed crashes during drag-and-drop operations
This commit is contained in:
John Tur
2025-11-07 19:18:47 +00:00
committed by GitHub
parent 8a903f9c10
commit a66dac7b3a
+2 -2
View File
@@ -901,9 +901,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);
}