Windows: COM initialization fixes#13393
Conversation
519fef8 to
0e47495
Compare
0e47495 to
9b78a89
Compare
JordanTheToaster
left a comment
There was a problem hiding this comment.
Cubeb and eye toy still functions correctly on Windows.
TheLastRar
left a comment
There was a problem hiding this comment.
Is the global namespace :: needed for CoInitializeEx?
As for cubeb, you are allowing STA (despite the pr description), what made you drop the MTA changes?
No, just a habit.
|
I would personally omit it if it was unneeded, which would align with other uses of Windows API functions.
Given Cubeb's recommendation, can a comment be added with the above. Also, the usb mic can share the cubed instance between the UI and CPU thread, Is this okay given the different apartment types between the two? |
I'll change it.
As far as I can tell, UI could share the instance from the CPU thread (one that was initialized in MTA), but not vice versa, so it should be fine. Even though it may not look like this, the behaviour of USB mic is effectively unchanged to what we're doing now, and no one ever complained about enumerations failing. |
9b78a89 to
8532bd5
Compare
If the EyeToy camera was enabled in the settings, but not enabled by the game, it would call CoUninitialize without having called CoInitializeEx first.
8532bd5 to
1674d14
Compare
TheLastRar
left a comment
There was a problem hiding this comment.
Changes look good, but haven't personally tested
kamfretoz
left a comment
There was a problem hiding this comment.
Audio device selection and others still works.
Description of Changes
Cleans up COM initialization for the sake of Cubeb and EyeToy. The following changes were made:
CoUninitializeon edit without a correspondingCoInitializeExcall beforehand, breaking the COM state.Replaces #13364.
Rationale behind Changes
Code correctness.
Suggested Testing Steps
Did you use AI to help find, test, or implement this issue or feature?
No.