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.

107 lines
5.4 KiB

  1. // --------------------------------------------------------------------------------
  2. // TaskUtil.h
  3. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // Steven J. Bailey
  5. // --------------------------------------------------------------------------------
  6. #ifndef __TASKUTIL_H
  7. #define __TASKUTIL_H
  8. // --------------------------------------------------------------------------------
  9. // Includes
  10. // --------------------------------------------------------------------------------
  11. #include "spoolapi.h"
  12. // --------------------------------------------------------------------------------
  13. // Constants
  14. // --------------------------------------------------------------------------------
  15. const EVENTID INVALID_EVENT = -1;
  16. // --------------------------------------------------------------------------------
  17. // LOADSTRING
  18. // --------------------------------------------------------------------------------
  19. #define LOADSTRING(_idsString, _szDest) \
  20. SideAssert(LoadString(g_hLocRes, _idsString, _szDest, ARRAYSIZE(_szDest)) > 0)
  21. #define CCHMAX_RES 255
  22. // --------------------------------------------------------------------------------
  23. // TASKRESULTTYPE
  24. // --------------------------------------------------------------------------------
  25. typedef enum tagTASKRESULTTYPE {
  26. TASKRESULT_SUCCESS, // No problem
  27. TASKRESULT_FAILURE, // Fatal results in disconnect
  28. TASKRESULT_EVENTFAILED // An item or event failed
  29. } TASKRESULTTYPE;
  30. // ------------------------------------------------------------------------------------
  31. // TIMEOUTINFO
  32. // ------------------------------------------------------------------------------------
  33. typedef struct tagTIMEOUTINFO {
  34. DWORD dwTimeout;
  35. LPCSTR pszServer;
  36. LPCSTR pszAccount;
  37. LPCSTR pszProtocol;
  38. ITimeoutCallback *pCallback;
  39. } TIMEOUTINFO, *LPTIMEOUTINFO;
  40. // --------------------------------------------------------------------------------
  41. // TASKERROR
  42. // --------------------------------------------------------------------------------
  43. typedef struct tagTASKERROR {
  44. HRESULT hrResult;
  45. ULONG ulStringId;
  46. LPCSTR pszError;
  47. BOOL fShowUI;
  48. TASKRESULTTYPE tyResult;
  49. } TASKERROR, *LPTASKERROR;
  50. typedef TASKERROR const *LPCTASKERROR;
  51. // --------------------------------------------------------------------------------
  52. // PTaskUtil_GetError
  53. // --------------------------------------------------------------------------------
  54. LPCTASKERROR PTaskUtil_GetError(HRESULT hrResult, ULONG *piError);
  55. // --------------------------------------------------------------------------------
  56. // TaskUtil_SplitStoreError - converts STOREERROR into IXPRESULT and INETSERVER
  57. // --------------------------------------------------------------------------------
  58. void TaskUtil_SplitStoreError(IXPRESULT *pixpResult, INETSERVER *pInetServer,
  59. STOREERROR *pErrorInfo);
  60. // --------------------------------------------------------------------------------
  61. // TaskUtil_InsertTransportError
  62. // --------------------------------------------------------------------------------
  63. TASKRESULTTYPE TaskUtil_InsertTransportError(BOOL fCanShowUI, ISpoolerUI *pUI, EVENTID eidCurrent,
  64. STOREERROR *pErrorInfo, LPSTR pszOpDescription,
  65. LPSTR pszSubject);
  66. // --------------------------------------------------------------------------------
  67. // TaskUtil_FBaseTransportError - Returns TRUE if the error was handled
  68. // --------------------------------------------------------------------------------
  69. TASKRESULTTYPE TaskUtil_FBaseTransportError(IXPTYPE ixptype, EVENTID idEvent, LPIXPRESULT pResult,
  70. LPINETSERVER pServer, LPCSTR pszSubject, ISpoolerUI *pUI, BOOL fCanShowUI, HWND hwndParent);
  71. // ------------------------------------------------------------------------------------
  72. // TaskUtil_HrBuildErrorInfoString
  73. // ------------------------------------------------------------------------------------
  74. HRESULT TaskUtil_HrBuildErrorInfoString(LPCSTR pszProblem, IXPTYPE ixptype, LPIXPRESULT pResult,
  75. LPINETSERVER pServer, LPCSTR pszSubject, LPSTR *ppszInfo, ULONG *pcchInfo);
  76. // ------------------------------------------------------------------------------------
  77. // TaskUtil_OnLogonPrompt
  78. // ------------------------------------------------------------------------------------
  79. HRESULT TaskUtil_OnLogonPrompt(IImnAccount *pAccount, ISpoolerUI *pUI, HWND hwndParent,
  80. LPINETSERVER pServer, DWORD apidUserName, DWORD apidPassword, DWORD apidPromptPwd, BOOL fSaveChanges);
  81. // ------------------------------------------------------------------------------------
  82. // TaskUtil_HwndOnTimeout
  83. // ------------------------------------------------------------------------------------
  84. HWND TaskUtil_HwndOnTimeout(LPCSTR pszServer, LPCSTR pszAccount, LPCSTR pszProtocol, DWORD dwTimeout,
  85. ITimeoutCallback *pTask);
  86. // ------------------------------------------------------------------------------------
  87. // TaskUtil_OpenSentItemsFolder
  88. // ------------------------------------------------------------------------------------
  89. HRESULT TaskUtil_OpenSentItemsFolder(IImnAccount *pAccount, IMessageFolder **ppFolder);
  90. #endif // __TASKUTIL_H