• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28225 (tree)
Time2018-05-20 03:33:11
Authorstefankueng

Log Message

Allow to specify the exact path from where to load the shell extension dll.

Change Summary

Incremental Difference

--- trunk/src/TortoiseShell/TortoiseStub.cpp (revision 28224)
+++ trunk/src/TortoiseShell/TortoiseStub.cpp (revision 28225)
@@ -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) 2007, 2009, 2012-2014 - TortoiseSVN
3+// Copyright (C) 2007, 2009, 2012-2014, 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,13 +32,14 @@
3232 static LPFNGETCLASSOBJECT pDllGetClassObject = NULL;
3333 static LPFNCANUNLOADNOW pDllCanUnloadNow = NULL;
3434
35+static wchar_t DebugDllPath[MAX_PATH] = { 0 };
3536
3637
37-
3838 static BOOL DebugActive(void)
3939 {
4040 static const WCHAR TSVNRootKey[]=L"Software\\TortoiseSVN";
41- static const WCHAR ExplorerOnlyValue[]=L"DebugShell";
41+ static const WCHAR DebugShellValue[] = L"DebugShell";
42+ static const WCHAR DebugShellPathValue[] = L"DebugShellPath";
4243
4344
4445 DWORD bDebug = 0;
@@ -58,17 +59,40 @@
5859 Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TSVNRootKey, 0, KEY_READ, &hKey);
5960 if (Result == ERROR_SUCCESS)
6061 {
61- Result = RegQueryValueEx(hKey, ExplorerOnlyValue, NULL, &Type, (BYTE *)&bDebug, &Len);
62+ Result = RegQueryValueEx(hKey, DebugShellValue, NULL, &Type, (BYTE *)&bDebug, &Len);
6263 if ((Result == ERROR_SUCCESS) && (Type == REG_DWORD) && (Len == sizeof(DWORD)) && bDebug)
6364 {
6465 TRACE(L"DebugActive() - debug active\n");
6566 bDebugActive = TRUE;
67+ Len = sizeof(wchar_t)*MAX_PATH;
68+ Type = REG_SZ;
69+ Result = RegQueryValueEx(hKey, DebugShellPathValue, NULL, &Type, (BYTE *)DebugDllPath, &Len);
70+ if ((Result == ERROR_SUCCESS) && (Type == REG_SZ) && bDebug)
71+ {
72+ TRACE(L"DebugActive() - debug path set\n");
73+ }
6674 }
6775
6876 RegCloseKey(hKey);
6977 }
7078 }
79+ else
80+ {
81+ Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TSVNRootKey, 0, KEY_READ, &hKey);
82+ if (Result == ERROR_SUCCESS)
83+ {
84+ Len = sizeof(wchar_t)*MAX_PATH;
85+ Type = REG_SZ;
86+ Result = RegQueryValueEx(hKey, DebugShellPathValue, NULL, &Type, (BYTE *)DebugDllPath, &Len);
87+ if ((Result == ERROR_SUCCESS) && (Type == REG_SZ) && bDebug)
88+ {
89+ TRACE(L"DebugActive() - debug path set\n");
90+ }
7191
92+ RegCloseKey(hKey);
93+ }
94+ }
95+
7296 TRACE(L"WantRealVersion() - Exit\n");
7397 return bDebugActive;
7498 }
@@ -142,6 +166,7 @@
142166 WCHAR ModuleName[MAX_PATH] = {0};
143167 DWORD Len = 0;
144168 HINSTANCE hUseInst = hInst;
169+ DebugDllPath[0] = 0;
145170
146171 if (hTortoiseSVN)
147172 return;
@@ -186,6 +211,8 @@
186211 #else
187212 lstrcat(ModuleName, L"\\TortoiseSVN32.dll");
188213 #endif
214+ if (DebugDllPath[0])
215+ lstrcpy(ModuleName, DebugDllPath);
189216 TRACE(L"LoadRealLibrary() - Load %s\n", ModuleName);
190217
191218 hTortoiseSVN = LoadLibraryEx(ModuleName, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
@@ -269,6 +296,7 @@
269296 {
270297 case DLL_PROCESS_ATTACH:
271298 hInst = hInstance;
299+ DebugDllPath[0] = 0;
272300 break;
273301
274302 /*case DLL_THREAD_ATTACH:
Show on old repository browser