Imported existing code

This commit is contained in:
Hazim Gazov
2010-04-02 02:48:44 -03:00
parent 48fbc5ae91
commit 7a86d01598
13996 changed files with 2468699 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
# -*- cmake -*-
project(win_crash_logger)
include(00-Common)
include(LLCommon)
include(LLCrashLogger)
include(LLMath)
include(LLMessage)
include(LLVFS)
include(LLWindow)
include(LLXML)
include(Linking)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLCRASHLOGGER_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
)
set(win_crash_logger_SOURCE_FILES
win_crash_logger.cpp
llcrashloggerwindows.cpp
)
set(win_crash_logger_HEADER_FILES
CMakeLists.txt
llcrashloggerwindows.h
resource.h
StdAfx.h
win_crash_logger.h
)
set_source_files_properties(${win_crash_logger_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
set(win_crash_logger_RESOURCE_FILES
snowglobe_icon.ico
)
set_source_files_properties(${win_crash_logger_RESOURCE_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
set(win_crash_logger_RESOURCE_FILES
win_crash_logger.rc
${win_crash_logger_RESOURCE_FILES}
)
SOURCE_GROUP("Resource Files" FILES ${win_crash_logger_RESOURCE_FILES})
list(APPEND
win_crash_logger_SOURCE_FILES
${win_crash_logger_HEADER_FILES}
${win_crash_logger_RESOURCE_FILES}
)
find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR})
add_executable(windows-crash-logger WIN32 ${win_crash_logger_SOURCE_FILES})
target_link_libraries(windows-crash-logger
${LLCRASHLOGGER_LIBRARIES}
${LLWINDOW_LIBRARIES}
${LLVFS_LIBRARIES}
${LLXML_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLMATH_LIBRARIES}
${LLCOMMON_LIBRARIES}
${WINDOWS_LIBRARIES}
${DXGUID_LIBRARY}
user32
gdi32
ole32
oleaut32
Wldap32
)
if (WINDOWS)
set_target_properties(windows-crash-logger
PROPERTIES
LINK_FLAGS "/NODEFAULTLIB:LIBCMT"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\""
)
endif (WINDOWS)

View File

@@ -0,0 +1,40 @@
/**
* @file StdAfx.cpp
* @brief windows crash logger source file for includes
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
// stdafx.cpp : source file that includes just the standard includes
// win_crash_logger.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

View File

@@ -0,0 +1,63 @@
/**
* @file StdAfx.h
* @brief standard system includes
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
// Local Header Files
// TODO: reference additional headers your program requires here
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,383 @@
/**
* @file llcrashloggerwindows.cpp
* @brief Windows crash logger implementation
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "stdafx.h"
#include "resource.h"
#include "llcrashloggerwindows.h"
#include <sstream>
#include "boost/tokenizer.hpp"
#include "dbghelp.h"
#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME
#include "llerror.h"
#include "llfile.h"
#include "lltimer.h"
#include "llstring.h"
#include "lldxhardware.h"
#include "lldir.h"
#include "llsdserialize.h"
#define MAX_LOADSTRING 100
#define MAX_STRING 2048
const char* const SETTINGS_FILE_HEADER = "version";
const S32 SETTINGS_FILE_VERSION = 101;
// Windows Message Handlers
// Global Variables:
HINSTANCE hInst= NULL; // current instance
TCHAR szTitle[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; /* Flawfinder: ignore */ // The title bar text
std::string gProductName;
HWND gHwndReport = NULL; // Send/Don't Send dialog
HWND gHwndProgress = NULL; // Progress window
HCURSOR gCursorArrow = NULL;
HCURSOR gCursorWait = NULL;
BOOL gFirstDialog = TRUE; // Are we currently handling the Send/Don't Send dialog?
std::stringstream gDXInfo;
bool gSendLogs = false;
//Conversion from char* to wchar*
//Replacement for ATL macros, doesn't allocate memory
//For more info see: http://www.codeguru.com/forum/showthread.php?t=337247
void ConvertLPCSTRToLPWSTR (const char* pCstring, WCHAR* outStr)
{
if (pCstring != NULL)
{
int nInputStrLen = strlen (pCstring);
// Double NULL Termination
int nOutputStrLen = MultiByteToWideChar(CP_ACP, 0, pCstring, nInputStrLen, NULL, 0) + 2;
if (outStr)
{
memset (outStr, 0x00, sizeof (WCHAR)*nOutputStrLen);
MultiByteToWideChar (CP_ACP, 0, pCstring, nInputStrLen, outStr, nInputStrLen);
}
}
}
void write_debug(const char *str)
{
gDXInfo << str; /* Flawfinder: ignore */
}
void write_debug(std::string& str)
{
write_debug(str.c_str());
}
void show_progress(const std::string& message)
{
std::wstring msg = wstring_to_utf16str(utf8str_to_wstring(message));
if (gHwndProgress)
{
SendDlgItemMessage(gHwndProgress, // handle to destination window
IDC_LOG,
WM_SETTEXT, // message to send
FALSE, // undo option
(LPARAM)msg.c_str());
}
}
void update_messages()
{
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
exit(0);
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void sleep_and_pump_messages( U32 seconds )
{
const U32 CYCLES_PER_SECOND = 10;
U32 cycles = seconds * CYCLES_PER_SECOND;
while( cycles-- )
{
update_messages();
ms_sleep(1000 / CYCLES_PER_SECOND);
}
}
// Include product name in the window caption.
void LLCrashLoggerWindows::ProcessCaption(HWND hWnd)
{
TCHAR templateText[MAX_STRING]; /* Flawfinder: ignore */
TCHAR header[MAX_STRING];
std::string final;
GetWindowText(hWnd, templateText, sizeof(templateText));
final = llformat(ll_convert_wide_to_string(templateText).c_str(), gProductName.c_str());
ConvertLPCSTRToLPWSTR(final.c_str(), header);
SetWindowText(hWnd, header);
}
// Include product name in the diaog item text.
void LLCrashLoggerWindows::ProcessDlgItemText(HWND hWnd, int nIDDlgItem)
{
TCHAR templateText[MAX_STRING]; /* Flawfinder: ignore */
TCHAR header[MAX_STRING];
std::string final;
GetDlgItemText(hWnd, nIDDlgItem, templateText, sizeof(templateText));
final = llformat(ll_convert_wide_to_string(templateText).c_str(), gProductName.c_str());
ConvertLPCSTRToLPWSTR(final.c_str(), header);
SetDlgItemText(hWnd, nIDDlgItem, header);
}
bool handle_button_click(WORD button_id)
{
// Is this something other than Send or Don't Send?
if (button_id != IDOK
&& button_id != IDCANCEL)
{
return false;
}
// See if "do this next time" is checked and save state
S32 crash_behavior = CRASH_BEHAVIOR_ASK;
LRESULT result = SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_GETCHECK, 0, 0);
if (result == BST_CHECKED)
{
if (button_id == IDOK)
{
crash_behavior = CRASH_BEHAVIOR_ALWAYS_SEND;
}
else if (button_id == IDCANCEL)
{
crash_behavior = CRASH_BEHAVIOR_NEVER_SEND;
}
((LLCrashLoggerWindows*)LLCrashLogger::instance())->saveCrashBehaviorSetting(crash_behavior);
}
// We're done with this dialog.
gFirstDialog = FALSE;
// Send the crash report if requested
if (button_id == IDOK)
{
gSendLogs = TRUE;
WCHAR wbuffer[20000];
GetDlgItemText(gHwndReport, // handle to dialog box
IDC_EDIT1, // control identifier
wbuffer, // pointer to buffer for text
20000 // maximum size of string
);
std::string user_text(ll_convert_wide_to_string(wbuffer));
// Activate and show the window.
ShowWindow(gHwndProgress, SW_SHOW);
// Try doing this second to make the progress window go frontmost.
ShowWindow(gHwndReport, SW_HIDE);
((LLCrashLoggerWindows*)LLCrashLogger::instance())->setUserText(user_text);
((LLCrashLoggerWindows*)LLCrashLogger::instance())->sendCrashLogs();
}
// Quit the app
LLApp::setQuitting();
return true;
}
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
switch( message )
{
case WM_CREATE:
return 0;
case WM_COMMAND:
if( gFirstDialog )
{
WORD button_id = LOWORD(wParam);
bool handled = handle_button_click(button_id);
if (handled)
{
return 0;
}
}
break;
case WM_DESTROY:
// Closing the window cancels
LLApp::setQuitting();
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
LLCrashLoggerWindows::LLCrashLoggerWindows(void)
{
}
LLCrashLoggerWindows::~LLCrashLoggerWindows(void)
{
}
bool LLCrashLoggerWindows::init(void)
{
bool ok = LLCrashLogger::init();
if(!ok) return false;
/*
mbstowcs( gProductName, mProductName.c_str(), LL_ARRAY_SIZE(gProductName) );
gProductName[ LL_ARRY_SIZE(gProductName) - 1 ] = 0;
swprintf(gProductName, L"Second Life");
*/
llinfos << "Loading dialogs" << llendl;
// Initialize global strings
LoadString(mhInst, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(mhInst, IDC_WIN_CRASH_LOGGER, szWindowClass, MAX_LOADSTRING);
gCursorArrow = LoadCursor(NULL, IDC_ARROW);
gCursorWait = LoadCursor(NULL, IDC_WAIT);
// Register a window class that will be used by our dialogs
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = DLGWINDOWEXTRA; // Required, since this is used for dialogs!
wndclass.hInstance = mhInst;
wndclass.hIcon = LoadIcon(hInst, MAKEINTRESOURCE( IDI_WIN_CRASH_LOGGER ) );
wndclass.hCursor = gCursorArrow;
wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szWindowClass;
RegisterClass( &wndclass );
return true;
}
void LLCrashLoggerWindows::gatherPlatformSpecificFiles()
{
updateApplication("Gathering hardware information. App may appear frozen.");
// DX hardware probe blocks, so we can't cancel during it
//Generate our dx_info.log file
SetCursor(gCursorWait);
// At this point we're responsive enough the user could click the close button
SetCursor(gCursorArrow);
mDebugLog["DisplayDeviceInfo"] = gDXHardware.getDisplayInfo();
mFileMap["CrashLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLifeException.log");
}
bool LLCrashLoggerWindows::mainLoop()
{
// Note: parent hwnd is 0 (the desktop). No dlg proc. See Petzold (5th ed) HexCalc example, Chapter 11, p529
// win_crash_logger.rc has been edited by hand.
// Dialogs defined with CLASS "WIN_CRASH_LOGGER" (must be same as szWindowClass)
gProductName = mProductName;
gHwndProgress = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PROGRESS), 0, NULL);
ProcessCaption(gHwndProgress);
ShowWindow(gHwndProgress, SW_HIDE );
if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
{
ShowWindow(gHwndProgress, SW_SHOW );
sendCrashLogs();
}
else if (mCrashBehavior == CRASH_BEHAVIOR_ASK)
{
gHwndReport = CreateDialog(hInst, MAKEINTRESOURCE(IDD_PREVREPORTBOX), 0, NULL);
// Ignore result
(void) SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_SETCHECK, 0, 0);
// Include the product name in the caption and various dialog items.
ProcessCaption(gHwndReport);
ProcessDlgItemText(gHwndReport, IDC_STATIC_MSG);
// Update the header to include whether or not we crashed on the last run.
std::string headerStr;
TCHAR header[MAX_STRING];
if (mCrashInPreviousExec)
{
headerStr = llformat("%s appears to have crashed or frozen the last time it ran.", mProductName.c_str());
}
else
{
headerStr = llformat("%s appears to have crashed.", mProductName.c_str());
}
ConvertLPCSTRToLPWSTR(headerStr.c_str(), header);
SetDlgItemText(gHwndReport, IDC_STATIC_HEADER, header);
ShowWindow(gHwndReport, SW_SHOW );
MSG msg;
memset(&msg, 0, sizeof(msg));
while (!LLApp::isQuitting() && GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
else
{
llwarns << "Unknown crash behavior " << mCrashBehavior << llendl;
return 1;
}
return 0;
}
void LLCrashLoggerWindows::updateApplication(const std::string& message)
{
LLCrashLogger::updateApplication();
if(!message.empty()) show_progress(message);
update_messages();
}
bool LLCrashLoggerWindows::cleanup()
{
if(gSendLogs)
{
if(mSentCrashLogs) show_progress("Done");
else show_progress("Could not connect to servers, logs not sent");
sleep_and_pump_messages(3);
}
PostQuitMessage(0);
return true;
}

View File

@@ -0,0 +1,59 @@
/**
* @file llcrashloggerwindows.h
* @brief Windows crash logger definition
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LLCRASHLOGGERWINDOWS_H
#define LLCRASHLOGGERWINDOWS_H
#include "llcrashlogger.h"
#include "windows.h"
#include "llstring.h"
class LLCrashLoggerWindows : public LLCrashLogger
{
public:
LLCrashLoggerWindows(void);
~LLCrashLoggerWindows(void);
virtual bool init();
virtual bool mainLoop();
virtual void updateApplication(const std::string& message = LLStringUtil::null);
virtual bool cleanup();
virtual void gatherPlatformSpecificFiles();
//void annotateCallStack();
void setHandle(HINSTANCE hInst) { mhInst = hInst; }
private:
void ProcessDlgItemText(HWND hWnd, int nIDDlgItem);
void ProcessCaption(HWND hWnd);
HINSTANCE mhInst;
};
#endif

View File

@@ -0,0 +1,69 @@
/**
* @file resource.h
* @brief Windows crash logger windows resources
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by win_crash_logger.rc
//
#define IDC_MYICON 2
#define IDD_REPORT 9
#define IDD_WIN_CRASH_LOGGER_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDS_APP_TITLE 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDS_HELLO 106
#define IDI_WIN_CRASH_LOGGER 107
#define IDI_SMALL 108
#define IDC_WIN_CRASH_LOGGER 109
#define IDR_MAINFRAME 128
#define IDD_PROGRESS 129
#define IDD_PREVREPORTBOX 130
#define IDC_EDIT1 1000
#define IDC_LOG 1004
#define IDC_CHECK_AUTO 1006
#define IDC_STATIC_HEADER 1007
#define IDC_STATIC_WHATINFO 1008
#define IDC_STATIC_MOTIVATION 1009
#define IDC_STATIC_MSG 1010
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 131
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1011
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,80 @@
/**
* @file win_crash_logger.cpp
* @brief Windows crash logger implementation
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
// win_crash_logger.cpp : Defines the entry point for the application.
//
// Must be first include, precompiled headers.
#include "linden_common.h"
#include "stdafx.h"
#include <stdlib.h>
#include "llcrashloggerwindows.h"
//
// Implementation
//
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
llinfos << "Starting crash reporter" << llendl;
LLCrashLoggerWindows app;
app.setHandle(hInstance);
bool ok = app.init();
if(!ok)
{
llwarns << "Unable to initialize application." << llendl;
return -1;
}
// Run the application main loop
if(!LLApp::isQuitting()) app.mainLoop();
if (!app.isError())
{
//
// We don't want to do cleanup here if the error handler got called -
// the assumption is that the error handler is responsible for doing
// app cleanup if there was a problem.
//
app.cleanup();
}
return 0;
}

View File

@@ -0,0 +1,44 @@
/**
* @file win_crash_logger.h
* @brief Windows crash logger project includes
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#if !defined(AFX_WIN_CRASH_LOGGER_H__79802F4B_7C37_4F63_A2BB_0768788C3A27__INCLUDED_)
#define AFX_WIN_CRASH_LOGGER_H__79802F4B_7C37_4F63_A2BB_0768788C3A27__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h"
#endif // !defined(AFX_WIN_CRASH_LOGGER_H__79802F4B_7C37_4F63_A2BB_0768788C3A27__INCLUDED_)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,188 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_WIN_CRASH_LOGGER ICON "ll_icon.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDC_WIN_CRASH_LOGGER MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&Help"
BEGIN
MENUITEM "&About ...", IDM_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_PROGRESS DIALOGEX 100, 100, 234, 33
STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CAPTION | WS_SYSMENU
CAPTION "%s Crash Logger"
CLASS "WIN_CRASH_LOGGER"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
LTEXT "Static",IDC_LOG,7,7,220,8
END
IDD_REPORT DIALOGEX 100, 100, 297, 125
STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CAPTION | WS_SYSMENU
CAPTION "%s Crash Logger"
CLASS "WIN_CRASH_LOGGER"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "Send",IDOK,198,104,45,15,WS_GROUP
PUSHBUTTON "Don't Send",IDCANCEL,247,104,45,15,WS_GROUP
LTEXT "%s appears to have crashed.",IDC_STATIC_HEADER,4,4,288,14
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
CONTROL "Remember this choice",IDC_CHECK_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,106,89,13
LTEXT "Sending crash reports is the best way to help us improve the quality of %s.",IDC_STATIC_MOTIVATION,4,43,288,8
LTEXT "If you continue to experience this problem, please try:",IDC_STATIC,4,57,251,8
LTEXT "- Contacting support by visiting http://www.secondlife.com/support",IDC_STATIC,4,67,231,8
END
IDD_PREVREPORTBOX DIALOGEX 100, 100, 232, 213
STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CAPTION | WS_SYSMENU
CAPTION "%s Crash Logger"
CLASS "WIN_CRASH_LOGGER"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "Send Report",IDOK,131,193,45,15,WS_GROUP
EDITTEXT IDC_EDIT1,3,100,223,89,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL
PUSHBUTTON "Don't Send",IDCANCEL,181,193,45,15,WS_GROUP
LTEXT "%s appears to have crashed or frozen the last time it ran.",IDC_STATIC_HEADER,4,4,214,8
LTEXT "This crash reporter collects information about your computer's",IDC_STATIC,4,17,201,8
LTEXT "hardware configuration, operating system, and some %s",IDC_STATIC_MSG,4,25,212,8
LTEXT "logs, all of which are used for debugging purposes only.",IDC_STATIC,4,33,210,8
LTEXT "In the space below, please briefly describe what you were doing",IDC_STATIC,3,48,208,8
LTEXT "or trying to do just prior to the crash.",IDC_STATIC,3,56,204,8
LTEXT "If you don't wish to send Linden Lab a crash report, press Don't Send.",IDC_STATIC,3,90,223,8
LTEXT "This report is NOT read by customer support. If you have billing or",IDC_STATIC,3,68,208,8
LTEXT "other questions, please go to: www.secondlife.com/support",IDC_STATIC,3,76,206,8
CONTROL "Remember this choice",IDC_CHECK_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,3,193,89,13
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""resource.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_PROGRESS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 227
TOPMARGIN, 7
BOTTOMMARGIN, 26
END
IDD_REPORT, DIALOG
BEGIN
RIGHTMARGIN, 292
VERTGUIDE, 4
BOTTOMMARGIN, 119
HORZGUIDE, 4
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_APP_TITLE "win_crash_logger"
IDS_HELLO "Hello World!"
IDC_WIN_CRASH_LOGGER "WIN_CRASH_LOGGER"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED