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.

48 lines
2.3 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : Helper.h //
  3. // //
  4. // DESCRIPTION : Prototype of some helper functions. //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Jun 2 1999 yossg add CHECK_RETURN_VALUE_AND_PRINT_DEBUG //
  10. // //
  11. // Copyright (C) 1999 Microsoft Corporation All Rights Reserved //
  12. /////////////////////////////////////////////////////////////////////////////
  13. #ifndef H_HELPER_H
  14. #define H_HELPER_H
  15. int DlgMsgBox(CWindow *pWin, int ids, UINT nType = MB_OK);
  16. // required:
  17. // * to be called after decleration of
  18. // DEBUG_FUNCTION_NAME( _T("CClass::FuncName"));
  19. // * hRc the Name of HRESULT
  20. // * _str - string for DPF = _T("CClass::FuncName")
  21. // * exit point will be called -- Cleanup:
  22. //
  23. #define CHECK_RETURN_VALUE_AND_PRINT_DEBUG(_str) \
  24. { \
  25. if (FAILED (hRc)) \
  26. { \
  27. DebugPrintEx(DEBUG_ERR,_str, hRc); \
  28. goto Cleanup; \
  29. } \
  30. }
  31. #define CHECK_RETURN_VALUE_AND_SEND_NODE_MSGBOX(_ids) \
  32. { \
  33. if (FAILED (hRc)) \
  34. { \
  35. NodeMsgBox(_ids); \
  36. goto Cleanup; \
  37. } \
  38. }
  39. #define CHECK_RET_CLEAN if (FAILED(ret)) goto Cleanup;
  40. #define CHECK_HRC_CLEAN if (FAILED(hRc)) goto Cleanup;
  41. #endif //H_HELPER_H