Skip to content

make compile with mingw-w64#131

Merged
lfreist merged 1 commit intolfreist:mainfrom
oltolm:mingw-w64-upstream
Nov 14, 2025
Merged

make compile with mingw-w64#131
lfreist merged 1 commit intolfreist:mainfrom
oltolm:mingw-w64-upstream

Conversation

@oltolm
Copy link
Contributor

@oltolm oltolm commented Oct 31, 2025

The code was not compiling with mingw-w64 because it does not support _bstr_t.

@lfreist lfreist merged commit 2577d97 into lfreist:main Nov 14, 2025
6 checks passed
@oltolm oltolm deleted the mingw-w64-upstream branch November 14, 2025 18:42
res &= CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
res &= CoCreateInstance(CLSID_WbemLocator, nullptr, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID*)&locator);
if (locator) {
res &= locator->ConnectServer(_bstr_t("ROOT\\CIMV2"), nullptr, nullptr, nullptr, 0, nullptr, nullptr, &service);
Copy link
Contributor Author

@oltolm oltolm Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that was wrong and mingw-w64 actually does support _bstr_t. This change was unnecessary.

I mean the change from _bstr_t to bstr_t. The change from "ROOT\\CIMV2" to L"ROOT\\CIMV2" was necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants