[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

COM initialization in TortoiseProc

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Thu, 7 Jan 2016 12:12:57 +0300

I'm currently looking to drdump problem 178870 [1]. Crash happens in
internals of SHGetFileInfoW which called from CTortoiseProcApp
constructor:
[[[
ole32!OXIDEntry::InitRundown+0xd
ole32!CComApartment::InitRemoting+0x1d3
ole32!CComApartment::StartServer+0x13
[...]
ole32!CoCreateInstanceEx+0x38
ole32!CoCreateInstance+0x37
[...]
shell32!SHGetFileInfoW+0x18f
tortoiseproc!CSysImageList::CSysImageList+0xb7
tortoiseproc!CTortoiseProcApp::CTortoiseProcApp+0x9a
]]]

Looking to the code I noticed that SHGetFileInfoW called without prior
COM initialization while it's explicitly required by MSDN [2]:
[[[
You must initialize Component Object Model (COM) with CoInitialize or
OleInitialize prior to calling SHGetFileInfo.
]]]

So I suspect that this is the reason of this crash.

I wanted to add COM initialization to CTortoiseProcApp constructor,
but I noticed that TortoiseSVN code uses pattern to initialize COM
only when needed instead of application start. Is it intentional? Are
any known problems to initialize COM on TortoiseProc startup?

[1] https://drdump.com/Problem.aspx?ProblemID=178870
[2] https://msdn.microsoft.com/en-us/library/windows/desktop/bb762179

-- 
Ivan Zhakov
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3154044
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2016-01-07 10:37:48 CET

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.