• R/O
  • SSH
  • HTTPS

tortoisesvn: コミット


コミットメタ情報

リビジョン28250 (tree)
日時2018-06-14 02:33:37
作者stefankueng

ログメッセージ

Don't set an exception filter for the shell extension.
See "The unhandled exception filter is the responsibility of the process": https://blogs.msdn.microsoft.com/oldnewthing/20180606-00/?p=98925

変更サマリ

差分

--- trunk/src/TortoiseShell/SVNPropertyPage.cpp (revision 28249)
+++ trunk/src/TortoiseShell/SVNPropertyPage.cpp (revision 28250)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2014, 2016 - TortoiseSVN
3+// Copyright (C) 2003-2014, 2016, 2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -33,20 +33,8 @@
3333 UINT CALLBACK PropPageCallbackProc ( HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp );
3434
3535 // CShellExt member functions (needed for IShellPropSheetExt)
36-STDMETHODIMP CShellExt::AddPages (LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
36+STDMETHODIMP CShellExt::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
3737 {
38- __try
39- {
40- return AddPages_Wrap(lpfnAddPage, lParam);
41- }
42- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
43- {
44- }
45- return E_FAIL;
46-}
47-
48-STDMETHODIMP CShellExt::AddPages_Wrap (LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
49-{
5038 for (std::vector<tstring>::iterator I = files_.begin(); I != files_.end(); ++I)
5139 {
5240 SVNStatus svn;
--- trunk/src/TortoiseShell/ContextMenu.cpp (revision 28249)
+++ trunk/src/TortoiseShell/ContextMenu.cpp (revision 28250)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2017 - TortoiseSVN
3+// Copyright (C) 2003-2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -221,23 +221,9 @@
221221 };
222222
223223 STDMETHODIMP CShellExt::Initialize(PCIDLIST_ABSOLUTE pIDFolder,
224- LPDATAOBJECT pDataObj,
225- HKEY hRegKey)
224+ LPDATAOBJECT pDataObj,
225+ HKEY /* hRegKey */)
226226 {
227- __try
228- {
229- return Initialize_Wrap(pIDFolder, pDataObj, hRegKey);
230- }
231- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
232- {
233- }
234- return E_FAIL;
235-}
236-
237-STDMETHODIMP CShellExt::Initialize_Wrap(PCIDLIST_ABSOLUTE pIDFolder,
238- LPDATAOBJECT pDataObj,
239- HKEY /* hRegKey */)
240-{
241227 CTraceToOutputDebugString::Instance()(__FUNCTION__ ": Shell :: Initialize\n");
242228 PreserveChdir preserveChdir;
243229 files_.clear();
@@ -1010,26 +996,9 @@
1010996 STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
1011997 UINT indexMenu,
1012998 UINT idCmdFirst,
1013- UINT idCmdLast,
999+ UINT /*idCmdLast*/,
10141000 UINT uFlags)
10151001 {
1016- __try
1017- {
1018- return QueryContextMenu_Wrap(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
1019- }
1020- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
1021- {
1022- }
1023- return E_FAIL;
1024-}
1025-
1026-
1027-STDMETHODIMP CShellExt::QueryContextMenu_Wrap(HMENU hMenu,
1028- UINT indexMenu,
1029- UINT idCmdFirst,
1030- UINT /*idCmdLast*/,
1031- UINT uFlags)
1032-{
10331002 CTraceToOutputDebugString::Instance()(__FUNCTION__ ": Shell :: QueryContextMenu itemStates=%ld\n", itemStates);
10341003 PreserveChdir preserveChdir;
10351004
@@ -1335,21 +1304,9 @@
13351304 svnCmd += L"\"";
13361305 }
13371306
1307+// This is called when you invoke a command on the menu:
13381308 STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
13391309 {
1340- __try
1341- {
1342- return InvokeCommand_Wrap(lpcmi);
1343- }
1344- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
1345- {
1346- }
1347- return E_FAIL;
1348-}
1349-
1350-// This is called when you invoke a command on the menu:
1351-STDMETHODIMP CShellExt::InvokeCommand_Wrap(LPCMINVOKECOMMANDINFO lpcmi)
1352-{
13531310 PreserveChdir preserveChdir;
13541311 const HRESULT hr = E_INVALIDARG;
13551312 if (lpcmi == NULL)
@@ -1820,29 +1777,13 @@
18201777 return hr;
18211778 }
18221779
1780+// This is for the status bar and things like that:
18231781 STDMETHODIMP CShellExt::GetCommandString(UINT_PTR idCmd,
18241782 UINT uFlags,
1825- UINT FAR * reserved,
1783+ UINT FAR * /*reserved*/,
18261784 LPSTR pszName,
18271785 UINT cchMax)
18281786 {
1829- __try
1830- {
1831- return GetCommandString_Wrap(idCmd, uFlags, reserved, pszName, cchMax);
1832- }
1833- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
1834- {
1835- }
1836- return E_FAIL;
1837-}
1838-
1839-// This is for the status bar and things like that:
1840-STDMETHODIMP CShellExt::GetCommandString_Wrap(UINT_PTR idCmd,
1841- UINT uFlags,
1842- UINT FAR * /*reserved*/,
1843- LPSTR pszName,
1844- UINT cchMax)
1845-{
18461787 PreserveChdir preserveChdir;
18471788 //do we know the id?
18481789 std::map<UINT_PTR, UINT_PTR>::const_iterator id_it = myIDMap.lower_bound(idCmd);
@@ -1910,18 +1851,6 @@
19101851
19111852 STDMETHODIMP CShellExt::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
19121853 {
1913- __try
1914- {
1915- return HandleMenuMsg_Wrap(uMsg, wParam, lParam);
1916- }
1917- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
1918- {
1919- }
1920- return E_FAIL;
1921-}
1922-
1923-STDMETHODIMP CShellExt::HandleMenuMsg_Wrap(UINT uMsg, WPARAM wParam, LPARAM lParam)
1924-{
19251854 LRESULT res;
19261855 return HandleMenuMsg2(uMsg, wParam, lParam, &res);
19271856 }
@@ -1928,18 +1857,6 @@
19281857
19291858 STDMETHODIMP CShellExt::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult)
19301859 {
1931- __try
1932- {
1933- return HandleMenuMsg2_Wrap(uMsg, wParam, lParam, pResult);
1934- }
1935- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
1936- {
1937- }
1938- return E_FAIL;
1939-}
1940-
1941-STDMETHODIMP CShellExt::HandleMenuMsg2_Wrap(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult)
1942-{
19431860 PreserveChdir preserveChdir;
19441861
19451862 LRESULT res;
--- trunk/src/TortoiseShell/ShellExt.h (revision 28249)
+++ trunk/src/TortoiseShell/ShellExt.h (revision 28250)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2017 - TortoiseSVN
3+// Copyright (C) 2003-2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -219,7 +219,6 @@
219219 CString columnfolder; ///< current folder of ColumnProvider
220220 typedef std::pair<std::wstring, std::string> columnuserprop; ///< type of user property of ColumnProvider
221221 std::vector<columnuserprop> columnuserprops; ///< user properties of ColumnProvider
222- CCrashReportTSVN m_crasher;
223222
224223 #define MAKESTRING(ID) LoadStringEx(g_hResInst, ID, stringtablebuffer, _countof(stringtablebuffer), (WORD)CRegStdDWORD(L"Software\\TortoiseSVN\\LanguageID", MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)))
225224 private:
@@ -243,63 +242,6 @@
243242 void AddPathFileCommand(tstring& svnCmd, LPCTSTR command);
244243 void AddPathFileDropCommand(tstring& svnCmd, LPCTSTR command);
245244
246- /** \name IContextMenu2 wrappers
247- * IContextMenu2 wrapper functions to catch exceptions and send crash reports
248- */
249- //@{
250- STDMETHODIMP QueryContextMenu_Wrap(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
251- STDMETHODIMP InvokeCommand_Wrap(LPCMINVOKECOMMANDINFO lpcmi);
252- STDMETHODIMP GetCommandString_Wrap(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved, LPSTR pszName, UINT cchMax);
253- STDMETHODIMP HandleMenuMsg_Wrap(UINT uMsg, WPARAM wParam, LPARAM lParam);
254- //@}
255-
256- /** \name IContextMenu3 wrappers
257- * IContextMenu3 wrapper functions to catch exceptions and send crash reports
258- */
259- //@{
260- STDMETHODIMP HandleMenuMsg2_Wrap(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult);
261- //@}
262-
263- /** \name IColumnProvider wrappers
264- * IColumnProvider wrapper functions to catch exceptions and send crash reports
265- */
266- //@{
267- STDMETHODIMP GetColumnInfo_Wrap(DWORD dwIndex, SHCOLUMNINFO *psci);
268- STDMETHODIMP GetItemData_Wrap(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData);
269- STDMETHODIMP Initialize_Wrap(LPCSHCOLUMNINIT psci);
270- //@}
271-
272- /** \name IShellExtInit wrappers
273- * IShellExtInit wrapper functions to catch exceptions and send crash reports
274- */
275- //@{
276- STDMETHODIMP Initialize_Wrap(PCIDLIST_ABSOLUTE pIDFolder, LPDATAOBJECT pDataObj, HKEY hKeyID);
277- //@}
278-
279- /** \name IShellIconOverlayIdentifier wrappers
280- * IShellIconOverlayIdentifier wrapper functions to catch exceptions and send crash reports
281- */
282- //@{
283- STDMETHODIMP GetOverlayInfo_Wrap(LPWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags);
284- STDMETHODIMP GetPriority_Wrap(int *pPriority);
285- STDMETHODIMP IsMemberOf_Wrap(LPCWSTR pwszPath, DWORD dwAttrib);
286- //@}
287-
288- /** \name IShellPropSheetExt wrappers
289- * IShellPropSheetExt wrapper functions to catch exceptions and send crash reports
290- */
291- //@{
292- STDMETHODIMP AddPages_Wrap(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
293- //STDMETHODIMP ReplacePage_Wrap(UINT, LPFNADDPROPSHEETPAGE, LPARAM);
294- //@}
295-
296- /** \name ICopyHook wrapper
297- * ICopyHook wrapper functions to catch exceptions and send crash reports
298- */
299- //@{
300- STDMETHODIMP_(UINT) CopyCallback_Wrap(HWND hWnd, UINT wFunc, UINT wFlags, LPCTSTR pszSrcFile, DWORD dwSrcAttribs, LPCTSTR pszDestFile, DWORD dwDestAttribs);
301- //@}
302-
303245 public:
304246 CShellExt(FileState state);
305247 virtual ~CShellExt();
--- trunk/src/TortoiseShell/ColumnProvider.cpp (revision 28249)
+++ trunk/src/TortoiseShell/ColumnProvider.cpp (revision 28250)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2015 - TortoiseSVN
3+// Copyright (C) 2003-2015, 2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -47,23 +47,9 @@
4747
4848 #define MAX_REV_STRING_LEN 10
4949
50+// IColumnProvider members
5051 STDMETHODIMP CShellExt::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO *psci)
5152 {
52- __try
53- {
54- if (psci == nullptr)
55- return E_POINTER;
56- return GetColumnInfo_Wrap(dwIndex, psci);
57- }
58- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
59- {
60- }
61- return E_FAIL;
62-}
63-
64-// IColumnProvider members
65-STDMETHODIMP CShellExt::GetColumnInfo_Wrap(DWORD dwIndex, SHCOLUMNINFO *psci)
66-{
6753 if (psci == 0)
6854 return E_POINTER;
6955
@@ -181,18 +167,6 @@
181167
182168 STDMETHODIMP CShellExt::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData)
183169 {
184- __try
185- {
186- return GetItemData_Wrap(pscid, pscd, pvarData);
187- }
188- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
189- {
190- }
191- return E_FAIL;
192-}
193-
194-STDMETHODIMP CShellExt::GetItemData_Wrap(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData)
195-{
196170 if((pscid == 0) || (pscd == 0))
197171 return E_INVALIDARG;
198172 if(pvarData == 0)
@@ -309,18 +283,6 @@
309283
310284 STDMETHODIMP CShellExt::Initialize(LPCSHCOLUMNINIT psci)
311285 {
312- __try
313- {
314- return Initialize_Wrap(psci);
315- }
316- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
317- {
318- }
319- return E_FAIL;
320-}
321-
322-STDMETHODIMP CShellExt::Initialize_Wrap(LPCSHCOLUMNINIT psci)
323-{
324286 if(psci == 0)
325287 return E_INVALIDARG;
326288 // psci->wszFolder (WCHAR) holds the path to the folder to be displayed
--- trunk/src/TortoiseShell/ShellExt.cpp (revision 28249)
+++ trunk/src/TortoiseShell/ShellExt.cpp (revision 28250)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2016 - TortoiseSVN
3+// Copyright (C) 2003-2016, 2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -32,8 +32,7 @@
3232
3333 // *********************** CShellExt *************************
3434 CShellExt::CShellExt(FileState state)
35- : m_crasher(L"TortoiseSVN", false)
36- , regDiffLater(L"Software\\TortoiseMerge\\DiffLater", L"")
35+ : regDiffLater(L"Software\\TortoiseMerge\\DiffLater", L"")
3736 , itemStates(0)
3837 , itemStatesFolder(0)
3938 , space(0)
@@ -291,20 +290,8 @@
291290 }
292291
293292 // ICopyHook member
294-UINT __stdcall CShellExt::CopyCallback(HWND hWnd, UINT wFunc, UINT wFlags, LPCTSTR pszSrcFile, DWORD dwSrcAttribs, LPCTSTR pszDestFile, DWORD dwDestAttribs)
293+UINT __stdcall CShellExt::CopyCallback(HWND /*hWnd*/, UINT wFunc, UINT /*wFlags*/, LPCTSTR pszSrcFile, DWORD /*dwSrcAttribs*/, LPCTSTR /*pszDestFile*/, DWORD /*dwDestAttribs*/)
295294 {
296- __try
297- {
298- return CopyCallback_Wrap(hWnd, wFunc, wFlags, pszSrcFile, dwSrcAttribs, pszDestFile, dwDestAttribs);
299- }
300- __except(GetExceptionCode() == 0xc0000194/*EXCEPTION_POSSIBLE_DEADLOCK*/ ? EXCEPTION_CONTINUE_EXECUTION : CCrashReport::Instance().SendReport(GetExceptionInformation()))
301- {
302- }
303- return IDYES;
304-}
305-
306-UINT __stdcall CShellExt::CopyCallback_Wrap(HWND /*hWnd*/, UINT wFunc, UINT /*wFlags*/, LPCTSTR pszSrcFile, DWORD /*dwSrcAttribs*/, LPCTSTR /*pszDestFile*/, DWORD /*dwDestAttribs*/)
307-{
308295 switch (wFunc)
309296 {
310297 case FO_MOVE:
--- trunk/src/TortoiseShell/IconOverlay.cpp (revision 28249)
+++ trunk/src/TortoiseShell/IconOverlay.cpp (revision 28250)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2015, 2017 - TortoiseSVN
3+// Copyright (C) 2003-2015, 2017-2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -31,18 +31,6 @@
3131
3232 STDMETHODIMP CShellExt::GetOverlayInfo(LPWSTR pwszIconFile, int cchMax, int* pIndex, DWORD* pdwFlags)
3333 {
34- __try
35- {
36- return GetOverlayInfo_Wrap(pwszIconFile, cchMax, pIndex, pdwFlags);
37- }
38- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
39- {
40- }
41- return E_FAIL;
42-}
43-
44-STDMETHODIMP CShellExt::GetOverlayInfo_Wrap(LPWSTR pwszIconFile, int cchMax, int* pIndex, DWORD* pdwFlags)
45-{
4634 if(pwszIconFile == 0)
4735 return E_POINTER;
4836 if(pIndex == 0)
@@ -81,18 +69,6 @@
8169
8270 STDMETHODIMP CShellExt::GetPriority(int *pPriority)
8371 {
84- __try
85- {
86- return GetPriority_Wrap(pPriority);
87- }
88- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
89- {
90- }
91- return E_FAIL;
92-}
93-
94-STDMETHODIMP CShellExt::GetPriority_Wrap(int *pPriority)
95-{
9672 if (pPriority == 0)
9773 return E_POINTER;
9874
@@ -139,20 +115,8 @@
139115 // IShellIconOverlayIdentifier::GetOverlayInfo method to determine which icon
140116 // to display."
141117
142-STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib)
118+STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/)
143119 {
144- __try
145- {
146- return IsMemberOf_Wrap(pwszPath, dwAttrib);
147- }
148- __except(CCrashReport::Instance().SendReport(GetExceptionInformation()))
149- {
150- }
151- return E_FAIL;
152-}
153-
154-STDMETHODIMP CShellExt::IsMemberOf_Wrap(LPCWSTR pwszPath, DWORD /*dwAttrib*/)
155-{
156120 if (pwszPath == NULL)
157121 return E_INVALIDARG;
158122 const TCHAR* pPath = pwszPath;
旧リポジトリブラウザで表示