home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************************
- * Copyright (c) 1999 Microsoft Corporation. All Rights Reserved.
- *
- * File:
- * ProfilerTestBase.cpp
- *
- * Description:
- *
- *
- *
- ***************************************************************************************/
- #include "ProfilerBase.h"
-
-
- /***************************************************************************************
- * Method:
- *
- *
- * Purpose:
- *
- *
- * Parameters:
- *
- *
- * Return value:
- *
- *
- * Notes:
- *
- ***************************************************************************************/
- void _LaunchDebugger( const char *szMsg, const char* szFile, int iLine )
- {
- #ifdef _DEBUG
-
- char message[MAX_LENGTH];
-
-
- sprintf( message,
- "%s\n\n" \
- "File: %s\n" \
- "Line: %d\n",
- ((szMsg == NULL) ? "FAILURE" : szMsg),
- szFile,
- iLine );
-
- switch ( MessageBoxA( NULL, message, "ASSERT", (MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION) ) )
- {
- case IDABORT:
- TerminateProcess( GetCurrentProcess(), 1 /* bad exit code */ );
- break;
-
- case IDRETRY:
- _DbgBreak();
-
- case IDIGNORE:
- break;
-
- } // switch
-
- #endif
-
- } // _LaunchDebugger
-
-
- /***************************************************************************************
- ******************** ********************
- ******************** BaseException Implementation ********************
- ******************** ********************
- ***************************************************************************************/
-
- /***************************************************************************************
- * Method:
- *
- *
- * Purpose:
- *
- *
- * Parameters:
- *
- *
- * Return value:
- *
- *
- * Notes:
- *
- ***************************************************************************************/
- /* public */
- BaseException::BaseException( const char *reason ) :
- m_reason( NULL )
- {
- SIZE_T length;
-
-
- length = strlen( reason );
- m_reason = new char[(length + 1)];
-
- strcpy( m_reason, reason );
-
- } // ctor
-
-
- /***************************************************************************************
- * Method:
- *
- *
- * Purpose:
- *
- *
- * Parameters:
- *
- *
- * Return value:
- *
- *
- * Notes:
- *
- ***************************************************************************************/
- /* virtual public */
- BaseException::~BaseException()
- {
- if ( m_reason != NULL )
- delete[] m_reason;
-
- } // dtor
-
-
- /***************************************************************************************
- * Method:
- *
- *
- * Purpose:
- *
- *
- * Parameters:
- *
- *
- * Return value:
- *
- *
- * Notes:
- *
- ***************************************************************************************/
- /* virtual public */
- void BaseException::ReportFailure()
- {
- TEXT_OUTLN( m_reason );
-
- } // BaseException::ReportFailure
-
-
- /***************************************************************************************
- ******************** ********************
- ******************** Synchronize Implementation ********************
- ******************** ********************
- ***************************************************************************************/
-
- /***************************************************************************************
- * Method:
- *
- *
- * Purpose:
- *
- *
- * Parameters:
- *
- *
- * Return value:
- *
- *
- * Notes:
- *
- ***************************************************************************************/
- /* public */
- Synchronize::Synchronize( CRITICAL_SECTION &criticalSection ) :
- m_block( criticalSection )
- {
- EnterCriticalSection( &m_block );
-
- } // ctor
-
-
- /***************************************************************************************
- * Method:
- *
- *
- * Purpose:
- *
- *
- * Parameters:
- *
- *
- * Return value:
- *
- *
- * Notes:
- *
- ***************************************************************************************/
- /* public */
- Synchronize::~Synchronize()
- {
- LeaveCriticalSection( &m_block );
-
- } // dtor
-
- // End of File
-