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.

33 lines
1.6 KiB

  1. //---------------------------------------------------------------------------
  2. // errors.h - support for creating and reporting errors
  3. //---------------------------------------------------------------------------
  4. #pragma once
  5. //---------------------------------------------------------------------------
  6. #ifndef ERRORS_H
  7. #define ERRORS_H
  8. //---------------------------------------------------------------------------
  9. typedef struct // records theme api's last error return code
  10. {
  11. DWORD dwParseErrCode;
  12. WCHAR szMsgParam1[MAX_PATH];
  13. WCHAR szMsgParam2[MAX_PATH];
  14. WCHAR szFileName[MAX_PATH];
  15. WCHAR szSourceLine[MAX_PATH];
  16. int iLineNum;
  17. } TMERRINFO;
  18. //---------------------------------------------------------------------------
  19. extern DWORD _tls_ErrorInfoIndex;
  20. //---------------------------------------------------------------------------
  21. TMERRINFO *GetParseErrorInfo(BOOL fOkToCreate);
  22. HRESULT MakeParseError(DWORD dwParseErrCode, OPTIONAL LPCWSTR pszMsgParam1=NULL, OPTIONAL LPCWSTR pszMsgParam2=NULL,
  23. OPTIONAL LPCWSTR pszSourceName=NULL, OPTIONAL LPCWSTR pszSourceLine=NULL, int iLineNum=0);
  24. //---------------------------------------------------------------------------
  25. #define WIN32_EXIT(code) if (code) {hr=HRESULT_FROM_WIN32(code); goto exit;} else
  26. #define SET_LAST_ERROR(hr) SetLastError((DWORD) hr)
  27. //---------------------------------------------------------------------------
  28. HRESULT MakeError32(HRESULT hr);
  29. HRESULT MakeErrorLast();
  30. HRESULT MakeErrorParserLast();
  31. //---------------------------------------------------------------------------
  32. #endif