win_crash_logger.cpp File Reference

Windows crash logger implementation. More...

#include "stdafx.h"
#include "linden_common.h"
#include "llcontrol.h"
#include "resource.h"
#include <direct.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <wininet.h>
#include "indra_constants.h"
#include "llerror.h"
#include "lltimer.h"
#include "lldir.h"
#include "llstring.h"
#include "lldxhardware.h"

Include dependency graph for win_crash_logger.cpp:

Go to the source code of this file.

Classes

class  LLFileEncoder

Defines

#define MAX_LOADSTRING   100

Functions

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM)
bool handle_button_click (WORD button_id)
S32 load_crash_behavior_setting ()
bool save_crash_behavior_setting (S32 crash_behavior)
void send_crash_report ()
void write_debug (const char *str)
void write_debug (std::string &str)
void ProcessCaption (HWND hWnd)
void ProcessDlgItemText (HWND hWnd, int nIDDlgItem)
int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
LLString encode_string (const char *formname, const LLString &str)
void update_messages ()
void sleep_and_pump_messages (U32 seconds)
void show_progress (const char *message)

Variables

LLControlGroup gCrashSettings
const char *const SETTINGS_FILE_HEADER = "version"
const S32 SETTINGS_FILE_VERSION = 101
HINSTANCE hInst = NULL
TCHAR szTitle [MAX_LOADSTRING]
TCHAR szWindowClass [MAX_LOADSTRING]
LLString gUserText
time_t gStartTime = 0
HWND gHwndReport = NULL
HWND gHwndProgress = NULL
HCURSOR gCursorArrow = NULL
HCURSOR gCursorWait = NULL
BOOL gFirstDialog = TRUE
BOOL gCrashInPreviousExec = FALSE
FILE * gDebugFile = NULL
LLString gUserserver
WCHAR gProductName [512]


Detailed Description

Windows crash logger implementation.

LicenseInfo
firstyear=2003&license=viewergpl

Copyright (c) 2003-2007, 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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$

Definition in file win_crash_logger.cpp.


Define Documentation

#define MAX_LOADSTRING   100

Definition at line 58 of file win_crash_logger.cpp.

Referenced by WinMain().


Function Documentation

LLString encode_string ( const char *  formname,
const LLString str 
)

bool handle_button_click ( WORD  button_id  ) 

Definition at line 328 of file win_crash_logger.cpp.

References CRASH_BEHAVIOR_ALWAYS_SEND, CRASH_BEHAVIOR_ASK, CRASH_BEHAVIOR_NEVER_SEND, FALSE, gFirstDialog, gHwndProgress, gHwndReport, IDC_CHECK_AUTO, llendl, llwarns, S32, save_crash_behavior_setting(), and send_crash_report().

Referenced by WndProc().

S32 load_crash_behavior_setting (  ) 

Definition at line 928 of file win_crash_logger.cpp.

References CRASH_BEHAVIOR_ASK, CRASH_BEHAVIOR_NEVER_SEND, CRASH_BEHAVIOR_SETTING, CRASH_SETTINGS_FILE, gCrashSettings, gDirUtilp, LLDir::getExpandedFilename(), LLControlGroup::getS32(), LL_PATH_USER_SETTINGS, LLControlGroup::loadFromFile(), and S32.

Referenced by WinMain().

void ProcessCaption ( HWND  hWnd  ) 

Definition at line 93 of file win_crash_logger.cpp.

References gProductName.

Referenced by WinMain().

void ProcessDlgItemText ( HWND  hWnd,
int  nIDDlgItem 
)

Definition at line 104 of file win_crash_logger.cpp.

References gProductName.

Referenced by WinMain().

bool save_crash_behavior_setting ( S32  crash_behavior  ) 

Definition at line 941 of file win_crash_logger.cpp.

References CRASH_BEHAVIOR_ASK, CRASH_BEHAVIOR_NEVER_SEND, CRASH_BEHAVIOR_SETTING, CRASH_SETTINGS_FILE, FALSE, gCrashSettings, gDirUtilp, LLDir::getExpandedFilename(), LL_PATH_USER_SETTINGS, LLControlGroup::saveToFile(), and LLControlGroup::setS32().

Referenced by handle_button_click().

void send_crash_report (  ) 

Definition at line 447 of file win_crash_logger.cpp.

References BUFSIZE, LLDXHardware::dumpDevices(), encode_string(), LLFileEncoder::encodeURL(), FALSE, gCrashInPreviousExec, gCursorArrow, gCursorWait, gDebugFile, gDirUtilp, gDXHardware, LLDir::getExpandedFilename(), LLDXHardware::getInfo(), gUserserver, gUserText, LLFileEncoder::isValid(), LL_PATH_LOGS, LL_PATH_USER_SETTINGS, llendl, llinfos, LLFileEncoder::mBuf, NULL, S32, LLDXHardware::setWriteDebugFunc(), show_progress(), sleep_and_pump_messages(), TRUE, update_messages(), and write_debug().

