Cosmetic changes to code.

This commit is contained in:
Birunthan Mohanathas
2011-03-29 19:21:57 +00:00
parent 5882f12c49
commit a92bdd9b18
65 changed files with 1642 additions and 1642 deletions

View File

@ -19,65 +19,65 @@
#include "makeptr.h"
CPerfObjectList::CPerfObjectList(
CPerfSnapshot * const pPerfSnapshot,
CPerfTitleDatabase * const pPerfTitleDatabase )
CPerfSnapshot * const pPerfSnapshot,
CPerfTitleDatabase * const pPerfTitleDatabase )
{
m_pPerfSnapshot = pPerfSnapshot;
m_pPerfCounterTitles = pPerfTitleDatabase;
m_pPerfSnapshot = pPerfSnapshot;
m_pPerfCounterTitles = pPerfTitleDatabase;
}
CPerfObject *
CPerfObjectList::GetFirstPerfObject( void )
{
m_currentObjectListIndex = 0;
if ( m_currentObjectListIndex >= m_pPerfSnapshot->GetNumObjectTypes() )
return 0;
m_currentObjectListIndex = 0;
if ( m_currentObjectListIndex >= m_pPerfSnapshot->GetNumObjectTypes() )
return 0;
m_pCurrObjectType =
(PPERF_OBJECT_TYPE)m_pPerfSnapshot->GetPostHeaderPointer();
m_pCurrObjectType =
(PPERF_OBJECT_TYPE)m_pPerfSnapshot->GetPostHeaderPointer();
return new CPerfObject( m_pCurrObjectType, m_pPerfCounterTitles );
return new CPerfObject( m_pCurrObjectType, m_pPerfCounterTitles );
}
CPerfObject *
CPerfObjectList::GetNextPerfObject( void )
{
// Are we at the last object in the list? Return NULL if so.
if ( ++m_currentObjectListIndex >= m_pPerfSnapshot->GetNumObjectTypes() )
return 0;
// Are we at the last object in the list? Return NULL if so.
if ( ++m_currentObjectListIndex >= m_pPerfSnapshot->GetNumObjectTypes() )
return 0;
// Advance to the next PERF_OBJECT_TYPE structure
m_pCurrObjectType = MakePtr(PPERF_OBJECT_TYPE,
m_pCurrObjectType,
m_pCurrObjectType->TotalByteLength );
return new CPerfObject( m_pCurrObjectType, m_pPerfCounterTitles );
// Advance to the next PERF_OBJECT_TYPE structure
m_pCurrObjectType = MakePtr(PPERF_OBJECT_TYPE,
m_pCurrObjectType,
m_pCurrObjectType->TotalByteLength );
return new CPerfObject( m_pCurrObjectType, m_pPerfCounterTitles );
}
CPerfObject *
CPerfObjectList::GetPerfObject( PCTSTR const pszObjListName )
{
DWORD objListIdx
= m_pPerfCounterTitles->GetIndexFromTitleString( pszObjListName );
if ( 0 == objListIdx )
return 0;
DWORD objListIdx
= m_pPerfCounterTitles->GetIndexFromTitleString( pszObjListName );
if ( 0 == objListIdx )
return 0;
// Point at first PERF_OBJECT_TYPE, and loop through the list, looking
// for one that matches.
PPERF_OBJECT_TYPE pCurrObjectType =
(PPERF_OBJECT_TYPE)m_pPerfSnapshot->GetPostHeaderPointer();
// Point at first PERF_OBJECT_TYPE, and loop through the list, looking
// for one that matches.
PPERF_OBJECT_TYPE pCurrObjectType =
(PPERF_OBJECT_TYPE)m_pPerfSnapshot->GetPostHeaderPointer();
for ( unsigned i=0; i < m_pPerfSnapshot->GetNumObjectTypes(); i++ )
{
// Is this the one that matches?
if ( pCurrObjectType->ObjectNameTitleIndex == objListIdx )
return new CPerfObject(pCurrObjectType, m_pPerfCounterTitles);
for ( unsigned i=0; i < m_pPerfSnapshot->GetNumObjectTypes(); i++ )
{
// Is this the one that matches?
if ( pCurrObjectType->ObjectNameTitleIndex == objListIdx )
return new CPerfObject(pCurrObjectType, m_pPerfCounterTitles);
// Nope... try the next object type
pCurrObjectType = MakePtr( PPERF_OBJECT_TYPE,
pCurrObjectType,
pCurrObjectType->TotalByteLength );
}
return 0;
// Nope... try the next object type
pCurrObjectType = MakePtr( PPERF_OBJECT_TYPE,
pCurrObjectType,
pCurrObjectType->TotalByteLength );
}
return 0;
}