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.

90 lines
2.3 KiB

  1. /*
  2. File error.h
  3. Implements the error display/handling mechanisms used by the Ras Server
  4. UI for connections.
  5. 10/20/97
  6. */
  7. #include "rassrv.h"
  8. // Sends trace information
  9. DWORD DbgOutputTrace (LPSTR pszTrace, ...) {
  10. va_list arglist;
  11. char szBuffer[1024], szTemp[1024];
  12. va_start(arglist, pszTrace);
  13. vsprintf(szTemp, pszTrace, arglist);
  14. va_end(arglist);
  15. sprintf(szBuffer, "RasSrvUi: %s", szTemp);
  16. TRACE(szBuffer);
  17. ErrOutputDebugger(szBuffer);
  18. return NO_ERROR;
  19. }
  20. // Sends debug output to a debugger terminal
  21. DWORD ErrOutputDebugger (LPSTR szError) {
  22. #if DBG
  23. OutputDebugStringA(szError);
  24. OutputDebugStringA("\n");
  25. #endif
  26. return NO_ERROR;
  27. }
  28. // Sets error information for the user tab catagory
  29. DWORD ErrUserCatagory(DWORD dwSubCatagory, DWORD dwErrCode, DWORD dwData) {
  30. return dwErrCode;
  31. }
  32. // Displays the error for the given catagory, subcatagory, and code. The
  33. // parameters define what error messages are loaded from the resources
  34. // of this project.
  35. DWORD ErrDisplayError (HWND hwndParent,
  36. DWORD dwErrCode,
  37. DWORD dwCatagory,
  38. DWORD dwSubCatagory,
  39. DWORD dwData) {
  40. BOOL bDisplay = TRUE;
  41. DWORD dwMessage, dwTitle;
  42. PWCHAR pszMessage, pszTitle;
  43. switch (dwCatagory) {
  44. case ERR_QUEUE_CATAGORY:
  45. case ERR_GLOBAL_CATAGORY:
  46. case ERR_RASSRV_CATAGORY:
  47. case ERR_MULTILINK_CATAGORY:
  48. case ERR_GENERIC_CATAGORY:
  49. case ERR_GENERALTAB_CATAGORY:
  50. case ERR_ADVANCEDTAB_CATAGORY:
  51. case ERR_IPXPROP_CATAGORY:
  52. case ERR_TCPIPPROP_CATAGORY:
  53. dwMessage = dwErrCode;
  54. break;
  55. case ERR_USERTAB_CATAGORY:
  56. dwMessage = ErrUserCatagory(dwSubCatagory, dwErrCode, dwData);
  57. break;
  58. }
  59. if (bDisplay) {
  60. dwTitle = dwCatagory;
  61. pszMessage = (PWCHAR) PszLoadString(Globals.hInstDll, dwMessage);
  62. pszTitle = (PWCHAR) PszLoadString(Globals.hInstDll, dwTitle);
  63. MessageBoxW(hwndParent,
  64. pszMessage,
  65. pszTitle,
  66. MB_OK | MB_ICONERROR | MB_APPLMODAL);
  67. }
  68. return NO_ERROR;
  69. }