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.

181 lines
5.4 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. ptable.h
  5. Abstract:
  6. This module contains the export of the property table
  7. Author:
  8. Keith Lau (keithlau@microsoft.com)
  9. Revision History:
  10. keithlau 07/05/97 created
  11. --*/
  12. #ifndef _PTABLE_H_
  13. #define _PTABLE_H_
  14. #include "props.h"
  15. // Enumerated type for HP access of individual properties
  16. typedef enum _MSG_PTABLE_ITEMS
  17. {
  18. _PI_MSG_CLIENT_DOMAIN = 0,
  19. _PI_MSG_CLIENT_IP,
  20. _PI_MSG_MAIL_FROM,
  21. _PI_MSG_MSG_STATUS,
  22. _PI_MSG_MSG_STREAM,
  23. _PI_MSG_RCPT_TO,
  24. _PI_MSG_SERVER_IP,
  25. _PI_MSG_MAX_PI
  26. } MSG_PTABLE_ITEMS;
  27. typedef enum _DEL_PTABLE_ITEMS
  28. {
  29. _PI_DEL_CLIENT_DOMAIN = 0,
  30. _PI_DEL_CLIENT_IP,
  31. _PI_DEL_CURRENT_RCPT,
  32. _PI_DEL_MAIL_FROM,
  33. _PI_DEL_MAILBOX_PATH,
  34. _PI_DEL_MSG_STATUS,
  35. _PI_DEL_MSG_STREAM,
  36. _PI_DEL_RCPT_TO,
  37. _PI_DEL_SECURITY_TOKEN,
  38. _PI_DEL_SERVER_IP,
  39. _PI_DEL_MAX_PI
  40. } DEL_PTABLE_ITEMS;
  41. extern char *rgszMessagePropertyNames[_PI_MSG_MAX_PI];
  42. extern char *rgszDeliveryPropertyNames[_PI_DEL_MAX_PI];
  43. //
  44. // CGenericPTable and CGenericCache are all defined in props.h
  45. //
  46. class CPerMessageCache : public CGenericCache
  47. {
  48. public:
  49. CPerMessageCache(LPVOID pvDefaultContext) : CGenericCache(pvDefaultContext)
  50. {
  51. m_rgpdMessagePropertyData[0].pContext = NULL;
  52. m_rgpdMessagePropertyData[0].pCacheData = (LPVOID)&m_psClientDomain;
  53. m_rgpdMessagePropertyData[1].pContext = NULL;
  54. m_rgpdMessagePropertyData[1].pCacheData = (LPVOID)&m_psClientIP;
  55. m_rgpdMessagePropertyData[2].pContext = NULL;
  56. m_rgpdMessagePropertyData[2].pCacheData = (LPVOID)&m_psMailFrom;
  57. m_rgpdMessagePropertyData[3].pContext = NULL;
  58. m_rgpdMessagePropertyData[3].pCacheData = (LPVOID)&m_pdMsgStatus;
  59. m_rgpdMessagePropertyData[4].pContext = NULL;
  60. m_rgpdMessagePropertyData[4].pCacheData = (LPVOID)&m_pdStream;
  61. m_rgpdMessagePropertyData[5].pContext = NULL;
  62. m_rgpdMessagePropertyData[5].pCacheData = (LPVOID)&m_psRcptTo;
  63. m_rgpdMessagePropertyData[6].pContext = NULL;
  64. m_rgpdMessagePropertyData[6].pCacheData = (LPVOID)&m_psServerIP;
  65. // Default context
  66. m_rgpdMessagePropertyData[7].pContext = pvDefaultContext;
  67. m_rgpdMessagePropertyData[7].pCacheData = pvDefaultContext;
  68. }
  69. ~CPerMessageCache() {}
  70. LPPROPERTY_DATA GetCacheBlock() { return(m_rgpdMessagePropertyData); }
  71. private:
  72. CPropertyValueDWORD m_pdStream; // IStream to message file
  73. CPropertyValueDWORD m_pdMsgStatus; // Message status
  74. CPropertyValueString m_psMailFrom; // Mail from string
  75. CPropertyValueString m_psRcptTo; // Rcpt to (MULTISZ)
  76. CPropertyValueString m_psClientDomain; // Client domain per EHLO
  77. CPropertyValueString m_psClientIP; // Client IP address
  78. CPropertyValueString m_psServerIP; // Server IP address
  79. // The extra slot is for the default accessor
  80. PROPERTY_DATA m_rgpdMessagePropertyData[_PI_MSG_MAX_PI + 1];
  81. };
  82. class CPerRecipientCache : public CGenericCache
  83. {
  84. public:
  85. CPerRecipientCache(LPVOID pvDefaultContext) : CGenericCache(pvDefaultContext)
  86. {
  87. m_rgpdRecipientPropertyData[0].pContext = NULL;
  88. m_rgpdRecipientPropertyData[0].pCacheData = (LPVOID)&m_psClientDomain;
  89. m_rgpdRecipientPropertyData[1].pContext = NULL;
  90. m_rgpdRecipientPropertyData[1].pCacheData = (LPVOID)&m_psClientIP;
  91. m_rgpdRecipientPropertyData[2].pContext = NULL;
  92. m_rgpdRecipientPropertyData[2].pCacheData = (LPVOID)&m_psCurrentRcpt;
  93. m_rgpdRecipientPropertyData[3].pContext = NULL;
  94. m_rgpdRecipientPropertyData[3].pCacheData = (LPVOID)&m_psMailFrom;
  95. m_rgpdRecipientPropertyData[4].pContext = NULL;
  96. m_rgpdRecipientPropertyData[4].pCacheData = (LPVOID)&m_psMailboxPath;
  97. m_rgpdRecipientPropertyData[5].pContext = NULL;
  98. m_rgpdRecipientPropertyData[5].pCacheData = (LPVOID)&m_pdMsgStatus;
  99. m_rgpdRecipientPropertyData[6].pContext = NULL;
  100. m_rgpdRecipientPropertyData[6].pCacheData = (LPVOID)&m_pdStream;
  101. m_rgpdRecipientPropertyData[7].pContext = NULL;
  102. m_rgpdRecipientPropertyData[7].pCacheData = (LPVOID)&m_psRcptTo;
  103. m_rgpdRecipientPropertyData[8].pContext = NULL;
  104. m_rgpdRecipientPropertyData[8].pCacheData = (LPVOID)&m_pdSecurityToken;
  105. m_rgpdRecipientPropertyData[9].pContext = NULL;
  106. m_rgpdRecipientPropertyData[9].pCacheData = (LPVOID)&m_psServerIP;
  107. // Default context
  108. m_rgpdRecipientPropertyData[10].pContext = pvDefaultContext;
  109. m_rgpdRecipientPropertyData[10].pCacheData = pvDefaultContext;
  110. }
  111. ~CPerRecipientCache() {}
  112. LPPROPERTY_DATA GetCacheBlock() { return(m_rgpdRecipientPropertyData); }
  113. private:
  114. CPropertyValueDWORD m_pdStream; // IStream to message file
  115. CPropertyValueDWORD m_pdMsgStatus; // Message status
  116. CPropertyValueDWORD m_pdSecurityToken; // hImpersonation
  117. CPropertyValueString m_psMailFrom; // Mail from string
  118. CPropertyValueString m_psMailboxPath; // Mailbox path
  119. CPropertyValueString m_psRcptTo; // Rcpt to (MULTISZ)
  120. CPropertyValueString m_psClientDomain; // Client domain per EHLO
  121. CPropertyValueString m_psClientIP; // Client IP address
  122. CPropertyValueString m_psCurrentRcpt; // Current recipient
  123. CPropertyValueString m_psServerIP; // Server IP address
  124. // The extra slot is for the default accessor
  125. PROPERTY_DATA m_rgpdRecipientPropertyData[_PI_DEL_MAX_PI + 1];
  126. };
  127. class CMessagePTable : public CGenericPTable
  128. {
  129. public:
  130. CMessagePTable(CGenericCache *pCache);
  131. ~CMessagePTable() {}
  132. LPPTABLE GetPTable() { return(&m_PTable); }
  133. private:
  134. PTABLE m_PTable;
  135. };
  136. class CDeliveryPTable : public CGenericPTable
  137. {
  138. public:
  139. CDeliveryPTable(CGenericCache *pCache);
  140. ~CDeliveryPTable() {}
  141. LPPTABLE GetPTable() { return(&m_PTable); }
  142. private:
  143. PTABLE m_PTable;
  144. };
  145. #endif