Re: COM initialization in TortoiseProc
Ivan Zhakov <[email protected]>
| Newsgroups | gmane.comp.version-control.subversion.tortoisesvn.devel |
|---|---|
| Message-ID | <CABw-3YfQszTdEVFoTV136vziOu3LbsRvLSO9Bg7UPw+GDvjqFQ@mail.gmail.com> |
On 7 January 2016 at 12:12, Ivan Zhakov <[email protected]> wrote: > 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? > My bad: I added breakpoint to CoInitalize(), but I forgot about CoInitializeEx(). COM is initialized at TortoiseProc startup in CTortoiseProcApp::InitInistance(). So I've moved CSysImageList initizilization here (and cleanup to ExitInstance) in r27133. -- Ivan Zhakov ------------------------------------------------------ http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=3154165 To unsubscribe from this discussion, e-mail: [[email protected]].