Source code of Windows XP (NT5)
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.

69 lines
3.0 KiB

  1. /*
  2. +-------------------------------------------------------------------------+
  3. | Error Handling Routines |
  4. +-------------------------------------------------------------------------+
  5. | (c) Copyright 1993-1994 |
  6. | Microsoft Corp. |
  7. | All rights reserved |
  8. | |
  9. | Program : [Error.c] |
  10. | Programmer : Arthur Hanson |
  11. | Original Program Date : [Jul 27, 1993] |
  12. | Last Update : [Jun 18, 1994] |
  13. | |
  14. | Version: 1.00 |
  15. | |
  16. | Description: |
  17. | |
  18. | History: |
  19. | arth Jun 18, 1994 1.00 Original Version. |
  20. | |
  21. +-------------------------------------------------------------------------+
  22. */
  23. #include "globals.h"
  24. /*+-------------------------------------------------------------------------+
  25. | CriticalErrorExit()
  26. |
  27. | This should only be called when there is an unrecoverable error and
  28. | the program must abort (such as running out of disk space on main
  29. | system or out of memory).
  30. |
  31. | Can't dynamically load the error string (must do this at program
  32. | init), because at time or error we might not be able to load it!
  33. |
  34. +-------------------------------------------------------------------------+*/
  35. void CriticalErrorExit(LPTSTR ErrorString) {
  36. MessageBox(NULL, ErrorString, Lids(IDS_E_1), MB_ICONHAND | MB_SYSTEMMODAL | MB_OK);
  37. exit(0);
  38. } // CriticalErrorExit
  39. /*+-------------------------------------------------------------------------+
  40. | WarningError()
  41. |
  42. | Pops up a warning message to the user - this should only be used
  43. | when the user must be notified of something (the program stops until
  44. | the user responds), but it is not so critical the the program has to
  45. | abort.
  46. |
  47. | An example of this is if a config file is corrupt and the program
  48. | will ignore it.
  49. |
  50. +-------------------------------------------------------------------------+*/
  51. void WarningError(LPTSTR ErrorString, ...) {
  52. static TCHAR tmpStr[TMP_STR_LEN_256];
  53. va_list marker;
  54. va_start(marker, ErrorString);
  55. wvsprintf(tmpStr, ErrorString, marker);
  56. MessageBox(NULL, tmpStr, Lids(IDS_E_2), MB_ICONHAND | MB_OK);
  57. va_end(marker);
  58. } // WarningError