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.

176 lines
5.4 KiB

  1. #ifndef _WABSPI_H_
  2. #define _WABSPI_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. // WAB object types
  7. #define RECORD_CONTACT 0x00000001
  8. #define RECORD_DISTLIST 0x00000002
  9. #define RECORD_CONTAINER 0x00000003
  10. //Flags used in property-type record searching (independent of property data)
  11. #define AB_MATCH_PROP_ONLY 0x00000001
  12. /**Flags used for calling find HrFindFuzzyRecordMatches**/
  13. #define AB_FUZZY_FAIL_AMBIGUOUS 0x0000001
  14. #define AB_FUZZY_FIND_NAME 0x0000010
  15. #define AB_FUZZY_FIND_EMAIL 0x0000100
  16. #define AB_FUZZY_FIND_ALIAS 0x0001000
  17. #define AB_FUZZY_FIND_ALL AB_FUZZY_FIND_NAME | AB_FUZZY_FIND_EMAIL | AB_FUZZY_FIND_ALIAS
  18. // Container info struct
  19. typedef struct _OutlookContInfo
  20. {
  21. LPSBinary lpEntryID;
  22. LPSTR lpszName;
  23. } OutlookContInfo;
  24. // Container info struct - we need a LPTSTR version for the WAB
  25. typedef struct _OlkContInfo
  26. {
  27. LPSBinary lpEntryID;
  28. LPTSTR lpszName;
  29. } OlkContInfo;
  30. /* IWABStorageProvider Interface ---------------------------------------------------- */
  31. #define CBIWABSTORAGEPROVIDER sizeof(IWABSTORAGEPROVIDER)
  32. #define WAB_IWABSTORAGEPROVIDER_METHODS(IPURE) \
  33. MAPIMETHOD(GetContainerList) \
  34. (THIS_ LPULONG lpulcCount, \
  35. OutlookContInfo **prgolkci) IPURE; \
  36. MAPIMETHOD(ReadRecord) \
  37. (THIS_ LPSBinary lpEntryID, \
  38. ULONG ulFlags, \
  39. LPULONG lpulcProps, \
  40. LPSPropValue *lppPropArray) IPURE; \
  41. MAPIMETHOD(WriteRecord) \
  42. (THIS_ LPSBinary lpFolderID, \
  43. LPSBinary *lppEntryID, \
  44. ULONG ulFlags, \
  45. ULONG ulRecordType, \
  46. ULONG ulcProps, \
  47. LPSPropValue lpPropArray) IPURE; \
  48. MAPIMETHOD(ReadPropArray) \
  49. (THIS_ LPSBinary lpFolderID, \
  50. SPropertyRestriction *lpPropRes, \
  51. ULONG ulFlags, \
  52. ULONG ulPropTagCount, \
  53. LPULONG lpPropTagArray, \
  54. LPADRLIST *lppContentList) IPURE; \
  55. MAPIMETHOD(FindRecords) \
  56. (THIS_ LPSBinary lpFolderID, \
  57. ULONG ulFlags, \
  58. SPropertyRestriction *lpPropRes, \
  59. LPULONG lpulcCount, \
  60. LPSBinary *rgEntryIDs) IPURE; \
  61. MAPIMETHOD(DeleteRecord) \
  62. (THIS_ LPSBinary lpEntryID) IPURE; \
  63. MAPIMETHOD(GetContentsTable) \
  64. (THIS_ LPSBinary lpFolderID, \
  65. ULONG ulFlags, \
  66. LPMAPITABLE *lppTable) IPURE; \
  67. MAPIMETHOD(FindFuzzyRecordMatches) \
  68. (THIS_ LPSBinary lpFolderID, \
  69. LPSTR lpszDisplayName, \
  70. ULONG ulFlags, \
  71. LPULONG lpulcCount, \
  72. LPSBinary *rgEntryIDs) IPURE; \
  73. MAPIMETHOD(GetIDsFromNames) \
  74. (THIS_ ULONG cPropNames, \
  75. LPMAPINAMEID *lppPropNames, \
  76. ULONG ulFlags, \
  77. LPSPropTagArray *lppPropTags) IPURE; \
  78. MAPIMETHOD(ReadMessage) \
  79. (THIS_ LPMESSAGE pmess, \
  80. LPULONG lpulcProps, \
  81. LPSPropValue *lppPropArray) IPURE; \
  82. MAPIMETHOD(CreateRecord) \
  83. (THIS_ LPSBinary lpFolderID, \
  84. ULONG ulcProps, \
  85. LPSPropValue lpPropArray, \
  86. IMessage **lppMessage) IPURE; \
  87. MAPIMETHOD(FreeEntryIDs) \
  88. (THIS_ ULONG ulcCount, \
  89. LPSBinary rgEntryIDs) IPURE; \
  90. MAPIMETHOD(FreePropArray) \
  91. (THIS_ ULONG ulcProps, \
  92. LPSPropValue lpPropArray) IPURE; \
  93. MAPIMETHOD(FreeContentList) \
  94. (THIS_ LPADRLIST lpContentList) IPURE; \
  95. #undef INTERFACE
  96. #define INTERFACE IWABStorageProvider
  97. DECLARE_MAPI_INTERFACE_(IWABStorageProvider, IUnknown)
  98. {
  99. BEGIN_INTERFACE
  100. MAPI_IUNKNOWN_METHODS(PURE)
  101. WAB_IWABSTORAGEPROVIDER_METHODS(PURE)
  102. };
  103. DECLARE_MAPI_INTERFACE_PTR(IWABStorageProvider, LPWABSTORAGEPROVIDER);
  104. #undef INTERFACE
  105. #define INTERFACE struct _IWABSTORAGEPROVIDER
  106. #undef METHOD_PREFIX
  107. #define METHOD_PREFIX IWABSTORAGEPROVIDER_
  108. #undef LPVTBL_ELEM
  109. #define LPVTBL_ELEM lpvtbl
  110. #undef MAPIMETHOD_
  111. #define MAPIMETHOD_(type, method) MAPIMETHOD_DECLARE(type, method, IWABSTORAGEPROVIDER_)
  112. MAPI_IUNKNOWN_METHODS(IMPL)
  113. WAB_IWABSTORAGEPROVIDER_METHODS(IMPL)
  114. #undef MAPIMETHOD_
  115. #define MAPIMETHOD_(type, method) MAPIMETHOD_TYPEDEF(type, method, IWABSTORAGEPROVIDER_)
  116. MAPI_IUNKNOWN_METHODS(IMPL)
  117. WAB_IWABSTORAGEPROVIDER_METHODS(IMPL)
  118. #undef MAPIMETHOD_
  119. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  120. DECLARE_MAPI_INTERFACE(IWABSTORAGEPROVIDER_)
  121. {
  122. BEGIN_INTERFACE
  123. MAPI_IUNKNOWN_METHODS(IMPL)
  124. WAB_IWABSTORAGEPROVIDER_METHODS(IMPL)
  125. };
  126. //
  127. // Root public entry point for WAB SPI
  128. //
  129. STDMETHODIMP WABOpenStorageProvider(HWND hwnd, LPUNKNOWN pmsess,
  130. LPALLOCATEBUFFER lpAllocateBuffer, LPALLOCATEMORE lpAllocateMore,
  131. LPFREEBUFFER lpFreeBuffer, BOOL fUnicode,
  132. LPWABSTORAGEPROVIDER FAR * lppWSP);
  133. typedef HRESULT (STDMETHODCALLTYPE WABOPENSTORAGEPROVIDER)(
  134. HWND hwnd,
  135. LPUNKNOWN pmsess,
  136. LPALLOCATEBUFFER lpAllocateBuffer,
  137. LPALLOCATEMORE lpAllocateMore,
  138. LPFREEBUFFER lpFreeBuffer,
  139. BOOL fUnicode,
  140. LPWABSTORAGEPROVIDER FAR * lppWSP
  141. );
  142. typedef WABOPENSTORAGEPROVIDER FAR * LPWABOPENSTORAGEPROVIDER;
  143. #define OUTLWAB_DLL_NAME "OUTLWAB.DLL"
  144. #define WAB_SPI_ENTRY_POINT "WABOpenStorageProvider"
  145. #define WAB_SPI_ENTRY_POINT_W "WABOpenStorageProviderW"
  146. #ifdef __cplusplus
  147. }
  148. #endif
  149. #endif /* _WABSPI_H */