Skip to content

Commit

Permalink
Full sync at 9526
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan386 committed Jan 25, 2015
1 parent d545907 commit 77cf8ef
Show file tree
Hide file tree
Showing 581 changed files with 97,274 additions and 29,390 deletions.
8 changes: 4 additions & 4 deletions BugTrap/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ CArray<DATA_TYPE, INSTANCE_TRAITS, COMPARE_TRAITS>::CArray(size_t nSize)
m_nCount = 0;
if (nSize > 0)
{
m_arrData = (DATA_TYPE*)new BYTE[nSize * sizeof(DATA_TYPE)];
m_arrData = (DATA_TYPE*)new (std::nothrow) BYTE[nSize * sizeof(DATA_TYPE)];
if (m_arrData == NULL)
{
m_nSize = 0;
Expand All @@ -135,7 +135,7 @@ CArray<DATA_TYPE, INSTANCE_TRAITS, COMPARE_TRAITS>::CArray(const CArray& rArray)
m_nSize = m_nCount = rArray.m_nCount;
if (m_nSize)
{
m_arrData = (DATA_TYPE*)new BYTE[m_nSize * sizeof(DATA_TYPE)];
m_arrData = (DATA_TYPE*)new (std::nothrow) BYTE[m_nSize * sizeof(DATA_TYPE)];
if (m_arrData == NULL)
{
m_nSize = m_nCount = 0;
Expand Down Expand Up @@ -207,7 +207,7 @@ void CArray<DATA_TYPE, INSTANCE_TRAITS, COMPARE_TRAITS>::EnsureSize(size_t nSize
else
nSize += nSize / 2;
}
DATA_TYPE* arrData = (DATA_TYPE*)new BYTE[nSize * sizeof(DATA_TYPE)];
DATA_TYPE* arrData = (DATA_TYPE*)new (std::nothrow) BYTE[nSize * sizeof(DATA_TYPE)];
if (arrData == NULL)
RaiseException(STATUS_NO_MEMORY, 0, 0, NULL);
if (m_arrData)
Expand Down Expand Up @@ -339,7 +339,7 @@ DATA_TYPE& CArray<DATA_TYPE, INSTANCE_TRAITS, COMPARE_TRAITS>::InsertItem(size_t
if (m_nSize < nSize)
{
nSize += nSize / 2;
DATA_TYPE* arrData = (DATA_TYPE*)new BYTE[nSize * sizeof(DATA_TYPE)];
DATA_TYPE* arrData = (DATA_TYPE*)new (std::nothrow) BYTE[nSize * sizeof(DATA_TYPE)];
if (arrData == NULL)
RaiseException(STATUS_NO_MEMORY, 0, 0, NULL);
CopyMemory(arrData, m_arrData, nItemPos * sizeof(DATA_TYPE));
Expand Down
4 changes: 2 additions & 2 deletions BugTrap/AssemblyInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ using namespace System::Runtime::InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.3.3466.24114")];
[assembly: AssemblyFileVersion("1.3.3466.24114")];
[assembly: AssemblyVersion("1.3.3718.38316")];
[assembly: AssemblyFileVersion("1.3.3718.38316")];

using namespace System::Security::Permissions;

Expand Down
4 changes: 2 additions & 2 deletions BugTrap/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ BOOL CMixedBuffer<TYPE, dwStatBufferSize>::SetSize(DWORD dwBufferSize)
if (countof(m_arrStatBuffer) >= dwBufferSize)
return TRUE;
}
TYPE* pDynBuffer = new TYPE[dwBufferSize];
TYPE* pDynBuffer = new (std::nothrow) TYPE[dwBufferSize];
if (pDynBuffer == NULL)
return FALSE;
delete[] m_pDynBuffer;
Expand Down Expand Up @@ -181,7 +181,7 @@ void CDynamicBuffer<TYPE>::FreeBuffer(void)
template <typename TYPE>
BOOL CDynamicBuffer<TYPE>::AllocBuffer(DWORD dwBufferSize)
{
TYPE* pBuffer = new TYPE[dwBufferSize];
TYPE* pBuffer = new (std::nothrow) TYPE[dwBufferSize];
if (pBuffer == NULL)
return FALSE;
delete[] m_pBuffer;
Expand Down
30 changes: 28 additions & 2 deletions BugTrap/BugTrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static inline void ReadVersionInfo(void)
* Generic unhandled exception handler.
* @param rParams - symbolic engine parameters.
*/
static void HandleException(CSymEngine::CEngineParams& rParams)
static BOOL HandleException(CSymEngine::CEngineParams& rParams)
{
// Block other threads.
EnterCriticalSection(&g_csHandlerSync);
Expand All @@ -387,6 +387,14 @@ static void HandleException(CSymEngine::CEngineParams& rParams)
{
// Flush log files and allocate symbolic engine.
InitSymEngine(rParams);
// Do other things only if stack trace contains module of interest
if (!g_pSymEngine->CheckStackTrace(g_hModule))
{
g_pExceptionPointers = NULL;
// Unlock other threads.
LeaveCriticalSection(&g_csHandlerSync);
return FALSE;
}
// Call user error handler before BugTrap user interface.
if (g_pfnPreErrHandler != NULL)
(*g_pfnPreErrHandler)(g_nPreErrHandlerParam);
Expand Down Expand Up @@ -415,6 +423,7 @@ static void HandleException(CSymEngine::CEngineParams& rParams)
g_pExceptionPointers = NULL;
// Unlock other threads.
LeaveCriticalSection(&g_csHandlerSync);
return TRUE;
}

/**
Expand Down Expand Up @@ -457,7 +466,8 @@ static LONG GenericFilter(PEXCEPTION_POINTERS pExceptionPointers, CSymEngine::EX
// Initialize symbolic engine parameters.
CSymEngine::CEngineParams params(pExceptionPointers, eExceptionType);
// Call exception handler.
HandleException(params);
if (!HandleException(params))
return EXCEPTION_CONTINUE_SEARCH;
// ~CSymEngine() will be called at this point.
}
#if defined _CRTDBG_MAP_ALLOC && defined _DEBUG
Expand Down Expand Up @@ -2324,6 +2334,22 @@ extern "C" BUGTRAP_API BOOL APIENTRY BT_SendSnapshotEx(PEXCEPTION_POINTERS pExce
return bResult;
}

/**
* @return Module of interest handle.
*/
extern "C" BUGTRAP_API HMODULE APIENTRY BT_GetModule()
{
return g_hModule;
}

/**
* @param nModule - module of interest handle.
*/
extern "C" BUGTRAP_API void APIENTRY BT_SetModule(HMODULE hModule)
{
g_hModule = hModule;
}

static PTOP_LEVEL_EXCEPTION_FILTER WINAPI DummySetUnhandledExceptionFilter(PTOP_LEVEL_EXCEPTION_FILTER /*pTopLevelExceptionFilter*/)
{
return NULL;
Expand Down
16 changes: 16 additions & 0 deletions BugTrap/BugTrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,23 @@ BUGTRAP_API void APIENTRY BT_SetAppVersion(LPCTSTR pszAppVersion);
* @note @a hModule can be set to NULL for the main executable.
*/
BUGTRAP_API BOOL APIENTRY BT_ReadVersionInfo(HMODULE hModule);
/** @} */

/**
* @defgroup ModuleOfInterest Module of interest
* Only exceptions that contain the module of interest at the stack trace will
* be processed. If no module of interest set, all exceptions will be processed.
* @{
*/

/**
* @brief Get module of interest
*/
BUGTRAP_API HMODULE APIENTRY BT_GetModule();
/**
* @brief Set module of interest
*/
BUGTRAP_API void APIENTRY BT_SetModule(HMODULE hModule);
/** @} */

/**
Expand Down
16 changes: 8 additions & 8 deletions BugTrap/BugTrap.rc
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,0,0
PRODUCTVERSION 2,7,4,0
FILEVERSION 1,4,0,2
PRODUCTVERSION 2,7,8,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -798,27 +798,27 @@ BEGIN
BEGIN
BLOCK "000704b0"
BEGIN
VALUE "Comments", "BugTrap - softwarefehler berichterstattung"
VALUE "Comments", "BugTrap 1.3.3718.38316 - softwarefehler berichterstattung"
VALUE "CompanyName", "IntelleSoft"
VALUE "FileDescription", "BugTrap dynamic link library"
VALUE "FileVersion", "1.4.0.0"
VALUE "FileVersion", "1.4.0.2"
VALUE "InternalName", "BugTrap"
VALUE "LegalCopyright", "Copyright � 2005-2009 IntelleSoft"
VALUE "OriginalFilename", "BugTrap.dll"
VALUE "ProductName", "Shareaza"
VALUE "ProductVersion", "2.7.4.0"
VALUE "ProductVersion", "2.7.8.0"
END
BLOCK "040904b0"
BEGIN
VALUE "Comments", "BugTrap - software error reporting tool"
VALUE "Comments", "BugTrap 1.3.3718.38316 - software error reporting tool"
VALUE "CompanyName", "IntelleSoft"
VALUE "FileDescription", "BugTrap dynamic link library"
VALUE "FileVersion", "1.4.0.0"
VALUE "FileVersion", "1.4.0.2"
VALUE "InternalName", "BugTrap"
VALUE "LegalCopyright", "Copyright � 2005-2009 IntelleSoft"
VALUE "OriginalFilename", "BugTrap.dll"
VALUE "ProductName", "Shareaza"
VALUE "ProductVersion", "2.7.4.0"
VALUE "ProductVersion", "2.7.8.0"
END
END
BLOCK "VarFileInfo"
Expand Down
6 changes: 4 additions & 2 deletions BugTrap/BugTrap_10.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<AdditionalDependencies>comctl32.lib;version.lib;shlwapi.lib;ws2_32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalOptions>nothrownew.obj %(AdditionalOptions)</AdditionalOptions>
</Link>
<PreBuildEvent>
<Command>
Expand Down Expand Up @@ -146,6 +147,7 @@
</MapFileName>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX64</TargetMachine>
<AdditionalOptions>nothrownew.obj %(AdditionalOptions)</AdditionalOptions>
</Link>
<PreBuildEvent>
<Command>
Expand Down Expand Up @@ -186,7 +188,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<TargetMachine>MachineX86</TargetMachine>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;ole32.dll;oleaut32.dll;shell32.dll;shlwapi.dll;version.dll;wininet.dll;ws2_32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalOptions>nothrownew.obj %(AdditionalOptions)</AdditionalOptions>
</Link>
<PreBuildEvent>
<Command>
Expand Down Expand Up @@ -237,7 +239,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<TargetMachine>MachineX64</TargetMachine>
<DelayLoadDLLs>advapi32.dll;comctl32.dll;comdlg32.dll;ole32.dll;oleaut32.dll;shell32.dll;shlwapi.dll;version.dll;wininet.dll;ws2_32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalOptions>nothrownew.obj %(AdditionalOptions)</AdditionalOptions>
</Link>
<PreBuildEvent>
<Command>
Expand Down
Loading

0 comments on commit 77cf8ef

Please sign in to comment.