aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/win_crash_logger
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger.cpp36
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj319
2 files changed, 337 insertions, 18 deletions
diff --git a/linden/indra/win_crash_logger/win_crash_logger.cpp b/linden/indra/win_crash_logger/win_crash_logger.cpp
index effe56c..5849438 100644
--- a/linden/indra/win_crash_logger/win_crash_logger.cpp
+++ b/linden/indra/win_crash_logger/win_crash_logger.cpp
@@ -69,8 +69,8 @@ void write_debug(std::string& str);
69 69
70// Global Variables: 70// Global Variables:
71HINSTANCE hInst= NULL; // current instance 71HINSTANCE hInst= NULL; // current instance
72TCHAR szTitle[MAX_LOADSTRING]; // The title bar text 72TCHAR szTitle[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
73TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text 73TCHAR szWindowClass[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
74 74
75LLString gUserText; // User's description of the problem 75LLString gUserText; // User's description of the problem
76time_t gStartTime = 0; 76time_t gStartTime = 0;
@@ -91,10 +91,10 @@ WCHAR gProductName[512];
91// Include product name in the window caption. 91// Include product name in the window caption.
92void ProcessCaption(HWND hWnd) 92void ProcessCaption(HWND hWnd)
93{ 93{
94 TCHAR templateText[1024]; 94 TCHAR templateText[1024]; /* Flawfinder: ignore */
95 TCHAR finalText[2048]; 95 TCHAR finalText[2048]; /* Flawfinder: ignore */
96 GetWindowText(hWnd, templateText, sizeof(templateText)); 96 GetWindowText(hWnd, templateText, sizeof(templateText));
97 swprintf(finalText, templateText, gProductName); 97 swprintf(finalText, templateText, gProductName); /* Flawfinder: ignore */
98 SetWindowText(hWnd, finalText); 98 SetWindowText(hWnd, finalText);
99} 99}
100 100
@@ -102,10 +102,10 @@ void ProcessCaption(HWND hWnd)
102// Include product name in the diaog item text. 102// Include product name in the diaog item text.
103void ProcessDlgItemText(HWND hWnd, int nIDDlgItem) 103void ProcessDlgItemText(HWND hWnd, int nIDDlgItem)
104{ 104{
105 TCHAR templateText[1024]; 105 TCHAR templateText[1024]; /* Flawfinder: ignore */
106 TCHAR finalText[2048]; 106 TCHAR finalText[2048]; /* Flawfinder: ignore */
107 GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText)); 107 GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText));
108 swprintf(finalText, templateText, gProductName); 108 swprintf(finalText, templateText, gProductName); /* Flawfinder: ignore */
109 SetDlgItemText(hWnd, nIDDlgItem, finalText); 109 SetDlgItemText(hWnd, nIDDlgItem, finalText);
110} 110}
111 111
@@ -119,7 +119,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
119 gDirUtilp->initAppDirs("SecondLife"); 119 gDirUtilp->initAppDirs("SecondLife");
120 120
121 // Default to the product name "Second Life" (this is overridden by the -name argument) 121 // Default to the product name "Second Life" (this is overridden by the -name argument)
122 swprintf(gProductName, L"Second Life"); 122 swprintf(gProductName, L"Second Life"); /* Flawfinder: ignore */
123 123
124 gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes " 124 gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes "
125 "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)"); 125 "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)");
@@ -138,7 +138,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
138 138
139 const S32 MAX_ARGS = 100; 139 const S32 MAX_ARGS = 100;
140 int argc = 0; 140 int argc = 0;
141 char *argv[MAX_ARGS]; 141 char *argv[MAX_ARGS]; /* Flawfinder: ignore */
142 142
143 char *token = NULL; 143 char *token = NULL;
144 if( cmd_line_including_exe_name[0] == '\"' ) 144 if( cmd_line_including_exe_name[0] == '\"' )
@@ -158,7 +158,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
158 { 158 {
159 argv[argc++] = token; 159 argv[argc++] = token;
160 /* Get next token: */ 160 /* Get next token: */
161 if (*(token + strlen(token) + 1) == '\"') 161 if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */
162 { 162 {
163 token = strtok( NULL, "\""); 163 token = strtok( NULL, "\"");
164 } 164 }
@@ -269,11 +269,11 @@ int APIENTRY WinMain(HINSTANCE hInstance,
269 WCHAR header[2048]; 269 WCHAR header[2048];
270 if (gCrashInPreviousExec) 270 if (gCrashInPreviousExec)
271 { 271 {
272 swprintf(header, L"%s appears to have crashed or frozen the last time it ran.", gProductName); 272 swprintf(header, L"%s appears to have crashed or frozen the last time it ran.", gProductName); /* Flawfinder: ignore */
273 } 273 }
274 else 274 else
275 { 275 {
276 swprintf(header, L"%s appears to have crashed.", gProductName); 276 swprintf(header, L"%s appears to have crashed.", gProductName); /* Flawfinder: ignore */
277 } 277 }
278 SetDlgItemText(gHwndReport, IDC_STATIC_HEADER, header); 278 SetDlgItemText(gHwndReport, IDC_STATIC_HEADER, header);
279 ShowWindow(gHwndReport, SW_SHOW ); 279 ShowWindow(gHwndReport, SW_SHOW );
@@ -497,7 +497,7 @@ void send_crash_report()
497 497
498 // Get the filename of the SecondLife.log file 498 // Get the filename of the SecondLife.log file
499 // *NOTE: This buffer size is hard coded into scanf() below. 499 // *NOTE: This buffer size is hard coded into scanf() below.
500 char tmp_sl_name[256]; 500 char tmp_sl_name[256]; /* Flawfinder: ignore */
501 tmp_sl_name[0] = '\0'; 501 tmp_sl_name[0] = '\0';
502 502
503 update_messages(); 503 update_messages();
@@ -701,7 +701,7 @@ void send_crash_report()
701 // Post data to web server 701 // Post data to web server
702 const S32 BUFSIZE = 65536; 702 const S32 BUFSIZE = 65536;
703 HINTERNET hinet, hsession, hrequest; 703 HINTERNET hinet, hsession, hrequest;
704 char data[BUFSIZE]; 704 char data[BUFSIZE]; /* Flawfinder: ignore */
705 unsigned long bytes_read; 705 unsigned long bytes_read;
706 706
707 llinfos << "Connecting to crash report server" << llendl; 707 llinfos << "Connecting to crash report server" << llendl;
@@ -809,7 +809,7 @@ LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename)
809 while (count < 5) 809 while (count < 5)
810 { 810 {
811 buf_size = stat_data.st_size; 811 buf_size = stat_data.st_size;
812 fp = LLFile::fopen(mFilename.c_str(), "rb"); 812 fp = LLFile::fopen(mFilename.c_str(), "rb"); /* Flawfinder: ignore */
813 if (!fp) 813 if (!fp)
814 { 814 {
815 llwarns << "Can't open file " << mFilename << ", wait for a second" << llendl; 815 llwarns << "Can't open file " << mFilename << ", wait for a second" << llendl;
@@ -897,14 +897,14 @@ void write_debug(const char *str)
897 { 897 {
898 std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); 898 std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log");
899 llinfos << "Opening debug file " << debug_filename << llendl; 899 llinfos << "Opening debug file " << debug_filename << llendl;
900 gDebugFile = LLFile::fopen(debug_filename.c_str(), "a+"); 900 gDebugFile = LLFile::fopen(debug_filename.c_str(), "a+"); /* Flawfinder: ignore */
901 if (!gDebugFile) 901 if (!gDebugFile)
902 { 902 {
903 fprintf(stderr, "Couldn't open %s: debug log to stderr instead.\n", debug_filename.c_str()); 903 fprintf(stderr, "Couldn't open %s: debug log to stderr instead.\n", debug_filename.c_str());
904 gDebugFile = stderr; 904 gDebugFile = stderr;
905 } 905 }
906 } 906 }
907 fprintf(gDebugFile, str); 907 fprintf(gDebugFile, str); /* Flawfinder: ignore */
908 fflush(gDebugFile); 908 fflush(gDebugFile);
909} 909}
910 910
diff --git a/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj b/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj
new file mode 100644
index 0000000..78ae4e6
--- /dev/null
+++ b/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj
@@ -0,0 +1,319 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="8.00"
5 Name="win_crash_logger"
6 ProjectGUID="{648685F3-8760-4CC5-BB2B-CAF9DECC25A4}"
7 RootNamespace="win_crash_logger"
8 Keyword="Win32Proj"
9 >
10 <Platforms>
11 <Platform
12 Name="Win32"
13 />
14 </Platforms>
15 <ToolFiles>
16 </ToolFiles>
17 <Configurations>
18 <Configuration
19 Name="Debug|Win32"
20 OutputDirectory="Debug"
21 IntermediateDirectory="Debug"
22 ConfigurationType="1"
23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
24 CharacterSet="1"
25 >
26 <Tool
27 Name="VCPreBuildEventTool"
28 />
29 <Tool
30 Name="VCCustomBuildTool"
31 />
32 <Tool
33 Name="VCXMLDataGeneratorTool"
34 />
35 <Tool
36 Name="VCWebServiceProxyGeneratorTool"
37 />
38 <Tool
39 Name="VCMIDLTool"
40 />
41 <Tool
42 Name="VCCLCompilerTool"
43 Optimization="0"
44 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
45 PreprocessorDefinitions="WIN32;_DEBUG;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true"
47 BasicRuntimeChecks="3"
48 RuntimeLibrary="1"
49 StructMemberAlignment="4"
50 TreatWChar_tAsBuiltInType="false"
51 ForceConformanceInForLoopScope="true"
52 UsePrecompiledHeader="0"
53 WarningLevel="3"
54 Detect64BitPortabilityProblems="false"
55 DebugInformationFormat="4"
56 />
57 <Tool
58 Name="VCManagedResourceCompilerTool"
59 />
60 <Tool
61 Name="VCResourceCompilerTool"
62 />
63 <Tool
64 Name="VCPreLinkEventTool"
65 />
66 <Tool
67 Name="VCLinkerTool"
68 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib llcommon.lib llmath.lib llwindow.lib llvfs.lib llmessage.lib llxml.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib"
69 OutputFile="win_crash_logger.exe"
70 LinkIncremental="1"
71 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_debug"
72 GenerateDebugInformation="true"
73 ProgramDatabaseFile="$(OutDir)/win_crash_logger.pdb"
74 SubSystem="2"
75 TargetMachine="1"
76 />
77 <Tool
78 Name="VCALinkTool"
79 />
80 <Tool
81 Name="VCManifestTool"
82 />
83 <Tool
84 Name="VCXDCMakeTool"
85 />
86 <Tool
87 Name="VCBscMakeTool"
88 />
89 <Tool
90 Name="VCFxCopTool"
91 />
92 <Tool
93 Name="VCAppVerifierTool"
94 />
95 <Tool
96 Name="VCWebDeploymentTool"
97 />
98 <Tool
99 Name="VCPostBuildEventTool"
100 />
101 </Configuration>
102 <Configuration
103 Name="Release|Win32"
104 OutputDirectory="Release"
105 IntermediateDirectory="Release"
106 ConfigurationType="1"
107 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
108 CharacterSet="1"
109 >
110 <Tool
111 Name="VCPreBuildEventTool"
112 />
113 <Tool
114 Name="VCCustomBuildTool"
115 />
116 <Tool
117 Name="VCXMLDataGeneratorTool"
118 />
119 <Tool
120 Name="VCWebServiceProxyGeneratorTool"
121 />
122 <Tool
123 Name="VCMIDLTool"
124 />
125 <Tool
126 Name="VCCLCompilerTool"
127 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
128 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
129 RuntimeLibrary="0"
130 StructMemberAlignment="0"
131 TreatWChar_tAsBuiltInType="false"
132 ForceConformanceInForLoopScope="true"
133 UsePrecompiledHeader="0"
134 WarningLevel="3"
135 Detect64BitPortabilityProblems="false"
136 DebugInformationFormat="3"
137 />
138 <Tool
139 Name="VCManagedResourceCompilerTool"
140 />
141 <Tool
142 Name="VCResourceCompilerTool"
143 />
144 <Tool
145 Name="VCPreLinkEventTool"
146 />
147 <Tool
148 Name="VCLinkerTool"
149 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib llcommon.lib llmath.lib llwindow.lib llvfs.lib llmessage.lib llxml.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib"
150 OutputFile="win_crash_logger.exe"
151 LinkIncremental="1"
152 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
153 GenerateDebugInformation="true"
154 SubSystem="2"
155 OptimizeReferences="2"
156 EnableCOMDATFolding="2"
157 TargetMachine="1"
158 />
159 <Tool
160 Name="VCALinkTool"
161 />
162 <Tool
163 Name="VCManifestTool"
164 />
165 <Tool
166 Name="VCXDCMakeTool"
167 />
168 <Tool
169 Name="VCBscMakeTool"
170 />
171 <Tool
172 Name="VCFxCopTool"
173 />
174 <Tool
175 Name="VCAppVerifierTool"
176 />
177 <Tool
178 Name="VCWebDeploymentTool"
179 />
180 <Tool
181 Name="VCPostBuildEventTool"
182 />
183 </Configuration>
184 <Configuration
185 Name="ReleaseNoOpt|Win32"
186 OutputDirectory="$(ConfigurationName)"
187 IntermediateDirectory="$(ConfigurationName)"
188 ConfigurationType="1"
189 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
190 CharacterSet="1"
191 >
192 <Tool
193 Name="VCPreBuildEventTool"
194 />
195 <Tool
196 Name="VCCustomBuildTool"
197 />
198 <Tool
199 Name="VCXMLDataGeneratorTool"
200 />
201 <Tool
202 Name="VCWebServiceProxyGeneratorTool"
203 />
204 <Tool
205 Name="VCMIDLTool"
206 />
207 <Tool
208 Name="VCCLCompilerTool"
209 AdditionalIncludeDirectories="..\llcommon;..\llmath;..\llvfs;..\llaudio;..\llmedia;..\llimage;..\llscene;..\llxml;..\llmessage;..\llprimitive;..\llrender;..\llwindow;..\llcharacter;..\llinventory;..\llui;..\lscript;&quot;..\..\libraries\i686-win32\include&quot;;..\..\libraries\include\;&quot;..\..\libraries\i686-win32\include\quicktime&quot;"
210 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
211 RuntimeLibrary="0"
212 StructMemberAlignment="0"
213 TreatWChar_tAsBuiltInType="false"
214 ForceConformanceInForLoopScope="true"
215 UsePrecompiledHeader="0"
216 WarningLevel="3"
217 Detect64BitPortabilityProblems="false"
218 DebugInformationFormat="3"
219 />
220 <Tool
221 Name="VCManagedResourceCompilerTool"
222 />
223 <Tool
224 Name="VCResourceCompilerTool"
225 />
226 <Tool
227 Name="VCPreLinkEventTool"
228 />
229 <Tool
230 Name="VCLinkerTool"
231 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib llcommon.lib llmath.lib llwindow.lib llvfs.lib llmessage.lib llxml.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib"
232 OutputFile="win_crash_logger.exe"
233 LinkIncremental="1"
234 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
235 GenerateDebugInformation="true"
236 SubSystem="2"
237 OptimizeReferences="2"
238 EnableCOMDATFolding="2"
239 TargetMachine="1"
240 />
241 <Tool
242 Name="VCALinkTool"
243 />
244 <Tool
245 Name="VCManifestTool"
246 />
247 <Tool
248 Name="VCXDCMakeTool"
249 />
250 <Tool
251 Name="VCBscMakeTool"
252 />
253 <Tool
254 Name="VCFxCopTool"
255 />
256 <Tool
257 Name="VCAppVerifierTool"
258 />
259 <Tool
260 Name="VCWebDeploymentTool"
261 />
262 <Tool
263 Name="VCPostBuildEventTool"
264 />
265 </Configuration>
266 </Configurations>
267 <References>
268 </References>
269 <Files>
270 <Filter
271 Name="Source Files"
272 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
273 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
274 >
275 <File
276 RelativePath=".\StdAfx.cpp"
277 >
278 </File>
279 <File
280 RelativePath=".\win_crash_logger.cpp"
281 >
282 </File>
283 </Filter>
284 <Filter
285 Name="Header Files"
286 Filter="h;hpp;hxx;hm;inl;inc;xsd"
287 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
288 >
289 <File
290 RelativePath=".\resource.h"
291 >
292 </File>
293 <File
294 RelativePath=".\StdAfx.h"
295 >
296 </File>
297 <File
298 RelativePath=".\win_crash_logger.h"
299 >
300 </File>
301 </Filter>
302 <Filter
303 Name="Resource Files"
304 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
305 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
306 >
307 <File
308 RelativePath=".\ll_icon.ico"
309 >
310 </File>
311 <File
312 RelativePath=".\win_crash_logger.rc"
313 >
314 </File>
315 </Filter>
316 </Files>
317 <Globals>
318 </Globals>
319</VisualStudioProject>