windows-nt/Source/XPSP1/NT/shell/themes/inc/errors.h

34 lines
1.6 KiB
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
//---------------------------------------------------------------------------
// errors.h - support for creating and reporting errors
//---------------------------------------------------------------------------
#pragma once
//---------------------------------------------------------------------------
#ifndef ERRORS_H
#define ERRORS_H
//---------------------------------------------------------------------------
typedef struct // records theme api's last error return code
{
DWORD dwParseErrCode;
WCHAR szMsgParam1[MAX_PATH];
WCHAR szMsgParam2[MAX_PATH];
WCHAR szFileName[MAX_PATH];
WCHAR szSourceLine[MAX_PATH];
int iLineNum;
} TMERRINFO;
//---------------------------------------------------------------------------
extern DWORD _tls_ErrorInfoIndex;
//---------------------------------------------------------------------------
TMERRINFO *GetParseErrorInfo(BOOL fOkToCreate);
HRESULT MakeParseError(DWORD dwParseErrCode, OPTIONAL LPCWSTR pszMsgParam1=NULL, OPTIONAL LPCWSTR pszMsgParam2=NULL,
OPTIONAL LPCWSTR pszSourceName=NULL, OPTIONAL LPCWSTR pszSourceLine=NULL, int iLineNum=0);
//---------------------------------------------------------------------------
#define WIN32_EXIT(code) if (code) {hr=HRESULT_FROM_WIN32(code); goto exit;} else
#define SET_LAST_ERROR(hr) SetLastError((DWORD) hr)
//---------------------------------------------------------------------------
HRESULT MakeError32(HRESULT hr);
HRESULT MakeErrorLast();
HRESULT MakeErrorParserLast();
//---------------------------------------------------------------------------
#endif