Skip to content
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: 0.20 crashes if CoInitializeEx has been called with MULTITHREADED #1255

Closed
hrydgard opened this issue Nov 1, 2019 · 5 comments
Closed
Assignees
Labels
B - bug Dang, that shouldn't have happened C - in progress Implementation is proceeding smoothly DS - windows

Comments

@hrydgard
Copy link

hrydgard commented Nov 1, 2019

The drag/drop support for Windows use OLE drag drop, which requires that COM has been initialized with a single-threaded apartment model. OleInitialize is called and we panic if that fails.

So if someone has called CoInitialize(MULTITHREADED), which for example is currently required (for unclear reasons) when trying to use cpal, winit just dies.

winit should handle the failure of OleInitialize better and just discard drag/drop support (or fall back to WM_DROPFILES, it's unclear to me why OLE drag/drop is used at all).

hrydgard added a commit to EmbarkStudios/winit that referenced this issue Nov 5, 2019
hrydgard added a commit to EmbarkStudios/winit that referenced this issue Nov 5, 2019
hrydgard added a commit to EmbarkStudios/winit that referenced this issue Nov 5, 2019
@goddessfreya goddessfreya added DS - windows C - in progress Implementation is proceeding smoothly B - bug Dang, that shouldn't have happened labels Nov 6, 2019
@goddessfreya
Copy link
Contributor

Assigning you, since you seam to have already made the fix. 🎉

@hrydgard
Copy link
Author

hrydgard commented Nov 7, 2019

Fair enough @goddessfreya ! Let me know if there's anything more I need to do on that PR (where to add documentation maybe), or merge it I guess.

@goddessfreya
Copy link
Contributor

cc @Osspial

@chemicstry
Copy link
Contributor

Any updates on this? Can EmbarkStudios@7074d6a be merged?

chemicstry pushed a commit to amethyst/winit that referenced this issue Mar 23, 2020
chemicstry added a commit to amethyst/winit that referenced this issue Apr 6, 2020
Osspial added a commit that referenced this issue Jun 28, 2020
@Osspial
Copy link
Contributor

Osspial commented Jul 2, 2020

Closing in light of #1524.

@Osspial Osspial closed this as completed Jul 2, 2020
emilk pushed a commit to emilk/egui that referenced this issue Mar 7, 2022
* Remove warning about cpal drag and drop

Given that the issue rust-windowing/winit#1255 was closed by rust-windowing/winit#1524, it would make sense to remove the warning about the issue from NativeOptions

* Change `NativeOptions::drag_and_drop_support` default to true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened C - in progress Implementation is proceeding smoothly DS - windows
Development

No branches or pull requests

4 participants