Referenced by handle_button_click(), and WinMain().

void show_progress ( const char *  message  ) 

Definition at line 433 of file win_crash_logger.cpp.

References FALSE, gHwndProgress, IDC_LOG, utf8str_to_wstring(), and wstring_to_utf16str().

Referenced by send_crash_report().

void sleep_and_pump_messages ( U32  seconds  ) 

Definition at line 421 of file win_crash_logger.cpp.

References ms_sleep(), and update_messages().

Referenced by send_crash_report().

void update_messages (  ) 

Definition at line 407 of file win_crash_logger.cpp.

References NULL.

Referenced by send_crash_report(), and sleep_and_pump_messages().

int APIENTRY WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  nCmdShow 
)

Definition at line 113 of file win_crash_logger.cpp.

References CRASH_BEHAVIOR_ALWAYS_SEND, CRASH_BEHAVIOR_ASK, CRASH_BEHAVIOR_NEVER_SEND, CRASH_BEHAVIOR_SETTING, LLControlGroup::declareS32(), gCrashInPreviousExec, gCrashSettings, gCursorArrow, gCursorWait, gDirUtilp, gHwndProgress, gHwndReport, gProductName, gStartTime, gUserserver, hInst, i, IDC_STATIC_HEADER, IDC_STATIC_MOTIVATION, IDC_STATIC_WHATINFO, IDC_WIN_CRASH_LOGGER, IDD_PROGRESS, IDD_REPORT, IDI_WIN_CRASH_LOGGER, IDS_APP_TITLE, LLDir::initAppDirs(), llendl, llinfos, llwarns, load_crash_behavior_setting(), MAX_LOADSTRING, NULL, ProcessCaption(), ProcessDlgItemText(), S32, send_crash_report(), szTitle, szWindowClass, TRUE, and WndProc().

LRESULT CALLBACK WndProc ( HWND  ,
UINT  ,
WPARAM  ,
LPARAM   
)

Definition at line 299 of file win_crash_logger.cpp.

References gFirstDialog, and handle_button_click().

Referenced by WinMain().

void write_debug ( std::string &  str  ) 

Definition at line 923 of file win_crash_logger.cpp.

References write_debug().

void write_debug ( const char *  str  ) 


Variable Documentation

BOOL gCrashInPreviousExec = FALSE

Definition at line 83 of file win_crash_logger.cpp.

LLControlGroup gCrashSettings

Definition at line 55 of file win_crash_logger.cpp.

HCURSOR gCursorArrow = NULL

Definition at line 80 of file win_crash_logger.cpp.

Referenced by send_crash_report(), and WinMain().

HCURSOR gCursorWait = NULL

Definition at line 81 of file win_crash_logger.cpp.

Referenced by send_crash_report(), and WinMain().

FILE* gDebugFile = NULL

Definition at line 84 of file win_crash_logger.cpp.

BOOL gFirstDialog = TRUE

Definition at line 82 of file win_crash_logger.cpp.

Referenced by handle_button_click(), and WndProc().

HWND gHwndProgress = NULL

Definition at line 79 of file win_crash_logger.cpp.

Referenced by handle_button_click(), show_progress(), and WinMain().

HWND gHwndReport = NULL

Definition at line 78 of file win_crash_logger.cpp.

Referenced by handle_button_click(), and WinMain().

WCHAR gProductName[512]

Definition at line 86 of file win_crash_logger.cpp.

time_t gStartTime = 0

Definition at line 77 of file win_crash_logger.cpp.

LLString gUserserver

Definition at line 85 of file win_crash_logger.cpp.

LLString gUserText

Definition at line 76 of file win_crash_logger.cpp.

HINSTANCE hInst = NULL

Definition at line 72 of file win_crash_logger.cpp.

Referenced by WinMain().

const char* const SETTINGS_FILE_HEADER = "version"

Definition at line 59 of file win_crash_logger.cpp.

const S32 SETTINGS_FILE_VERSION = 101

Definition at line 60 of file win_crash_logger.cpp.

TCHAR szTitle[MAX_LOADSTRING]

Definition at line 73 of file win_crash_logger.cpp.

Referenced by WinMain().

TCHAR szWindowClass[MAX_LOADSTRING]

Definition at line 74 of file win_crash_logger.cpp.

Referenced by WinMain().


Generated on Thu Jul 1 06:11:03 2010 for Second Life Viewer by  doxygen 1.4.7