Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

Merge with stable

Changeset f27f08cac337

Parents 86ad2e9d9583

Parents 1f3219626658

by Steve Borho

Changes to 5 files · Browse files at f27f08cac337 Showing diff from parent 86ad2e9d9583 1f3219626658 Diff from another changeset...

 
359
360
361
362
 
363
364
365
 
535
536
537
538
 
539
540
541
 
726
727
728
729
 
730
731
732
 
733
734
735
 
874
875
876
877
 
878
879
880
 
911
912
913
 
 
 
914
 
915
916
917
 
932
933
934
935
 
936
937
938
 
359
360
361
 
362
363
364
365
 
535
536
537
 
538
539
540
541
 
726
727
728
 
729
730
731
 
732
733
734
735
 
874
875
876
 
877
878
879
880
 
911
912
913
914
915
916
917
918
919
920
921
 
936
937
938
 
939
940
941
942
@@ -359,7 +359,7 @@
  bAppendItems = FALSE;     if (!bAppendItems) - return NOERROR; + return S_OK;     const std::size_t sz = sizeof(menuDescList) / sizeof(MenuDescription);   bool promoted[sz]; @@ -535,7 +535,7 @@
  if (iter != MenuIdMap.end())   {   DoHgtk(iter->second.name); - hr = NOERROR; + hr = S_OK;   }   else   { @@ -726,10 +726,10 @@
  break;     default: - return NOERROR; + return S_OK;   }   - return NOERROR; + return S_OK;  }     @@ -874,7 +874,7 @@
  myFolder = name;   }   - return NOERROR; + return S_OK;  }     @@ -911,7 +911,11 @@
   STDMETHODIMP CShellExtCMenu::QueryInterface(REFIID riid, LPVOID FAR* ppv)  { + if (ppv == 0) + return E_POINTER; +   *ppv = NULL; +   if (IsEqualIID(riid, IID_IShellExtInit) || IsEqualIID(riid, IID_IUnknown))   {   *ppv = (LPSHELLEXTINIT) this; @@ -932,7 +936,7 @@
  if (*ppv)   {   AddRef(); - return NOERROR; + return S_OK;   }     return E_NOINTERFACE;
 
89
90
91
 
 
 
92
 
93
94
95
 
99
100
101
102
 
103
104
105
 
89
90
91
92
93
94
95
96
97
98
99
 
103
104
105
 
106
107
108
109
@@ -89,7 +89,11 @@
   STDMETHODIMP CShellExtOverlay::QueryInterface(REFIID riid, LPVOID FAR* ppv)  { + if (ppv == 0) + return E_POINTER; +   *ppv = NULL; +   if (IsEqualIID(riid, IID_IShellIconOverlayIdentifier)   || IsEqualIID(riid, IID_IUnknown) )   { @@ -99,7 +103,7 @@
  if (*ppv)   {   AddRef(); - return NOERROR; + return S_OK;   }     return E_NOINTERFACE;
 
27
28
29
30
31
32
 
33
34
35
36
 
37
38
39
40
 
41
42
43
44
45
46
47
48
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
51
52
 
57
58
59
60
61
62
 
63
64
65
66
67
68
69
 
70
71
72
73
74
75
76
 
77
78
79
 
82
83
84
 
 
85
86
 
87
88
89
 
91
92
93
94
95
96
97
98
 
 
 
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
 
27
28
29
 
 
 
30
31
32
33
 
34
35
36
37
 
38
39
40
41
42
 
 
43
44
 
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
 
129
130
131
 
 
 
132
133
134
135
136
137
138
 
139
140
141
142
143
 
 
 
144
145
146
147
 
150
151
152
153
154
155
156
157
158
159
160
 
162
163
164
 
 
 
 
 
165
166
167
168
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
171
172
@@ -27,26 +27,98 @@
   === Building the x86 (32 bit) target ===   -Click on "Start -> All Programs -> Microsoft Windows SDK v7.0 -> CMD Shell" - -This will open a command shell. +Open a command shell and cd into win32/shellext of the TortoiseHg sources.    Copy/paste the following line (including the double quotes) into that shell   -"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\setenv.cmd" /xp /x86 /Release +cmd.exe /E:ON /V:ON /K "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /xp /x86 /Release    and execute it (see ReleaseNotes.Htm).   -This will show the following in your shell +This should show the following in your shell    '''  Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0.  Targeting Windows XP x86 RELEASE - -C:\Program Files\Microsoft SDKs\Windows\v7.0>  '''   -Then cd into the win32/shellext of the TortoiseHg sources and execute +Then execute + + nmake /f Makefile.nmake clean + +followed by + + nmake /f Makefile.nmake + +Which should go like this: + +''' +$ nmake /f Makefile.nmake clean + +Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 +Copyright (C) Microsoft Corporation. All rights reserved. + + del *.obj *.dll *.exe *.lib *.exp *.manifest + +$ nmake /f Makefile.nmake + +Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 +Copyright (C) Microsoft Corporation. All rights reserved. + + cl /nologo /Ox /W2 /EHsc /MT /DAPPMAIN /DTHG_DEBUG /c TortoiseUtils.cpp Direntry.cpp Directory.cpp Winstat.cpp ThgDebug.cpp InitStatus.cpp CShellExtCMenu.cpp CShellExtOverlay.cpp IconBitmapUtils.cpp Registry.cpp ShellExt.cpp StringUtils.cpp SysInfo.cpp dirstate.cpp Winstat64.cpp Dirstatecache.cpp DirectoryStatus.cpp Thgstatus.cpp QueryDirstate.cpp +TortoiseUtils.cpp +Direntry.cpp +Directory.cpp +Winstat.cpp +ThgDebug.cpp +InitStatus.cpp +CShellExtCMenu.cpp +CShellExtOverlay.cpp +IconBitmapUtils.cpp +Registry.cpp +ShellExt.cpp +StringUtils.cpp +SysInfo.cpp +dirstate.cpp +Winstat64.cpp +Dirstatecache.cpp +DirectoryStatus.cpp +Thgstatus.cpp +QueryDirstate.cpp +Generating Code... + link /OUT:THgShell.dll /nologo /INCREMENTAL:NO /MANIFEST shlwapi.lib gdiplus.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DLL /DEF:ShellExt.def TortoiseUtils.obj Direntry.obj Directory.obj Winstat.obj +ThgDebug.obj InitStatus.obj CShellExtCMenu.obj CShellExtOverlay.obj IconBitmapUtils.obj Registry.obj ShellExt.obj StringUtils.obj SysInfo.obj dirstate.obj +Winstat64.obj Dirstatecache.obj DirectoryStatus.obj Thgstatus.obj QueryDirstate.obj + Creating library THgShell.lib and object THgShell.exp + mt -nologo -manifest THgShell.dll.manifest -outputresource:"THgShell.dll;#2" +''' + +This should produce the file THgShell.dll, which contains the 32 bit variant of the +shell extension. + +To install it for testing on a 32 bit Windows, rename the THgShell.dll in "C:\Program Files\TortoiseHg" +to something else (e.g. THgShell-01.dll), then copy the newly built THgShell.dll to +"C:\Program Files\TortoiseHg" and restart explorer.exe (logout/login or restart will do as well). + + +=== Building the 64 bit target === + +Open a command shell and cd into win32/shellext of the TortoiseHg sources. + +Copy/paste the following line (including the double quotes) into that shell + +cmd.exe /E:ON /V:ON /K "C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /xp /x64 /Release + +and execute it (see ReleaseNotes.Htm). + +This should show the following in your shell + +''' +Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0. +Targeting Windows XP x64 RELEASE +''' + +Then execute     nmake /f Makefile.nmake clean   @@ -57,23 +129,19 @@
 Which should go like this:    ''' -C:\Program Files\Microsoft SDKs\Windows\v7.0>cd C:\Users\adi\hgrepos\thg-stable\win32\shellext - -C:\Users\adi\hgrepos\thg-stable\win32\shellext>nmake /f Makefile.nmake clean +$ nmake /f Makefile.nmake clean    Microsoft (R) Program Maintenance Utility Version 9.00.30729.01  Copyright (C) Microsoft Corporation. All rights reserved.     del *.obj *.dll *.exe *.lib *.exp *.manifest   -C:\Users\adi\hgrepos\thg-stable\win32\shellext>nmake /f Makefile.nmake +$ nmake /f Makefile.nmake    Microsoft (R) Program Maintenance Utility Version 9.00.30729.01  Copyright (C) Microsoft Corporation. All rights reserved.   - cl /nologo /Ox /W2 /EHsc /MT /DAPPMAIN /DTHG_DEBUG /c TortoiseUtils.cpp Direntry.cpp Directory.cpp Winstat.cpp ThgDebug.cpp - InitStatus.cpp CShellExtCMenu.cpp CShellExtOverlay.cpp ShellExt.cpp StringUtils.cpp dirstate.cpp Winstat64.cpp Dirstatecache.cpp D -irectoryStatus.cpp Thgstatus.cpp QueryDirstate.cpp + cl /nologo /Ox /W2 /EHsc /MT /DAPPMAIN /DTHG_DEBUG /c TortoiseUtils.cpp Direntry.cpp Directory.cpp Winstat.cpp ThgDebug.cpp InitStatus.cpp CShellExtCMenu.cpp CShellExtOverlay.cpp IconBitmapUtils.cpp Registry.cpp ShellExt.cpp StringUtils.cpp SysInfo.cpp dirstate.cpp Winstat64.cpp Dirstatecache.cpp DirectoryStatus.cpp Thgstatus.cpp QueryDirstate.cpp  TortoiseUtils.cpp  Direntry.cpp  Directory.cpp @@ -82,8 +150,11 @@
 InitStatus.cpp  CShellExtCMenu.cpp  CShellExtOverlay.cpp +IconBitmapUtils.cpp +Registry.cpp  ShellExt.cpp  StringUtils.cpp +SysInfo.cpp  dirstate.cpp  Winstat64.cpp  Dirstatecache.cpp @@ -91,102 +162,11 @@
 Thgstatus.cpp  QueryDirstate.cpp  Generating Code... - link /OUT:THgShell.dll /nologo /INCREMENTAL:NO /MANIFEST User32.lib Ole32.lib Shlwapi.lib Shell32.lib Advapi32.lib /DLL /DE -F:ShellExt.def TortoiseUtils.obj Direntry.obj Directory.obj Winstat.obj ThgDebug.obj InitStatus.obj CShellExtCMenu.obj CShellExtOve -rlay.obj ShellExt.obj StringUtils.obj dirstate.obj Winstat64.obj Dirstatecache.obj DirectoryStatus.obj Thgstatus.obj QueryDirstate. -obj -ShellExt.def(4) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored + link /OUT:THgShell.dll /nologo /INCREMENTAL:NO /MANIFEST shlwapi.lib gdiplus.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DLL /DEF:ShellExt.def TortoiseUtils.obj Direntry.obj Directory.obj Winstat.obj +ThgDebug.obj InitStatus.obj CShellExtCMenu.obj CShellExtOverlay.obj IconBitmapUtils.obj Registry.obj ShellExt.obj StringUtils.obj SysInfo.obj dirstate.obj +Winstat64.obj Dirstatecache.obj DirectoryStatus.obj Thgstatus.obj QueryDirstate.obj   Creating library THgShell.lib and object THgShell.exp   mt -nologo -manifest THgShell.dll.manifest -outputresource:"THgShell.dll;#2" - link /OUT:dirstate.exe /nologo /INCREMENTAL:NO /MANIFEST User32.lib Ole32.lib Shlwapi.lib Shell32.lib Advapi32.lib /SUBSYST -EM:CONSOLE dirstate.obj TortoiseUtils.obj Direntry.obj Directory.obj Winstat.obj ThgDebug.obj - mt -nologo -manifest dirstate.exe.manifest -outputresource:"dirstate.exe;#1" -''' - -This should produce the file THgShell.dll, which contains the 32 bit variant of the -shell extension. - -To install it for testing on a 32 bit Windows, rename the THgShell.dll in "C:\Program Files\TortoiseHg" -to something else (e.g. THgShell-01.dll), then copy the newly built THgShell.dll to -"C:\Program Files\TortoiseHg" and restart explorer.exe (logout/login or restart will do as well). - - -=== Building the 64 bit target === - -Click on "Start -> All Programs -> Microsoft Windows SDK v7.0 -> CMD Shell" - -This will open a command shell. - -Copy/paste the following line (including the double quotes) into that shell - -"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\setenv.cmd" /xp /x64 /Release - -and execute it (see ReleaseNotes.Htm). - -This will show the following in your shell - -''' -Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0. -Targeting Windows XP x64 RELEASE - -C:\Program Files\Microsoft SDKs\Windows\v7.0> -''' - -Then cd into the win32/shellext of the TortoiseHg sources and execute - - nmake /f Makefile.nmake clean - -followed by - - nmake /f Makefile.nmake - -Which should go like this: - -''' -C:\Program Files\Microsoft SDKs\Windows\v7.0>cd C:\Users\adi\hgrepos\thg-stable\win32\shellext - -C:\Users\adi\hgrepos\thg-stable\win32\shellext>nmake /f Makefile.nmake clean - -Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 -Copyright (C) Microsoft Corporation. All rights reserved. - - del *.obj *.dll *.exe *.lib *.exp *.manifest - -C:\Users\adi\hgrepos\thg-stable\win32\shellext>nmake /f Makefile.nmake - -Microsoft (R) Program Maintenance Utility Version 9.00.30729.01 -Copyright (C) Microsoft Corporation. All rights reserved. - - cl /nologo /Ox /W2 /EHsc /MT /DAPPMAIN /DTHG_DEBUG /c TortoiseUtils.cpp Direntry.cpp Directory.cpp Winstat.cpp ThgDebug.cpp - InitStatus.cpp CShellExtCMenu.cpp CShellExtOverlay.cpp ShellExt.cpp StringUtils.cpp dirstate.cpp Winstat64.cpp Dirstatecache.cpp D -irectoryStatus.cpp Thgstatus.cpp QueryDirstate.cpp -TortoiseUtils.cpp -Direntry.cpp -Directory.cpp -Winstat.cpp -ThgDebug.cpp -InitStatus.cpp -CShellExtCMenu.cpp -CShellExtOverlay.cpp -ShellExt.cpp -StringUtils.cpp -dirstate.cpp -Winstat64.cpp -Dirstatecache.cpp -DirectoryStatus.cpp -Thgstatus.cpp -QueryDirstate.cpp -Generating Code... - link /OUT:THgShell.dll /nologo /INCREMENTAL:NO /MANIFEST User32.lib Ole32.lib Shlwapi.lib Shell32.lib Advapi32.lib /DLL /DE -F:ShellExt.def TortoiseUtils.obj Direntry.obj Directory.obj Winstat.obj ThgDebug.obj InitStatus.obj CShellExtCMenu.obj CShellExtOve -rlay.obj ShellExt.obj StringUtils.obj dirstate.obj Winstat64.obj Dirstatecache.obj DirectoryStatus.obj Thgstatus.obj QueryDirstate. -obj -ShellExt.def(4) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored - Creating library THgShell.lib and object THgShell.exp - mt -nologo -manifest THgShell.dll.manifest -outputresource:"THgShell.dll;#2" - link /OUT:dirstate.exe /nologo /INCREMENTAL:NO /MANIFEST User32.lib Ole32.lib Shlwapi.lib Shell32.lib Advapi32.lib /SUBSYST -EM:CONSOLE dirstate.obj TortoiseUtils.obj Direntry.obj Directory.obj Winstat.obj ThgDebug.obj - mt -nologo -manifest dirstate.exe.manifest -outputresource:"dirstate.exe;#1"  '''    This should produce the file THgShell.dll, which contains the 64 bit variant of the
 
77
78
79
 
 
 
 
 
 
 
80
81
82
 
77
78
79
80
81
82
83
84
85
86
87
88
89
@@ -77,6 +77,13 @@
  LPWSTR pwszShellExt;   StringFromIID(rclsid, &pwszShellExt);   TDEBUG_TRACE("DllGetClassObject clsid = " << WideToMultibyte(pwszShellExt)); + + if (ppvOut == 0) + { + TDEBUG_TRACE("**** DllGetClassObject: error: ppvOut is 0"); + return E_POINTER; + } +   *ppvOut = NULL;     typedef ThgClassFactory<CShellExtOverlay> FactOvl;
 
28
29
30
 
 
 
31
32
33
34
35
36
37
 
38
39
40
 
62
63
64
 
 
 
65
66
67
 
71
72
73
74
 
 
 
 
 
75
76
77
78
79
80
 
81
82
83
 
28
29
30
31
32
33
34
35
36
37
38
39
 
40
41
42
43
 
65
66
67
68
69
70
71
72
73
 
77
78
79
 
80
81
82
83
84
85
86
87
88
89
 
90
91
92
93
@@ -28,13 +28,16 @@
  STDMETHODIMP QueryInterface(   REFIID riid, LPVOID FAR* ppv)   { + if (ppv == 0) + return E_POINTER; +   *ppv = NULL;     if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory))   {   *ppv = (LPCLASSFACTORY) this;   AddRef(); - return NOERROR; + return S_OK;   }     return E_NOINTERFACE; @@ -62,6 +65,9 @@
  STDMETHODIMP CreateInstance(   LPUNKNOWN pUnkOuter, REFIID riid, LPVOID* ppvObj)   { + if (ppvObj == 0) + return E_POINTER; +   *ppvObj = NULL;     if (pUnkOuter) @@ -71,13 +77,17 @@
  if (NULL == pShellExt)   return E_OUTOFMEMORY;   - return pShellExt->QueryInterface(riid, ppvObj); + const HRESULT hr = pShellExt->QueryInterface(riid, ppvObj); + if (FAILED(hr)) + delete pShellExt; + + return hr;   }       STDMETHODIMP LockServer(BOOL fLock)   { - return NOERROR; + return S_OK;   }    };