-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows: bump windows-sys to 0.52 #3639
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,7 +187,7 @@ impl FileDropHandler { | |
let get_data_fn = unsafe { (*(*data_obj).cast::<IDataObjectVtbl>()).GetData }; | ||
let get_data_result = unsafe { get_data_fn(data_obj as *mut _, &drop_format, &mut medium) }; | ||
if get_data_result >= 0 { | ||
let hdrop = unsafe { medium.Anonymous.hGlobal }; | ||
let hdrop = unsafe { medium.u.hGlobal as HDROP }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could someone verify that it's a correct change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the docs, I think Additionally, |
||
|
||
// The second parameter (0xFFFFFFFF) instructs the function to return the item count | ||
let item_count = unsafe { DragQueryFileW(hdrop, 0xFFFFFFFF, ptr::null_mut(), 0) }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should ask for upstream clarification about these. At least in the
windows
crate where these are newtyped, the underlying ABI is "kept in sync" (IIRC by casting in the wrapper implementation).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that casting small u32 to positive i32 have the same binary repr, it's safe to do it here.
In general, a lot of casts seems to be that way because sometimes they accept
enum
butenum
itself isi32
and notu32
, and so on.You can still ask though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not saying that it's unsafe, just that it's inconvenient after these Windows crates already have all the type information they need; looks like it's all reserved for the high-level
windows
crate though.