Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.2 KiB

// scuExcHelp.h -- Exception helper for clients defining exceptions
// (c) Copyright Schlumberger Technology Corp., unpublished work, created
// 1999. This computer program includes Confidential, Proprietary
// Information and is a Trade Secret of Schlumberger Technology Corp. All
// use, disclosure, and/or reproduction is prohibited unless authorized
// in writing. All Rights Reserved.
#if !defined(SCU_EXCHELP_H)
#define SCU_EXCHELP_H
#include <string>
#include <wtypes.h>
namespace scu
{
template<class CauseCode>
struct CauseCodeDescriptionTable
{
typename CauseCode m_cc;
LPCTSTR m_lpDescription;
};
template<class CauseCode>
LPCTSTR
FindDescription(typename CauseCode cc,
CauseCodeDescriptionTable<typename CauseCode> const *ccdt,
size_t cTableLength)
{
bool fFound = false;
LPCTSTR lpDescription = 0;
for (size_t i = 0; !fFound && (i < cTableLength); i++)
{
if (cc == ccdt[i].m_cc)
{
lpDescription = ccdt[i].m_lpDescription;
fFound = true;
}
}
return lpDescription;
}
} // namespace scu
#endif // SCU_EXCHELP_H