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

Problems with Qt GUI app on Windows11 and hwinfo #97

Open
xohm opened this issue Jul 12, 2024 · 2 comments
Open

Problems with Qt GUI app on Windows11 and hwinfo #97

xohm opened this issue Jul 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working windows Issues related to windows

Comments

@xohm
Copy link

xohm commented Jul 12, 2024

I run into problems when using hwinfo and my GUI app which uses Qt6/Windows11.
QFileDialog::getOpenFileName and other functions did not work correctly (native was not working) after a call to the hwinfo lib.
I found that the CoInitializeEx in the wmi_wrapper caused the problem, after changing from COINIT_MULTITHREADED to COINIT_APARTMENTTHREADED all seamed to work well:

hwinfo/src/windows/utils/wmi_wrapper.cpp, line 16

_WMI::_WMI() {
auto res = CoInitializeSecurity(nullptr, -1, nullptr, nullptr, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE,
nullptr, EOAC_NONE, nullptr);
// res &= CoInitializeEx(nullptr, COINIT_MULTITHREADED); // $fixme: this is causing a crash
res &= CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);

@lfreist
Copy link
Owner

lfreist commented Jul 13, 2024

Thank you for the report. I'll evaluate it and provide a fix as soon as possible.

@lfreist lfreist added bug Something isn't working windows Issues related to windows labels Jul 13, 2024
@lfreist lfreist self-assigned this Jul 13, 2024
@lfreist
Copy link
Owner

lfreist commented Aug 3, 2024

Should be fixed in 82161e7.

Can you confirm @xohm ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Issues related to windows
Projects
None yet
Development

No branches or pull requests

2 participants