aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/win_crash_logger
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/win_crash_logger')
-rw-r--r--linden/indra/win_crash_logger/StdAfx.h1
-rw-r--r--linden/indra/win_crash_logger/llcrashloggerwindows.cpp378
-rw-r--r--linden/indra/win_crash_logger/llcrashloggerwindows.h59
-rw-r--r--linden/indra/win_crash_logger/resource.h34
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger.cpp874
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger.rc65
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger.vcproj22
-rw-r--r--linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj29
8 files changed, 558 insertions, 904 deletions
diff --git a/linden/indra/win_crash_logger/StdAfx.h b/linden/indra/win_crash_logger/StdAfx.h
index 6f046f9..3d43115 100644
--- a/linden/indra/win_crash_logger/StdAfx.h
+++ b/linden/indra/win_crash_logger/StdAfx.h
@@ -51,7 +51,6 @@
51#include <stdlib.h> 51#include <stdlib.h>
52#include <malloc.h> 52#include <malloc.h>
53#include <memory.h> 53#include <memory.h>
54#include <tchar.h>
55 54
56// Local Header Files 55// Local Header Files
57 56
diff --git a/linden/indra/win_crash_logger/llcrashloggerwindows.cpp b/linden/indra/win_crash_logger/llcrashloggerwindows.cpp
new file mode 100644
index 0000000..5a25c17
--- /dev/null
+++ b/linden/indra/win_crash_logger/llcrashloggerwindows.cpp
@@ -0,0 +1,378 @@
1/**
2* @file llcrashloggerwindows.cpp
3* @brief Windows crash logger implementation
4*
5* $LicenseInfo:firstyear=2003&license=viewergpl$
6*
7* Copyright (c) 2003-2007, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlife.com/developers/opensource/gplv2
16*
17* There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at http://secondlife.com/developers/opensource/flossexception
21*
22* By copying, modifying or distributing this software, you acknowledge
23* that you have read and understood your obligations described above,
24* and agree to abide by those obligations.
25*
26* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28* COMPLETENESS OR PERFORMANCE.
29* $/LicenseInfo$
30*/
31
32#include "stdafx.h"
33#include "resource.h"
34#include "llcrashloggerwindows.h"
35
36#include <sstream>
37
38#include "boost/tokenizer.hpp"
39
40#include "dbghelp.h"
41#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME
42#include "llerror.h"
43#include "llfile.h"
44#include "lltimer.h"
45#include "llstring.h"
46#include "lldxhardware.h"
47#include "lldir.h"
48#include "llsdserialize.h"
49
50#define MAX_LOADSTRING 100
51#define MAX_STRING 2048
52const char* const SETTINGS_FILE_HEADER = "version";
53const S32 SETTINGS_FILE_VERSION = 101;
54
55// Windows Message Handlers
56
57// Global Variables:
58HINSTANCE hInst= NULL; // current instance
59TCHAR szTitle[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
60TCHAR szWindowClass[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
61
62LLString gProductName;
63HWND gHwndReport = NULL; // Send/Don't Send dialog
64HWND gHwndProgress = NULL; // Progress window
65HCURSOR gCursorArrow = NULL;
66HCURSOR gCursorWait = NULL;
67BOOL gFirstDialog = TRUE; // Are we currently handling the Send/Don't Send dialog?
68std::stringstream gDXInfo;
69bool gSendLogs = false;
70
71
72//Conversion from char* to wchar*
73//Replacement for ATL macros, doesn't allocate memory
74//For more info see: http://www.codeguru.com/forum/showthread.php?t=337247
75void ConvertLPCSTRToLPWSTR (const char* pCstring, WCHAR* outStr)
76{
77 if (pCstring != NULL)
78 {
79 int nInputStrLen = strlen (pCstring);
80 // Double NULL Termination
81 int nOutputStrLen = MultiByteToWideChar(CP_ACP, 0, pCstring, nInputStrLen, NULL, 0) + 2;
82 if (outStr)
83 {
84 memset (outStr, 0x00, sizeof (WCHAR)*nOutputStrLen);
85 MultiByteToWideChar (CP_ACP, 0, pCstring, nInputStrLen, outStr, nInputStrLen);
86 }
87 }
88}
89
90void write_debug(const char *str)
91{
92 gDXInfo << str; /* Flawfinder: ignore */
93}
94
95void write_debug(std::string& str)
96{
97 write_debug(str.c_str());
98}
99
100void show_progress(const char* message)
101{
102 std::wstring msg = wstring_to_utf16str(utf8str_to_wstring(message));
103 if (gHwndProgress)
104 {
105 SendDlgItemMessage(gHwndProgress, // handle to destination window
106 IDC_LOG,
107 WM_SETTEXT, // message to send
108 FALSE, // undo option
109 (LPARAM)msg.c_str());
110 }
111}
112
113void update_messages()
114{
115 MSG msg;
116 while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
117 {
118 if (msg.message == WM_QUIT)
119 {
120 exit(0);
121 }
122 TranslateMessage(&msg);
123 DispatchMessage(&msg);
124 }
125}
126
127void sleep_and_pump_messages( U32 seconds )
128{
129 const U32 CYCLES_PER_SECOND = 10;
130 U32 cycles = seconds * CYCLES_PER_SECOND;
131 while( cycles-- )
132 {
133 update_messages();
134 ms_sleep(1000 / CYCLES_PER_SECOND);
135 }
136}
137
138// Include product name in the window caption.
139void LLCrashLoggerWindows::ProcessCaption(HWND hWnd)
140{
141 TCHAR templateText[MAX_STRING]; /* Flawfinder: ignore */
142 TCHAR header[MAX_STRING];
143 std::string final;
144 GetWindowText(hWnd, templateText, sizeof(templateText));
145 final = llformat(ll_convert_wide_to_string(templateText).c_str(), gProductName.c_str());
146 ConvertLPCSTRToLPWSTR(final.c_str(), header);
147 SetWindowText(hWnd, header);
148}
149
150
151// Include product name in the diaog item text.
152void LLCrashLoggerWindows::ProcessDlgItemText(HWND hWnd, int nIDDlgItem)
153{
154 TCHAR templateText[MAX_STRING]; /* Flawfinder: ignore */
155 TCHAR header[MAX_STRING];
156 std::string final;
157 GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText));
158 final = llformat(ll_convert_wide_to_string(templateText).c_str(), gProductName.c_str());
159 ConvertLPCSTRToLPWSTR(final.c_str(), header);
160 SetDlgItemText(hWnd, nIDDlgItem, header);
161}
162
163bool handle_button_click(WORD button_id)
164{
165 // Is this something other than Send or Don't Send?
166 if (button_id != IDOK
167 && button_id != IDCANCEL)
168 {
169 return false;
170 }
171
172 // See if "do this next time" is checked and save state
173 S32 crash_behavior = CRASH_BEHAVIOR_ASK;
174 LRESULT result = SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_GETCHECK, 0, 0);
175 if (result == BST_CHECKED)
176 {
177 if (button_id == IDOK)
178 {
179 crash_behavior = CRASH_BEHAVIOR_ALWAYS_SEND;
180 }
181 else if (button_id == IDCANCEL)
182 {
183 crash_behavior = CRASH_BEHAVIOR_NEVER_SEND;
184 }
185 ((LLCrashLoggerWindows*)LLCrashLogger::instance())->saveCrashBehaviorSetting(crash_behavior);
186 }
187
188 // We're done with this dialog.
189 gFirstDialog = FALSE;
190
191 // Send the crash report if requested
192 if (button_id == IDOK)
193 {
194 gSendLogs = TRUE;
195 WCHAR wbuffer[20000];
196 GetDlgItemText(gHwndReport, // handle to dialog box
197 IDC_EDIT1, // control identifier
198 wbuffer, // pointer to buffer for text
199 20000 // maximum size of string
200 );
201 LLString user_text(ll_convert_wide_to_string(wbuffer));
202 // Activate and show the window.
203 ShowWindow(gHwndProgress, SW_SHOW);
204 // Try doing this second to make the progress window go frontmost.
205 ShowWindow(gHwndReport, SW_HIDE);
206 ((LLCrashLoggerWindows*)LLCrashLogger::instance())->setUserText(user_text);
207 ((LLCrashLoggerWindows*)LLCrashLogger::instance())->sendCrashLogs();
208 }
209 // Quit the app
210 LLApp::setQuitting();
211 return true;
212}
213
214
215LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
216{
217 switch( message )
218 {
219 case WM_CREATE:
220 return 0;
221
222 case WM_COMMAND:
223 if( gFirstDialog )
224 {
225 WORD button_id = LOWORD(wParam);
226 bool handled = handle_button_click(button_id);
227 if (handled)
228 {
229 return 0;
230 }
231 }
232 break;
233
234 case WM_DESTROY:
235 // Closing the window cancels
236 LLApp::setQuitting();
237 PostQuitMessage(0);
238 return 0;
239 }
240
241 return DefWindowProc(hwnd, message, wParam, lParam);
242}
243
244
245LLCrashLoggerWindows::LLCrashLoggerWindows(void)
246{
247}
248
249LLCrashLoggerWindows::~LLCrashLoggerWindows(void)
250{
251}
252
253bool LLCrashLoggerWindows::init(void)
254{
255 bool ok = LLCrashLogger::init();
256 if(!ok) return false;
257
258 /*
259 mbstowcs(gProductName, mProductName.c_str(), sizeof(gProductName)/sizeof(gProductName[0]));
260 gProductName[ sizeof(gProductName)/sizeof(gProductName[0]) - 1 ] = 0;
261 swprintf(gProductName, L"Second Life");
262 */
263
264 llinfos << "Loading dialogs" << llendl;
265
266 // Initialize global strings
267 LoadString(mhInst, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
268 LoadString(mhInst, IDC_WIN_CRASH_LOGGER, szWindowClass, MAX_LOADSTRING);
269
270 gCursorArrow = LoadCursor(NULL, IDC_ARROW);
271 gCursorWait = LoadCursor(NULL, IDC_WAIT);
272
273 // Register a window class that will be used by our dialogs
274 WNDCLASS wndclass;
275 wndclass.style = CS_HREDRAW | CS_VREDRAW;
276 wndclass.lpfnWndProc = WndProc;
277 wndclass.cbClsExtra = 0;
278 wndclass.cbWndExtra = DLGWINDOWEXTRA; // Required, since this is used for dialogs!
279 wndclass.hInstance = mhInst;
280 wndclass.hIcon = LoadIcon(hInst, MAKEINTRESOURCE( IDI_WIN_CRASH_LOGGER ) );
281 wndclass.hCursor = gCursorArrow;
282 wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
283 wndclass.lpszMenuName = NULL;
284 wndclass.lpszClassName = szWindowClass;
285 RegisterClass( &wndclass );
286
287 return true;
288}
289
290void LLCrashLoggerWindows::gatherPlatformSpecificFiles()
291{
292 updateApplication("Gathering hardware information. App may appear frozen.");
293 // DX hardware probe blocks, so we can't cancel during it
294 //Generate our dx_info.log file
295 SetCursor(gCursorWait);
296 // At this point we're responsive enough the user could click the close button
297 SetCursor(gCursorArrow);
298 mDebugLog["DisplayDeviceInfo"] = gDXHardware.getDisplayInfo();
299 mFileMap["CrashLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLifeException.log");
300}
301
302bool LLCrashLoggerWindows::mainLoop()
303{
304
305 // Note: parent hwnd is 0 (the desktop). No dlg proc. See Petzold (5th ed) HexCalc example, Chapter 11, p529
306 // win_crash_logger.rc has been edited by hand.
307 // Dialogs defined with CLASS "WIN_CRASH_LOGGER" (must be same as szWindowClass)
308 gProductName = mProductName;
309
310 gHwndProgress = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PROGRESS), 0, NULL);
311 ProcessCaption(gHwndProgress);
312 ShowWindow(gHwndProgress, SW_HIDE );
313
314 if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
315 {
316 ShowWindow(gHwndProgress, SW_SHOW );
317 sendCrashLogs();
318 }
319 else if (mCrashBehavior == CRASH_BEHAVIOR_ASK)
320 {
321 gHwndReport = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PREVREPORTBOX), 0, NULL);
322
323 // Include the product name in the caption and various dialog items.
324 ProcessCaption(gHwndReport);
325 ProcessDlgItemText(gHwndReport, IDC_STATIC_MSG);
326
327 // Update the header to include whether or not we crashed on the last run.
328 std::string headerStr;
329 TCHAR header[MAX_STRING];
330 if (mCrashInPreviousExec)
331 {
332 headerStr = llformat("%s appears to have crashed or frozen the last time it ran.", mProductName.c_str());
333 }
334 else
335 {
336 headerStr = llformat("%s appears to have crashed.", mProductName.c_str());
337 }
338 ConvertLPCSTRToLPWSTR(headerStr.c_str(), header);
339 SetDlgItemText(gHwndReport, IDC_STATIC_HEADER, header);
340 ShowWindow(gHwndReport, SW_SHOW );
341
342 MSG msg;
343 while (!LLApp::isQuitting() && GetMessage(&msg, NULL, 0, 0))
344 {
345 TranslateMessage(&msg);
346 DispatchMessage(&msg);
347 }
348 return msg.wParam;
349 }
350 else
351 {
352 llwarns << "Unknown crash behavior " << mCrashBehavior << llendl;
353 return 1;
354 }
355 return 0;
356}
357
358void LLCrashLoggerWindows::updateApplication(LLString message)
359{
360 LLCrashLogger::updateApplication();
361 if(message != "") show_progress(message.c_str());
362 update_messages();
363}
364
365bool LLCrashLoggerWindows::cleanup()
366{
367 if(gSendLogs)
368 {
369 if(mSentCrashLogs) show_progress("Done");
370 else show_progress("Could not connect to servers, logs not sent");
371 sleep_and_pump_messages(3);
372 }
373 PostQuitMessage(0);
374 return true;
375}
376
377
378
diff --git a/linden/indra/win_crash_logger/llcrashloggerwindows.h b/linden/indra/win_crash_logger/llcrashloggerwindows.h
new file mode 100644
index 0000000..1f5a216
--- /dev/null
+++ b/linden/indra/win_crash_logger/llcrashloggerwindows.h
@@ -0,0 +1,59 @@
1/**
2* @file llcrashloggerwindows.h
3* @brief Windows crash logger definition
4*
5* $LicenseInfo:firstyear=2003&license=viewergpl$
6*
7* Copyright (c) 2003-2007, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlife.com/developers/opensource/gplv2
16*
17* There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at http://secondlife.com/developers/opensource/flossexception
21*
22* By copying, modifying or distributing this software, you acknowledge
23* that you have read and understood your obligations described above,
24* and agree to abide by those obligations.
25*
26* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28* COMPLETENESS OR PERFORMANCE.
29* $/LicenseInfo$
30*/
31
32#ifndef LLCRASHLOGGERWINDOWS_H
33#define LLCRASHLOGGERWINDOWS_H
34
35#include "linden_common.h"
36#include "llcrashlogger.h"
37#include "windows.h"
38#include "llstring.h"
39
40class LLCrashLoggerWindows : public LLCrashLogger
41{
42public:
43 LLCrashLoggerWindows(void);
44 ~LLCrashLoggerWindows(void);
45 virtual bool init();
46 virtual bool mainLoop();
47 virtual void updateApplication(LLString message = "");
48 virtual bool cleanup();
49 virtual void gatherPlatformSpecificFiles();
50 //void annotateCallStack();
51 void setHandle(HINSTANCE hInst) { mhInst = hInst; }
52private:
53 void ProcessDlgItemText(HWND hWnd, int nIDDlgItem);
54 void ProcessCaption(HWND hWnd);
55 HINSTANCE mhInst;
56
57};
58
59#endif
diff --git a/linden/indra/win_crash_logger/resource.h b/linden/indra/win_crash_logger/resource.h
index ee6bf3d..f1ef850 100644
--- a/linden/indra/win_crash_logger/resource.h
+++ b/linden/indra/win_crash_logger/resource.h
@@ -1,3 +1,34 @@
1/**
2* @file resource.h
3* @brief Windows crash logger windows resources
4*
5* $LicenseInfo:firstyear=2003&license=viewergpl$
6*
7* Copyright (c) 2003-2007, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlife.com/developers/opensource/gplv2
16*
17* There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at http://secondlife.com/developers/opensource/flossexception
21*
22* By copying, modifying or distributing this software, you acknowledge
23* that you have read and understood your obligations described above,
24* and agree to abide by those obligations.
25*
26* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28* COMPLETENESS OR PERFORMANCE.
29* $/LicenseInfo$
30*/
31
1//{{NO_DEPENDENCIES}} 32//{{NO_DEPENDENCIES}}
2// Microsoft Visual C++ generated include file. 33// Microsoft Visual C++ generated include file.
3// Used by win_crash_logger.rc 34// Used by win_crash_logger.rc
@@ -22,6 +53,7 @@
22#define IDC_STATIC_HEADER 1007 53#define IDC_STATIC_HEADER 1007
23#define IDC_STATIC_WHATINFO 1008 54#define IDC_STATIC_WHATINFO 1008
24#define IDC_STATIC_MOTIVATION 1009 55#define IDC_STATIC_MOTIVATION 1009
56#define IDC_STATIC_MSG 1010
25#define IDC_STATIC -1 57#define IDC_STATIC -1
26 58
27// Next default values for new objects 59// Next default values for new objects
@@ -30,7 +62,7 @@
30#ifndef APSTUDIO_READONLY_SYMBOLS 62#ifndef APSTUDIO_READONLY_SYMBOLS
31#define _APS_NEXT_RESOURCE_VALUE 131 63#define _APS_NEXT_RESOURCE_VALUE 131
32#define _APS_NEXT_COMMAND_VALUE 32771 64#define _APS_NEXT_COMMAND_VALUE 32771
33#define _APS_NEXT_CONTROL_VALUE 1010 65#define _APS_NEXT_CONTROL_VALUE 1011
34#define _APS_NEXT_SYMED_VALUE 110 66#define _APS_NEXT_SYMED_VALUE 110
35#endif 67#endif
36#endif 68#endif
diff --git a/linden/indra/win_crash_logger/win_crash_logger.cpp b/linden/indra/win_crash_logger/win_crash_logger.cpp
index 2669407..c6b4ff1 100644
--- a/linden/indra/win_crash_logger/win_crash_logger.cpp
+++ b/linden/indra/win_crash_logger/win_crash_logger.cpp
@@ -35,98 +35,22 @@
35// Must be first include, precompiled headers. 35// Must be first include, precompiled headers.
36#include "stdafx.h" 36#include "stdafx.h"
37 37
38#include "linden_common.h" 38#include <stdlib.h>
39#include "llcontrol.h"
40#include "resource.h"
41 39
42#include <direct.h> 40#include "llcrashloggerwindows.h"
43#include <sys/types.h>
44#include <sys/stat.h>
45#include <wininet.h>
46 41
47#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME
48#include "llerror.h"
49#include "lltimer.h"
50#include "lldir.h"
51 42
52#include "llstring.h"
53#include "lldxhardware.h"
54
55LLControlGroup gCrashSettings; // saved at end of session
56
57// Constants
58#define MAX_LOADSTRING 100
59const char* const SETTINGS_FILE_HEADER = "version";
60const S32 SETTINGS_FILE_VERSION = 101;
61
62// Functions
63LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
64bool handle_button_click(WORD button_id);
65S32 load_crash_behavior_setting();
66bool save_crash_behavior_setting(S32 crash_behavior);
67void send_crash_report();
68void write_debug(const char *str);
69void write_debug(std::string& str);
70
71// Global Variables:
72HINSTANCE hInst= NULL; // current instance
73TCHAR szTitle[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
74TCHAR szWindowClass[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
75
76LLString gUserText; // User's description of the problem
77time_t gStartTime = 0;
78HWND gHwndReport = NULL; // Send/Don't Send dialog
79HWND gHwndProgress = NULL; // Progress window
80HCURSOR gCursorArrow = NULL;
81HCURSOR gCursorWait = NULL;
82BOOL gFirstDialog = TRUE; // Are we currently handling the Send/Don't Send dialog?
83BOOL gCrashInPreviousExec = FALSE;
84FILE *gDebugFile = NULL;
85LLString gUserserver;
86WCHAR gProductName[512];
87 43
88// 44//
89// Implementation 45// Implementation
90// 46//
91 47
92// Include product name in the window caption.
93void ProcessCaption(HWND hWnd)
94{
95 TCHAR templateText[1024]; /* Flawfinder: ignore */
96 TCHAR finalText[2048]; /* Flawfinder: ignore */
97 GetWindowText(hWnd, templateText, sizeof(templateText));
98 swprintf(finalText, templateText, gProductName); /* Flawfinder: ignore */
99 SetWindowText(hWnd, finalText);
100}
101
102
103// Include product name in the diaog item text.
104void ProcessDlgItemText(HWND hWnd, int nIDDlgItem)
105{
106 TCHAR templateText[1024]; /* Flawfinder: ignore */
107 TCHAR finalText[2048]; /* Flawfinder: ignore */
108 GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText));
109 swprintf(finalText, templateText, gProductName); /* Flawfinder: ignore */
110 SetDlgItemText(hWnd, nIDDlgItem, finalText);
111}
112
113int APIENTRY WinMain(HINSTANCE hInstance, 48int APIENTRY WinMain(HINSTANCE hInstance,
114 HINSTANCE hPrevInstance, 49 HINSTANCE hPrevInstance,
115 LPSTR lpCmdLine, 50 LPSTR lpCmdLine,
116 int nCmdShow) 51 int nCmdShow)
117{ 52{
118 llinfos << "Starting crash reporter" << llendl; 53 llinfos << "Starting crash reporter" << llendl;
119 // We assume that all the logs we're looking for reside on the current drive
120 gDirUtilp->initAppDirs("SecondLife");
121
122 // Default to the product name "Second Life" (this is overridden by the -name argument)
123 swprintf(gProductName, L"Second Life"); /* Flawfinder: ignore */
124
125 gCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes "
126 "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)");
127
128 llinfos << "Loading crash behavior setting" << llendl;
129 S32 crash_behavior = load_crash_behavior_setting();
130 54
131 // In Win32, we need to generate argc and argv ourselves... 55 // In Win32, we need to generate argc and argv ourselves...
132 // Note: GetCommandLine() returns a potentially return a LPTSTR 56 // Note: GetCommandLine() returns a potentially return a LPTSTR
@@ -139,7 +63,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
139 63
140 const S32 MAX_ARGS = 100; 64 const S32 MAX_ARGS = 100;
141 int argc = 0; 65 int argc = 0;
142 char *argv[MAX_ARGS]; /* Flawfinder: ignore */ 66 char *argv[MAX_ARGS];
143 67
144 char *token = NULL; 68 char *token = NULL;
145 if( cmd_line_including_exe_name[0] == '\"' ) 69 if( cmd_line_including_exe_name[0] == '\"' )
@@ -159,7 +83,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
159 { 83 {
160 argv[argc++] = token; 84 argv[argc++] = token;
161 /* Get next token: */ 85 /* Get next token: */
162 if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */ 86 if (*(token + strlen(token) + 1) == '\"')
163 { 87 {
164 token = strtok( NULL, "\""); 88 token = strtok( NULL, "\"");
165 } 89 }
@@ -169,784 +93,32 @@ int APIENTRY WinMain(HINSTANCE hInstance,
169 } 93 }
170 } 94 }
171 95
172 S32 i; 96 LLCrashLoggerWindows app;
173 for (i=0; i<argc; i++) 97 bool ok = app.parseCommandOptions(argc, argv);
174 { 98 if(!ok)
175 if(!strcmp(argv[i], "-previous"))
176 {
177 llinfos << "Previous execution did not remove SecondLife.exec_marker" << llendl;
178 gCrashInPreviousExec = TRUE;
179 }
180
181 if(!strcmp(argv[i], "-dialog"))
182 {
183 llinfos << "Show the user dialog" << llendl;
184 crash_behavior = CRASH_BEHAVIOR_ASK;
185 }
186
187 if(!strcmp(argv[i], "-user"))
188 {
189 if ((i + 1) < argc)
190 {
191 i++;
192 gUserserver = argv[i];
193 llinfos << "Got userserver " << gUserserver << llendl;
194 }
195 }
196
197 if(!strcmp(argv[i], "-name"))
198 {
199 if ((i + 1) < argc)
200 {
201 i++;
202
203 mbstowcs(gProductName, argv[i], sizeof(gProductName)/sizeof(gProductName[0]));
204 gProductName[ sizeof(gProductName)/sizeof(gProductName[0]) - 1 ] = 0;
205 llinfos << "Got product name " << argv[i] << llendl;
206 }
207 }
208 }
209
210 // If user doesn't want to send, bail out
211 if (crash_behavior == CRASH_BEHAVIOR_NEVER_SEND)
212 {
213 llinfos << "Crash behavior is never_send, quitting" << llendl;
214 return 0;
215 }
216
217 // Get the current time
218 time(&gStartTime);
219
220 llinfos << "Loading dialogs" << llendl;
221
222 // Store instance handle in our global variable
223 hInst = hInstance;
224
225 // Initialize global strings
226 LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
227 LoadString(hInstance, IDC_WIN_CRASH_LOGGER, szWindowClass, MAX_LOADSTRING);
228
229 gCursorArrow = LoadCursor(NULL, IDC_ARROW);
230 gCursorWait = LoadCursor(NULL, IDC_WAIT);
231
232 // Register a window class that will be used by our dialogs
233 WNDCLASS wndclass;
234 wndclass.style = CS_HREDRAW | CS_VREDRAW;
235 wndclass.lpfnWndProc = WndProc;
236 wndclass.cbClsExtra = 0;
237 wndclass.cbWndExtra = DLGWINDOWEXTRA; // Required, since this is used for dialogs!
238 wndclass.hInstance = hInst;
239 wndclass.hIcon = LoadIcon(hInst, MAKEINTRESOURCE( IDI_WIN_CRASH_LOGGER ) );
240 wndclass.hCursor = gCursorArrow;
241 wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
242 wndclass.lpszMenuName = NULL;
243 wndclass.lpszClassName = szWindowClass;
244 RegisterClass( &wndclass );
245
246 // Note: parent hwnd is 0 (the desktop). No dlg proc. See Petzold (5th ed) HexCalc example, Chapter 11, p529
247 // win_crash_logger.rc has been edited by hand.
248 // Dialogs defined with CLASS "WIN_CRASH_LOGGER" (must be same as szWindowClass)
249
250 gHwndProgress = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PROGRESS), 0, NULL);
251 ProcessCaption(gHwndProgress);
252 ShowWindow(gHwndProgress, SW_HIDE );
253
254 if (crash_behavior == CRASH_BEHAVIOR_ALWAYS_SEND)
255 {
256 ShowWindow(gHwndProgress, SW_SHOW );
257 send_crash_report();
258 return 0;
259 }
260
261 if (crash_behavior == CRASH_BEHAVIOR_ASK)
262 {
263 gHwndReport = CreateDialog(hInst, MAKEINTRESOURCE(IDD_REPORT), 0, NULL);
264
265 // Include the product name in the caption and various dialog items.
266 ProcessCaption(gHwndReport);
267 ProcessDlgItemText(gHwndReport, IDC_STATIC_WHATINFO);
268 ProcessDlgItemText(gHwndReport, IDC_STATIC_MOTIVATION);
269
270 // Update the header to include whether or not we crashed on the last run.
271 WCHAR header[2048];
272 if (gCrashInPreviousExec)
273 {
274 swprintf(header, L"%s appears to have crashed or frozen the last time it ran.", gProductName); /* Flawfinder: ignore */
275 }
276 else
277 {
278 swprintf(header, L"%s appears to have crashed.", gProductName); /* Flawfinder: ignore */
279 }
280 SetDlgItemText(gHwndReport, IDC_STATIC_HEADER, header);
281 ShowWindow(gHwndReport, SW_SHOW );
282
283 MSG msg;
284 while (GetMessage(&msg, NULL, 0, 0))
285 {
286 TranslateMessage(&msg);
287 DispatchMessage(&msg);
288 }
289 return msg.wParam;
290 }
291 else
292 {
293 llwarns << "Unknown crash behavior " << crash_behavior << llendl;
294 return 1;
295 }
296}
297
298
299LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
300{
301 switch( message )
302 {
303 case WM_CREATE:
304 return 0;
305
306 case WM_COMMAND:
307 if( gFirstDialog )
308 {
309 WORD button_id = LOWORD(wParam);
310 bool handled = handle_button_click(button_id);
311 if (handled)
312 {
313 return 0;
314 }
315 }
316 break;
317
318 case WM_DESTROY:
319 // Closing the window cancels
320 PostQuitMessage(0);
321 return 0;
322 }
323
324 return DefWindowProc(hwnd, message, wParam, lParam);
325}
326
327
328bool handle_button_click(WORD button_id)
329{
330 // Is this something other than Send or Don't Send?
331 if (button_id != IDOK
332 && button_id != IDCANCEL)
333 {
334 return false;
335 }
336
337 // See if "do this next time" is checked and save state
338 S32 crash_behavior = CRASH_BEHAVIOR_ASK;
339 LRESULT result = SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_GETCHECK, 0, 0);
340 if (result == BST_CHECKED)
341 {
342 if (button_id == IDOK)
343 {
344 crash_behavior = CRASH_BEHAVIOR_ALWAYS_SEND;
345 }
346 else if (button_id == IDCANCEL)
347 {
348 crash_behavior = CRASH_BEHAVIOR_NEVER_SEND;
349 }
350 }
351 bool success = save_crash_behavior_setting(crash_behavior);
352 if (!success)
353 {
354 llwarns << "Failed to save crash settings" << llendl;
355 }
356
357 // We're done with this dialog.
358 gFirstDialog = FALSE;
359
360 // Send the crash report if requested
361 if (button_id == IDOK)
362 {
363 // Don't let users type anything. They believe the reports
364 // get read by humans, and get angry when we don't respond. JC
365 //WCHAR wbuffer[20000];
366 //GetDlgItemText(gHwndReport, // handle to dialog box
367 // IDC_EDIT1, // control identifier
368 // wbuffer, // pointer to buffer for text
369 // 20000 // maximum size of string
370 // );
371 //gUserText = wstring_to_utf8str(utf16str_to_wstring(wbuffer)).c_str();
372 //llinfos << gUserText << llendl;
373
374 // Activate and show the window.
375 ShowWindow(gHwndProgress, SW_SHOW);
376 // Try doing this second to make the progress window go frontmost.
377 ShowWindow(gHwndReport, SW_HIDE);
378
379 send_crash_report();
380 }
381
382 // Quit the app
383 PostQuitMessage(0);
384
385 return true;
386}
387
388
389class LLFileEncoder
390{
391public:
392 LLFileEncoder(const char *formname, const char *filename);
393 ~LLFileEncoder();
394
395 BOOL isValid() const { return mIsValid; }
396 LLString encodeURL(const S32 max_length = 0);
397public:
398 BOOL mIsValid;
399 LLString mFilename;
400 LLString mFormname;
401 S32 mBufLength;
402 U8 *mBuf;
403};
404
405LLString encode_string(const char *formname, const LLString &str);
406
407void update_messages()
408{
409 MSG msg;
410 while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
411 {
412 if (msg.message == WM_QUIT)
413 {
414 exit(0);
415 }
416 TranslateMessage(&msg);
417 DispatchMessage(&msg);
418 }
419}
420
421void sleep_and_pump_messages( U32 seconds )
422{
423 const U32 CYCLES_PER_SECOND = 10;
424 U32 cycles = seconds * CYCLES_PER_SECOND;
425 while( cycles-- )
426 { 99 {
427 update_messages(); 100 llwarns << "Unable to parse command line." << llendl;
428 ms_sleep(1000 / CYCLES_PER_SECOND);
429 }
430}
431
432
433void show_progress(const char* message)
434{
435 std::wstring msg = wstring_to_utf16str(utf8str_to_wstring(message));
436 if (gHwndProgress)
437 {
438 SendDlgItemMessage(gHwndProgress, // handle to destination window
439 IDC_LOG,
440 WM_SETTEXT, // message to send
441 FALSE, // undo option
442 (LPARAM)msg.c_str());
443 }
444}
445
446
447void send_crash_report()
448{
449 update_messages();
450 show_progress("Starting up...");
451 update_messages();
452
453 const S32 SL_MAX_SIZE = 100000; // Maximum size of the Second Life log file.
454
455 update_messages();
456
457 // Lots of silly variable, replicated for each log file.
458 std::string db_file_name; // debug.log
459 std::string sl_file_name; // SecondLife.log
460 std::string md_file_name; // minidump (SecondLife.dmp) file name
461 std::string st_file_name; // stats.log file
462 std::string si_file_name; // settings.ini file
463 std::string ml_file_name; // message.log file
464
465 LLFileEncoder *db_filep = NULL;
466 LLFileEncoder *sl_filep = NULL;
467 LLFileEncoder *st_filep = NULL;
468 LLFileEncoder *md_filep = NULL;
469 LLFileEncoder *si_filep = NULL;
470 LLFileEncoder *ml_filep = NULL;
471
472 // DX hardware probe blocks, so we can't cancel during it
473 SetCursor(gCursorWait);
474
475 // Need to do hardware detection before we grab the files, otherwise we don't send the debug log updates
476 // to the server (including the list of hardware).
477 update_messages();
478 show_progress("Detecting hardware, please wait...");
479 update_messages();
480 gDXHardware.setWriteDebugFunc(write_debug);
481 gDXHardware.getInfo(FALSE);
482 update_messages();
483 gDXHardware.dumpDevices();
484 update_messages();
485 fclose(gDebugFile);
486 gDebugFile = NULL;
487
488 // At this point we're responsive enough the user could click the close button
489 SetCursor(gCursorArrow);
490
491 ///////////////////////////////////
492 //
493 // We do the parsing for the debug_info file first, as that will
494 // give us the location of the SecondLife.log file.
495 //
496
497 // Figure out the filename of the debug log
498 db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log");
499 db_filep = new LLFileEncoder("DB", db_file_name.c_str());
500
501 // Get the filename of the SecondLife.log file
502 // *NOTE: This buffer size is hard coded into scanf() below.
503 char tmp_sl_name[256]; /* Flawfinder: ignore */
504 tmp_sl_name[0] = '\0';
505
506 update_messages();
507 show_progress("Looking for files...");
508 update_messages();
509
510 // Look for it in the debug_info.log file
511 if (db_filep->isValid())
512 {
513 sscanf(
514 (const char*)db_filep->mBuf,
515 "SL Log: %255[^\r\n]",
516 tmp_sl_name);
517 }
518 else
519 {
520 delete db_filep;
521 db_filep = NULL;
522 }
523
524 if (gCrashInPreviousExec)
525 {
526 // If we froze, the crash log this time around isn't useful. Use the
527 // old one.
528 sl_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.old");
529 }
530 else if (tmp_sl_name[0])
531 {
532 // If debug_info.log gives us a valid log filename, use that.
533 sl_file_name = tmp_sl_name;
534 llinfos << "Using log file from debug log " << sl_file_name << llendl;
535 }
536 else
537 {
538 // Figure out the filename of the default second life log
539 sl_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.log");
540 }
541
542 // Now we get the SecondLife.log file if it's there
543 sl_filep = new LLFileEncoder("SL", sl_file_name.c_str());
544 if (!sl_filep->isValid())
545 {
546 delete sl_filep;
547 sl_filep = NULL;
548 }
549
550 update_messages();
551 show_progress("Looking for stats file...");
552 update_messages();
553
554 st_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stats.log");
555 st_filep = new LLFileEncoder("ST", st_file_name.c_str());
556 if (!st_filep->isValid())
557 {
558 delete st_filep;
559 st_filep = NULL;
560 }
561
562 si_file_name = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.ini");
563 si_filep = new LLFileEncoder("SI", si_file_name.c_str());
564 if (!si_filep->isValid())
565 {
566 delete si_filep;
567 si_filep = NULL;
568 }
569
570 // Now we get the minidump
571 md_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.dmp");
572 md_filep = new LLFileEncoder("MD", md_file_name.c_str());
573 if (!md_filep->isValid())
574 {
575 delete md_filep;
576 md_filep = NULL;
577 }
578
579 // Now we get the message log
580 ml_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"message.log");
581 ml_filep = new LLFileEncoder("ML", ml_file_name.c_str());
582 if (!ml_filep->isValid())
583 {
584 delete ml_filep;
585 ml_filep = NULL;
586 }
587
588 LLString post_data;
589 LLString tmp_url_buf;
590
591 // Append the userserver
592 tmp_url_buf = encode_string("USER", gUserserver);
593 post_data += tmp_url_buf;
594 llinfos << "PostData:" << post_data << llendl;
595
596 if (gCrashInPreviousExec)
597 {
598 post_data.append(1, '&');
599 tmp_url_buf = encode_string("EF", "Y");
600 post_data += tmp_url_buf;
601 }
602
603 update_messages();
604 show_progress("Encoding data");
605 update_messages();
606 if (db_filep)
607 {
608 post_data.append(1, '&');
609 tmp_url_buf = db_filep->encodeURL();
610 post_data += tmp_url_buf;
611 llinfos << "Sending DB log file" << llendl;
612 }
613 else
614 {
615 llinfos << "Not sending DB log file" << llendl;
616 }
617 show_progress("Encoding data.");
618 update_messages();
619
620 if (sl_filep)
621 {
622 post_data.append(1, '&');
623 tmp_url_buf = sl_filep->encodeURL(SL_MAX_SIZE);
624 post_data += tmp_url_buf;
625 llinfos << "Sending SL log file" << llendl;
626 }
627 else
628 {
629 llinfos << "Not sending SL log file" << llendl;
630 }
631 show_progress("Encoding data..");
632 update_messages();
633
634 if (st_filep)
635 {
636 post_data.append(1, '&');
637 tmp_url_buf = st_filep->encodeURL(SL_MAX_SIZE);
638 post_data += tmp_url_buf;
639 llinfos << "Sending stats log file" << llendl;
640 }
641 else
642 {
643 llinfos << "Not sending stats log file" << llendl;
644 }
645 show_progress("Encoding data...");
646 update_messages();
647
648 if (md_filep)
649 {
650 post_data.append(1, '&');
651 tmp_url_buf = md_filep->encodeURL();
652 post_data += tmp_url_buf;
653 llinfos << "Sending minidump log file" << llendl;
654 }
655 else
656 {
657 llinfos << "Not sending minidump log file" << llendl;
658 }
659 show_progress("Encoding data....");
660 update_messages();
661
662 if (si_filep)
663 {
664 post_data.append(1, '&');
665 tmp_url_buf = si_filep->encodeURL();
666 post_data += tmp_url_buf;
667 llinfos << "Sending settings log file" << llendl;
668 }
669 else
670 {
671 llinfos << "Not sending settings.ini file" << llendl;
672 }
673 show_progress("Encoding data....");
674 update_messages();
675
676 if (ml_filep)
677 {
678 post_data.append(1, '&');
679 tmp_url_buf = ml_filep->encodeURL(SL_MAX_SIZE);
680 post_data += tmp_url_buf;
681 llinfos << "Sending message log file" << llendl;
682 }
683 else
684 {
685 llinfos << "Not sending message.log file" << llendl;
686 }
687 show_progress("Encoding data....");
688 update_messages();
689
690 if (gUserText.size())
691 {
692 post_data.append(1, '&');
693 tmp_url_buf = encode_string("UN", gUserText);
694 post_data += tmp_url_buf;
695 }
696
697 delete db_filep;
698 db_filep = NULL;
699 delete sl_filep;
700 sl_filep = NULL;
701 delete md_filep;
702 md_filep = NULL;
703
704 // Post data to web server
705 const S32 BUFSIZE = 65536;
706 HINTERNET hinet, hsession, hrequest;
707 char data[BUFSIZE]; /* Flawfinder: ignore */
708 unsigned long bytes_read;
709
710 llinfos << "Connecting to crash report server" << llendl;
711 update_messages();
712 show_progress("Connecting to server...");
713 update_messages();
714
715 // Init wininet subsystem
716 hinet = InternetOpen(L"LindenCrashReporter", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
717 if (hinet == NULL)
718 {
719 llinfos << "Couldn't open connection" << llendl;
720 sleep_and_pump_messages( 5 );
721// return FALSE;
722 }
723
724 hsession = InternetConnect(hinet,
725 L"secondlife.com",
726 INTERNET_DEFAULT_HTTP_PORT,
727 NULL,
728 NULL,
729 INTERNET_SERVICE_HTTP,
730 NULL,
731 NULL);
732
733 if (!hsession)
734 {
735 llinfos << "Couldn't talk to crash report server" << llendl;
736 }
737
738 hrequest = HttpOpenRequest(hsession, L"POST", L"/cgi-bin/viewer_crash_reporter2", NULL, L"", NULL, 0, 0);
739 if (!hrequest)
740 {
741 llinfos << "Couldn't open crash report URL!" << llendl;
742 } 101 }
743 102
744 llinfos << "Transmitting data" << llendl; 103 app.setHandle(hInstance);
745 llinfos << "Bytes: " << (post_data.size()) << llendl; 104 ok = app.init();
746 105 if(!ok)
747 update_messages();
748 show_progress("Transmitting data...");
749 update_messages();
750
751 BOOL ok = HttpSendRequest(hrequest, NULL, 0, (void *)(post_data.c_str()), post_data.size());
752 if (!ok)
753 {
754 llinfos << "Error posting data!" << llendl;
755 sleep_and_pump_messages( 5 );
756 }
757
758 llinfos << "Response from crash report server:" << llendl;
759 do
760 {
761 if (InternetReadFile(hrequest, data, BUFSIZE, &bytes_read))
762 {
763 if (bytes_read == 0)
764 {
765 // If InternetFileRead returns TRUE AND bytes_read == 0
766 // we've successfully downloaded the entire file
767 break;
768 }
769 else
770 {
771 data[bytes_read] = 0;
772 llinfos << data << llendl;
773 }
774 }
775 else
776 {
777 llinfos << "Couldn't read file!" << llendl;
778 sleep_and_pump_messages( 5 );
779// return FALSE;
780 }
781 } while(TRUE);
782
783 InternetCloseHandle(hrequest);
784 InternetCloseHandle(hsession);
785 InternetCloseHandle(hinet);
786 update_messages();
787 show_progress("Done.");
788 sleep_and_pump_messages( 3 );
789// return TRUE;
790}
791
792LLFileEncoder::LLFileEncoder(const char *form_name, const char *filename)
793{
794 mFormname = form_name;
795 mFilename = filename;
796 mIsValid = FALSE;
797 mBuf = NULL;
798
799 int res;
800
801 llstat stat_data;
802 res = LLFile::stat(mFilename.c_str(), &stat_data);
803 if (res)
804 {
805 llwarns << "File " << mFilename << " is missing!" << llendl;
806 return;
807 }
808
809 FILE *fp = NULL;
810 S32 buf_size = 0;
811 S32 count = 0;
812 while (count < 5)
813 {
814 buf_size = stat_data.st_size;
815 fp = LLFile::fopen(mFilename.c_str(), "rb"); /* Flawfinder: ignore */
816 if (!fp)
817 {
818 llwarns << "Can't open file " << mFilename << ", wait for a second" << llendl;
819 // Couldn't open the file, wait a bit and try again
820 count++;
821 ms_sleep(1000);
822 }
823 else
824 {
825 break;
826 }
827 }
828 if (!fp)
829 {
830 return;
831 }
832 U8 *buf = new U8[buf_size + 1];
833 fread(buf, 1, buf_size, fp);
834 fclose(fp);
835
836 mBuf = buf;
837 mBufLength = buf_size;
838
839 mIsValid = TRUE;
840}
841
842LLFileEncoder::~LLFileEncoder()
843{
844 if (mBuf)
845 {
846 delete mBuf;
847 mBuf = NULL;
848 }
849}
850
851LLString LLFileEncoder::encodeURL(const S32 max_length)
852{
853 LLString result = mFormname;
854 result.append(1, '=');
855
856 S32 i = 0;
857
858 if (max_length)
859 {
860 if (mBufLength > max_length)
861 {
862 i = mBufLength - max_length;
863 }
864 }
865
866 S32 url_buf_size = 3*mBufLength + 1;
867 char *url_buf = new char[url_buf_size];
868
869 S32 cur_pos = 0;
870 for (; i < mBufLength; i++)
871 { 106 {
872 S32 byte_val = mBuf[i]; 107 llwarns << "Unable to initialize application." << llendl;
873 sprintf(url_buf + cur_pos, "%%%02x", byte_val); 108 return -1;
874 cur_pos += 3;
875 } 109 }
876 url_buf[i*3] = 0;
877 110
878 result.append(url_buf); 111 // Run the application main loop
879 delete[] url_buf; 112 if(!LLApp::isQuitting()) app.mainLoop();
880 return result;
881}
882
883LLString encode_string(const char *formname, const LLString &str)
884{
885 LLString result = formname;
886 result.append(1, '=');
887 // Not using LLString because of bad performance issues
888 S32 buf_size = str.size();
889 S32 url_buf_size = 3*str.size() + 1;
890 char *url_buf = new char[url_buf_size];
891 113
892 S32 cur_pos = 0; 114 if (!app.isError())
893 S32 i;
894 for (i = 0; i < buf_size; i++)
895 { 115 {
896 sprintf(url_buf + cur_pos, "%%%02x", str[i]); 116 //
897 cur_pos += 3; 117 // We don't want to do cleanup here if the error handler got called -
118 // the assumption is that the error handler is responsible for doing
119 // app cleanup if there was a problem.
120 //
121 app.cleanup();
898 } 122 }
899 url_buf[i*3] = 0; 123 return 0;
900
901 result.append(url_buf);
902 delete[] url_buf;
903 return result;
904}
905
906void write_debug(const char *str)
907{
908 if (!gDebugFile)
909 {
910 std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log");
911 llinfos << "Opening debug file " << debug_filename << llendl;
912 gDebugFile = LLFile::fopen(debug_filename.c_str(), "a+"); /* Flawfinder: ignore */
913 if (!gDebugFile)
914 {
915 fprintf(stderr, "Couldn't open %s: debug log to stderr instead.\n", debug_filename.c_str());
916 gDebugFile = stderr;
917 }
918 }
919 fprintf(gDebugFile, str); /* Flawfinder: ignore */
920 fflush(gDebugFile);
921}
922
923void write_debug(std::string& str)
924{
925 write_debug(str.c_str());
926}
927
928S32 load_crash_behavior_setting()
929{
930 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE);
931
932 gCrashSettings.loadFromFile(filename);
933
934 S32 value = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING);
935
936 if (value < CRASH_BEHAVIOR_ASK || CRASH_BEHAVIOR_NEVER_SEND < value) return CRASH_BEHAVIOR_ASK;
937
938 return value;
939}
940
941bool save_crash_behavior_setting(S32 crash_behavior)
942{
943 if (crash_behavior < CRASH_BEHAVIOR_ASK) return false;
944 if (crash_behavior > CRASH_BEHAVIOR_NEVER_SEND) return false;
945
946 gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior);
947 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE);
948
949 gCrashSettings.saveToFile(filename, FALSE);
950
951 return true;
952} 124}
diff --git a/linden/indra/win_crash_logger/win_crash_logger.rc b/linden/indra/win_crash_logger/win_crash_logger.rc
index 2c46859..2819722 100644
--- a/linden/indra/win_crash_logger/win_crash_logger.rc
+++ b/linden/indra/win_crash_logger/win_crash_logger.rc
@@ -56,13 +56,13 @@ END
56// Dialog 56// Dialog
57// 57//
58 58
59IDD_PROGRESS DIALOG 100, 100, 186, 33 59IDD_PROGRESS DIALOGEX 100, 100, 234, 33
60STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CAPTION | WS_SYSMENU 60STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CAPTION | WS_SYSMENU
61CAPTION "%s Crash Logger" 61CAPTION "%s Crash Logger"
62CLASS "WIN_CRASH_LOGGER" 62CLASS "WIN_CRASH_LOGGER"
63FONT 8, "MS Sans Serif" 63FONT 8, "MS Sans Serif", 0, 0, 0x0
64BEGIN 64BEGIN
65 LTEXT "Static",IDC_LOG,7,7,172,8 65 LTEXT "Static",IDC_LOG,7,7,220,8
66END 66END
67 67
68IDD_REPORT DIALOGEX 100, 100, 297, 125 68IDD_REPORT DIALOGEX 100, 100, 297, 125
@@ -73,48 +73,33 @@ FONT 8, "MS Sans Serif", 0, 0, 0x0
73BEGIN 73BEGIN
74 DEFPUSHBUTTON "Send",IDOK,198,104,45,15,WS_GROUP 74 DEFPUSHBUTTON "Send",IDOK,198,104,45,15,WS_GROUP
75 PUSHBUTTON "Don't Send",IDCANCEL,247,104,45,15,WS_GROUP 75 PUSHBUTTON "Don't Send",IDCANCEL,247,104,45,15,WS_GROUP
76 LTEXT "%s appears to have crashed.",IDC_STATIC_HEADER,4,4,288, 76 LTEXT "%s appears to have crashed.",IDC_STATIC_HEADER,4,4,288,14
77 14 77 LTEXT "This crash reporter collects information about your computer's hardware, operating system, and some %s logs, which are used for debugging purposes only.",IDC_STATIC_WHATINFO,4,23,288,19,NOT WS_GROUP
78 LTEXT "This crash reporter collects information about your computer's hardware, operating system, and some %s logs, which are used for debugging purposes only.", 78 CONTROL "Remember this choice",IDC_CHECK_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,106,89,13
79 IDC_STATIC_WHATINFO,4,23,288,19,NOT WS_GROUP 79 LTEXT "Sending crash reports is the best way to help us improve the quality of %s.",IDC_STATIC_MOTIVATION,4,43,288,8
80 CONTROL "Remember this choice",IDC_CHECK_AUTO,"Button", 80 LTEXT "If you continue to experience this problem, please try:",IDC_STATIC,4,57,251,8
81 BS_AUTOCHECKBOX | WS_TABSTOP,4,106,89,13 81 LTEXT "- Contacting support by visiting http://www.secondlife.com/support",IDC_STATIC,4,67,231,8
82 LTEXT "Sending crash reports is the best way to help us improve the quality of %s.",
83 IDC_STATIC_MOTIVATION,4,38,288,8
84 LTEXT "If you continue to experience this problem, please try:",
85 IDC_STATIC,4,57,251,8
86 LTEXT "- Contacting support by visiting http://www.secondlife.com/support",
87 IDC_STATIC,4,67,231,8
88END 82END
89 83
90IDD_PREVREPORTBOX DIALOG 100, 100, 232, 213 84IDD_PREVREPORTBOX DIALOGEX 100, 100, 232, 213
91STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CAPTION | WS_SYSMENU 85STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CAPTION | WS_SYSMENU
92CAPTION "%s Crash Logger" 86CAPTION "%s Crash Logger"
93CLASS "WIN_CRASH_LOGGER" 87CLASS "WIN_CRASH_LOGGER"
94FONT 8, "MS Sans Serif" 88FONT 8, "MS Sans Serif", 0, 0, 0x0
95BEGIN 89BEGIN
96 DEFPUSHBUTTON "OK",IDOK,131,193,45,15,WS_GROUP 90 DEFPUSHBUTTON "Send Report",IDOK,131,193,45,15,WS_GROUP
97 EDITTEXT IDC_EDIT1,4,102,223,89,ES_MULTILINE | ES_WANTRETURN | 91 EDITTEXT IDC_EDIT1,3,100,223,89,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL
98 WS_VSCROLL 92 PUSHBUTTON "Don't Send",IDCANCEL,181,193,45,15,WS_GROUP
99 PUSHBUTTON "Cancel",IDCANCEL,181,193,45,15,WS_GROUP 93 LTEXT "%s appears to have crashed or frozen the last time it ran.",IDC_STATIC_HEADER,4,4,214,8
100 LTEXT "%s appears to have crashed or frozen the last time it ran.", 94 LTEXT "This crash reporter collects information about your computer's",IDC_STATIC,4,17,201,8
101 IDC_STATIC,4,4,214,8 95 LTEXT "hardware configuration, operating system, and some %s",IDC_STATIC_MSG,4,25,212,8
102 LTEXT "This crash reporter collects information about your computer's", 96 LTEXT "logs, all of which are used for debugging purposes only.",IDC_STATIC,4,33,210,8
103 IDC_STATIC,4,17,201,8 97 LTEXT "In the space below, please briefly describe what you were doing",IDC_STATIC,3,48,208,8
104 LTEXT "hardware configuration, operating system, and some %s", 98 LTEXT "or trying to do just prior to the crash.",IDC_STATIC,3,56,204,8
105 IDC_STATIC,4,25,212,8 99 LTEXT "If you don't wish to send Linden Lab a crash report, press Don't Send.",IDC_STATIC,3,90,223,8
106 LTEXT "logs, all of which are used for debugging purposes only.", 100 LTEXT "This report is NOT read by customer support. If you have billing or",IDC_STATIC,3,68,208,8
107 IDC_STATIC,4,33,210,8 101 LTEXT "other questions, please go to: www.secondlife.com/support",IDC_STATIC,3,76,206,8
108 LTEXT "In the space below, please briefly describe what you were doing", 102 CONTROL "Remember this choice",IDC_CHECK_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,193,89,13
109 IDC_STATIC,3,48,208,8
110 LTEXT "or trying to do just prior to the crash.",IDC_STATIC,3,
111 56,204,8
112 LTEXT "If you don't wish to send Linden Lab a crash report, press Cancel.",
113 IDC_STATIC,3,90,214,8
114 LTEXT "This report is NOT read by customer support. If you have billing or",
115 IDC_STATIC,3,68,208,8
116 LTEXT "other questions, please go to: www.secondlife.com/support",
117 IDC_STATIC,3,76,206,8
118END 103END
119 104
120 105
@@ -158,7 +143,7 @@ BEGIN
158 IDD_PROGRESS, DIALOG 143 IDD_PROGRESS, DIALOG
159 BEGIN 144 BEGIN
160 LEFTMARGIN, 7 145 LEFTMARGIN, 7
161 RIGHTMARGIN, 179 146 RIGHTMARGIN, 227
162 TOPMARGIN, 7 147 TOPMARGIN, 7
163 BOTTOMMARGIN, 26 148 BOTTOMMARGIN, 26
164 END 149 END
diff --git a/linden/indra/win_crash_logger/win_crash_logger.vcproj b/linden/indra/win_crash_logger/win_crash_logger.vcproj
index f250427..f077b05 100644
--- a/linden/indra/win_crash_logger/win_crash_logger.vcproj
+++ b/linden/indra/win_crash_logger/win_crash_logger.vcproj
@@ -72,7 +72,7 @@
72 CharacterSet="1"> 72 CharacterSet="1">
73 <Tool 73 <Tool
74 Name="VCCLCompilerTool" 74 Name="VCCLCompilerTool"
75 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;" 75 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;;..\llcrashlogger"
76 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE" 76 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE"
77 RuntimeLibrary="0" 77 RuntimeLibrary="0"
78 StructMemberAlignment="0" 78 StructMemberAlignment="0"
@@ -85,7 +85,7 @@
85 Name="VCCustomBuildTool"/> 85 Name="VCCustomBuildTool"/>
86 <Tool 86 <Tool
87 Name="VCLinkerTool" 87 Name="VCLinkerTool"
88 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 psapi.lib shell32.lib user32.lib wininet.lib winspool.lib" 88 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib psapi.lib"
89 OutputFile="win_crash_logger.exe" 89 OutputFile="win_crash_logger.exe"
90 LinkIncremental="1" 90 LinkIncremental="1"
91 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release" 91 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
@@ -123,7 +123,7 @@
123 CharacterSet="1"> 123 CharacterSet="1">
124 <Tool 124 <Tool
125 Name="VCCLCompilerTool" 125 Name="VCCLCompilerTool"
126 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;" 126 AdditionalIncludeDirectories="..\llcrashlogger;..\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;"
127 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE" 127 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;LL_RELEASE"
128 RuntimeLibrary="0" 128 RuntimeLibrary="0"
129 StructMemberAlignment="0" 129 StructMemberAlignment="0"
@@ -136,10 +136,10 @@
136 Name="VCCustomBuildTool"/> 136 Name="VCCustomBuildTool"/>
137 <Tool 137 <Tool
138 Name="VCLinkerTool" 138 Name="VCLinkerTool"
139 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib netapi32.lib ole32.lib oleaut32.lib psapi.lib shell32.lib user32.lib wininet.lib winspool.lib" 139 AdditionalDependencies="apr-1.lib aprutil-1.lib ws2_32.lib advapi32.lib comdlg32.lib dxguid.lib gdi32.lib kernel32.lib libexpatMT.lib netapi32.lib ole32.lib oleaut32.lib shell32.lib user32.lib wininet.lib winspool.lib libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib psapi.lib"
140 OutputFile="win_crash_logger.exe" 140 OutputFile="win_crash_logger.exe"
141 LinkIncremental="1" 141 LinkIncremental="1"
142 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release" 142 AdditionalLibraryDirectories="&quot;../lib_releasenoopt/i686-win32&quot;;&quot;../../libraries/i686-win32/lib_release&quot;"
143 GenerateDebugInformation="TRUE" 143 GenerateDebugInformation="TRUE"
144 SubSystem="2" 144 SubSystem="2"
145 OptimizeReferences="2" 145 OptimizeReferences="2"
@@ -175,6 +175,12 @@
175 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" 175 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
176 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 176 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
177 <File 177 <File
178 RelativePath="..\llcrashlogger\llcrashlogger.cpp">
179 </File>
180 <File
181 RelativePath=".\llcrashloggerwindows.cpp">
182 </File>
183 <File
178 RelativePath=".\StdAfx.cpp"> 184 RelativePath=".\StdAfx.cpp">
179 </File> 185 </File>
180 <File 186 <File
@@ -186,6 +192,12 @@
186 Filter="h;hpp;hxx;hm;inl;inc;xsd" 192 Filter="h;hpp;hxx;hm;inl;inc;xsd"
187 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 193 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
188 <File 194 <File
195 RelativePath="..\llcrashlogger\llcrashlogger.h">
196 </File>
197 <File
198 RelativePath=".\llcrashloggerwindows.h">
199 </File>
200 <File
189 RelativePath=".\resource.h"> 201 RelativePath=".\resource.h">
190 </File> 202 </File>
191 <File 203 <File
diff --git a/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj b/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj
index da8ce22..66ec157 100644
--- a/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj
+++ b/linden/indra/win_crash_logger/win_crash_logger_vc8.vcproj
@@ -41,7 +41,7 @@
41 <Tool 41 <Tool
42 Name="VCCLCompilerTool" 42 Name="VCCLCompilerTool"
43 Optimization="0" 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;" 44 AdditionalIncludeDirectories="..\llcrashlogger;..\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" 45 PreprocessorDefinitions="WIN32;_DEBUG;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG"
46 MinimalRebuild="true" 46 MinimalRebuild="true"
47 BasicRuntimeChecks="3" 47 BasicRuntimeChecks="3"
@@ -65,7 +65,7 @@
65 /> 65 />
66 <Tool 66 <Tool
67 Name="VCLinkerTool" 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 psapi.lib shell32.lib user32.lib wininet.lib winspool.lib" 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 psapi.lib shell32.lib user32.lib wininet.lib winspool.lib winmm.lib ssleay32.lib zlib.lib libcurl.lib libeay32.lib oldnames.lib"
69 OutputFile="win_crash_logger.exe" 69 OutputFile="win_crash_logger.exe"
70 LinkIncremental="1" 70 LinkIncremental="1"
71 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_debug" 71 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_debug"
@@ -124,7 +124,7 @@
124 /> 124 />
125 <Tool 125 <Tool
126 Name="VCCLCompilerTool" 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;" 127 AdditionalIncludeDirectories="..\llcrashlogger;..\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" 128 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
129 RuntimeLibrary="0" 129 RuntimeLibrary="0"
130 StructMemberAlignment="0" 130 StructMemberAlignment="0"
@@ -146,7 +146,7 @@
146 /> 146 />
147 <Tool 147 <Tool
148 Name="VCLinkerTool" 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 psapi.lib shell32.lib user32.lib wininet.lib winspool.lib" 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 psapi.lib shell32.lib user32.lib wininet.lib winspool.lib winmm.lib ssleay32.lib zlib.lib libcurl.lib libeay32.lib oldnames.lib"
150 OutputFile="win_crash_logger.exe" 150 OutputFile="win_crash_logger.exe"
151 LinkIncremental="1" 151 LinkIncremental="1"
152 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release" 152 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
@@ -206,7 +206,8 @@
206 /> 206 />
207 <Tool 207 <Tool
208 Name="VCCLCompilerTool" 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;" 209 Optimization="0"
210 AdditionalIncludeDirectories="..\llcrashlogger;..\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 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE"
211 RuntimeLibrary="0" 212 RuntimeLibrary="0"
212 StructMemberAlignment="0" 213 StructMemberAlignment="0"
@@ -228,7 +229,7 @@
228 /> 229 />
229 <Tool 230 <Tool
230 Name="VCLinkerTool" 231 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 psapi.lib shell32.lib user32.lib wininet.lib winspool.lib" 232 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 psapi.lib shell32.lib user32.lib wininet.lib winspool.lib winmm.lib ssleay32.lib zlib.lib libcurl.lib libeay32.lib oldnames.lib"
232 OutputFile="win_crash_logger.exe" 233 OutputFile="win_crash_logger.exe"
233 LinkIncremental="1" 234 LinkIncremental="1"
234 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release" 235 AdditionalLibraryDirectories="../lib_$(ConfigurationName)/i686-win32;../../libraries/i686-win32/lib_release"
@@ -273,6 +274,14 @@
273 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" 274 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
274 > 275 >
275 <File 276 <File
277 RelativePath="..\llcrashlogger\llcrashlogger.cpp"
278 >
279 </File>
280 <File
281 RelativePath=".\llcrashloggerwindows.cpp"
282 >
283 </File>
284 <File
276 RelativePath=".\StdAfx.cpp" 285 RelativePath=".\StdAfx.cpp"
277 > 286 >
278 </File> 287 </File>
@@ -287,6 +296,14 @@
287 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" 296 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
288 > 297 >
289 <File 298 <File
299 RelativePath="..\llcrashlogger\llcrashlogger.h"
300 >
301 </File>
302 <File
303 RelativePath=".\llcrashloggerwindows.h"
304 >
305 </File>
306 <File
290 RelativePath=".\resource.h" 307 RelativePath=".\resource.h"
291 > 308 >
292 </File> 309 </File>