stacktrace icon indicating copy to clipboard operation
stacktrace copied to clipboard

Don't initialize COM

Open AlexGuteniev opened this issue 3 years ago • 1 comments

Resolve #121

See the documentation:

You don't need to call CoInitialize, CoInitializeEx, or OleInitialize to use this function and interfaces obtained by it.

Even if DIA support is implemented, there's a way to avoid CoInitializeEx for DIA too.

AlexGuteniev avatar Feb 18 '22 17:02 AlexGuteniev

BTW if DbgEng interfaces were COM apartment aware, this comment is wrong:

        // COINIT_MULTITHREADED means that we must serialize access to the objects manually.
        // This is the fastest way to work.

COINIT_MULTITHREADED does not always mean better perf (in particular it is worse when the underlying server is apartment-threaded), and does not ever mean that the synchronization to call COM methods is necessary (it rather means that the synchronization often is needed inside COM methods, as they are called from arbitrary threads).

AlexGuteniev avatar Feb 21 '22 08:02 AlexGuteniev

Many many thanks for the great news and the PR!

apolukhin avatar Sep 01 '22 14:09 apolukhin