windows-nt/Source/XPSP1/NT/admin/wmi/wbem/scripting/error.h
2020-09-26 16:20:57 +08:00

62 lines
1.2 KiB
C++

//***************************************************************************
//
// Copyright (c) 1998-1999 Microsoft Corporation
//
// error.h
//
// alanbos 29-Jun-98 Created.
//
// Error record handling object
//
//***************************************************************************
#ifndef _ERROR_H_
#define _ERROR_H_
//***************************************************************************
//
// CLASS NAME:
//
// CWbemErrorCache
//
// DESCRIPTION:
//
// Holds WBEM-style "last errors" on threads
//
//***************************************************************************
class CWbemErrorCache
{
private:
CRITICAL_SECTION m_cs;
typedef struct ThreadError
{
ThreadError *pNext;
ThreadError *pPrev;
DWORD dwThreadId;
COAUTHIDENTITY *pCoAuthIdentity;
BSTR strAuthority;
BSTR strPrincipal;
BSTR strNamespacePath;
IWbemServices *pService;
IWbemClassObject *pErrorObject;
} ThreadError;
ThreadError *headPtr;
public:
CWbemErrorCache ();
virtual ~CWbemErrorCache ();
CSWbemObject *GetAndResetCurrentThreadError ();
void SetCurrentThreadError (CSWbemServices *pService);
void ResetCurrentThreadError ();
};
#endif