boostorg / stacktrace

C++ library for storing and printing backtraces.
https://boost.org/libs/stacktrace
422 stars 70 forks source link

[Windows] Remove `::CoInitializeEx(0, COINIT_MULTITHREADED);` #121

Closed AlexGuteniev closed 2 years ago

AlexGuteniev commented 2 years ago

https://github.com/boostorg/stacktrace/blob/75b7986f9799184ecd679d86273532cb54e6a0dc/include/boost/stacktrace/detail/frame_msvc.ipp#L60

CoInitializeEx is superfluous for DbgEng.h interfaces. These interfaces are COM-like, not completely COM compliant interfaces, and they don't use COM apartments.

It is now official - see https://github.com/MicrosoftDocs/windows-driver-docs-ddi/pull/1256#issuecomment-1031922715

The potential harm of ::CoInitializeEx(0, COINIT_MULTITHREADED); is that:

AlexGuteniev commented 2 years ago

In the context of #24, probably the COM initializer class shouldn't be totally removed, as DIA SDK is real COM and needs this stuff. Just don't use that for DbgEng

apolukhin commented 2 years ago

In the context of https://github.com/boostorg/stacktrace/issues/24, probably the COM initializer class shouldn't be totally removed, as DIA SDK is real COM and needs this stuff. Just don't use that for DbgEng

I'm not planning to support DIA any time soon, especially due to the it's COM usage.