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.

378 lines
11 KiB

  1. #include <wtypes.h>
  2. //#include <oaidl.h>
  3. #include <oleauto.h>
  4. #include <mapi.h>
  5. // Structures and Functions used by BMAPI and VB2C
  6. #define RECIPIENT ((USHORT)0x0001)
  7. #define FILE ((USHORT)0x0002)
  8. #define MESSAGE ((USHORT)0x0004)
  9. #define USESAFEARRAY ((USHORT)0x1000)
  10. #if defined (WIN32)
  11. #ifndef BMAPI_ENTRY // PFP
  12. #define BMAPI_ENTRY ULONG FAR PASCAL // define BMAPI_ENTRY PFP
  13. #endif // PFP
  14. #else
  15. #ifndef BMAPI_ENTRY // PFP
  16. #define BMAPI_ENTRY ULONG __export FAR PASCAL // define BMAPI_ENTRY PFP
  17. #endif // PFP
  18. #endif
  19. #ifndef LHANDLE
  20. #define LHANDLE ULONG
  21. #endif
  22. #ifndef ERR
  23. #define ERR USHORT
  24. #endif
  25. //-----------------------------------------------------------------------
  26. // WIN32 definitions of 32 bit VB interface function support
  27. //-----------------------------------------------------------------------
  28. typedef struct
  29. {
  30. ULONG ulReserved;
  31. BSTR bstrSubject;
  32. BSTR bstrNoteText;
  33. BSTR bstrMessageType;
  34. BSTR bstrDate;
  35. BSTR bstrConversationID;
  36. ULONG flFlags;
  37. ULONG nRecipCount;
  38. ULONG nFileCount;
  39. } VB_Message,FAR *lpVB_Message;
  40. typedef VB_Message VB_MESSAGE;
  41. typedef VB_Message FAR *LPVB_MESSAGE;
  42. typedef struct
  43. {
  44. ULONG ulReserved;
  45. ULONG ulRecipClass;
  46. BSTR bstrName;
  47. BSTR bstrAddress;
  48. ULONG ulEIDSize;
  49. BSTR bstrEID;
  50. } VB_Recip,FAR *lpVB_Recip;
  51. typedef VB_Recip VB_RECIPIENT;
  52. typedef VB_Recip FAR *LPVB_RECIPIENT;
  53. typedef struct
  54. {
  55. ULONG ulReserved;
  56. ULONG flFlags;
  57. ULONG nPosition;
  58. BSTR bstrPathName;
  59. BSTR bstrFileName;
  60. BSTR bstrFileType;
  61. } VB_File, FAR *lpVB_File;
  62. /*
  63. // OLEAUT32.DLL loadlib and getprocaddress support
  64. // WINOLEAUTAPI_(void) SysFreeString(BSTR);
  65. typedef VOID (STDAPICALLTYPE *LPFNSYSFREESTRING)
  66. ( BSTR bstr );
  67. // WINOLEAUTAPI_(unsigned int) SysStringByteLen(BSTR bstr);
  68. typedef UINT (STDAPICALLTYPE *LPFNSYSSTRINGBYTELEN)
  69. (BSTR bstr);
  70. // WINOLEAUTAPI_(BSTR) SysAllocString(const OLECHAR FAR*);
  71. typedef BSTR (STDAPICALLTYPE *LPFNSYSALLOCSTRING)
  72. (const OLECHAR * szwString);
  73. // WINOLEAUTAPI_(int) SysReAllocString(BSTR FAR*, const OLECHAR FAR*);
  74. typedef INT (STDAPICALLTYPE *LPFNSYSREALLOCSTRING)
  75. (BSTR * lpBstr, const OLECHAR * szwString);
  76. // WINOLEAUTAPI_(unsigned int) SysStringLen(BSTR);
  77. typedef UINT (STDAPICALLTYPE *LPFNSYSSTRINGLEN)
  78. (BSTR bstr);
  79. // WINOLEAUTAPI SafeArrayAccessData(SAFEARRAY FAR* psa, void HUGEP* FAR* ppvData);
  80. typedef HRESULT (STDAPICALLTYPE *LPFNSAFEARRAYACCESSDATA)
  81. (struct tagSAFEARRAY *psa, void **ppvData);
  82. // WINOLEAUTAPI SafeArrayUnaccessData(SAFEARRAY FAR* psa);
  83. typedef HRESULT (STDAPICALLTYPE *LPFNSAFEARRAYUNACCESSDATA)
  84. (struct tagSAFEARRAY *psa);
  85. extern LPFNSYSFREESTRING lpfnSysFreeString;
  86. extern LPFNSYSSTRINGBYTELEN lpfnSysStringByteLen;
  87. extern LPFNSYSALLOCSTRING lpfnSysAllocString;
  88. extern LPFNSYSREALLOCSTRING lpfnSysReAllocString;
  89. extern LPFNSYSSTRINGLEN lpfnSysStringLen;
  90. extern LPFNSAFEARRAYACCESSDATA lpfnSafeArrayAccessData;
  91. extern LPFNSAFEARRAYUNACCESSDATA lpfnSafeArrayUnaccessData;
  92. #undef SysFreeString
  93. #undef SysStringByteLen
  94. #undef SysAllocString
  95. #undef SysReAllocString
  96. #undef SysStringLen
  97. #undef SafeArrayAccessData
  98. #undef SafeArrayUnaccessData
  99. #define SysFreeString (*lpfnSysFreeString)
  100. #define SysStringByteLen (*lpfnSysStringByteLen)
  101. #define SysAllocString (*lpfnSysAllocString)
  102. #define SysReAllocString (*lpfnSysReAllocString)
  103. #define SysStringLen (*lpfnSysStringLen)
  104. #define SafeArrayAccessData (*lpfnSafeArrayAccessData)
  105. #define SafeArrayUnaccessData (*lpfnSafeArrayUnaccessData)
  106. */
  107. typedef VB_File VB_FILE;
  108. typedef VB_File FAR * LPVB_FILE;
  109. typedef MapiMessage VB_MAPI_MESSAGE;
  110. typedef MapiMessage FAR * LPMAPI_MESSAGE;
  111. typedef LPMAPI_MESSAGE FAR *LPPMAPI_MESSAGE;
  112. typedef MapiRecipDesc MAPI_RECIPIENT;
  113. typedef MapiRecipDesc FAR * LPMAPI_RECIPIENT;
  114. typedef LPMAPI_RECIPIENT FAR *LPPMAPI_RECIPIENT;
  115. typedef MapiFileDesc MAPI_FILE;
  116. typedef MapiFileDesc FAR * LPMAPI_FILE;
  117. typedef LPMAPI_FILE FAR * LPPMAPI_FILE;
  118. typedef HANDLE FAR * LPHANDLE;
  119. typedef VB_File VB_FILE;
  120. typedef VB_File FAR * LPVB_FILE;
  121. typedef MapiMessage VB_MAPI_MESSAGE;
  122. typedef MapiMessage FAR * LPMAPI_MESSAGE;
  123. typedef LPMAPI_MESSAGE FAR *LPPMAPI_MESSAGE;
  124. typedef MapiRecipDesc MAPI_RECIPIENT;
  125. typedef MapiRecipDesc FAR * LPMAPI_RECIPIENT;
  126. typedef LPMAPI_RECIPIENT FAR *LPPMAPI_RECIPIENT;
  127. typedef MapiFileDesc MAPI_FILE;
  128. typedef MapiFileDesc FAR * LPMAPI_FILE;
  129. typedef LPMAPI_FILE FAR * LPPMAPI_FILE;
  130. typedef HANDLE FAR * LPHANDLE;
  131. typedef LPHANDLE FAR * LPPHANDLE;
  132. /*
  133. #if defined WIN32
  134. //-----------------------------------------------------------------------
  135. // WIN32 definitions of 32 bit VB interface functions
  136. //-----------------------------------------------------------------------
  137. BMAPI_ENTRY BMAPISendMail (LHANDLE hSession,
  138. ULONG ulUIParam,
  139. LPVB_MESSAGE lpM,
  140. LPSAFEARRAY * lppsaRecips,
  141. LPSAFEARRAY * lppsaFiles,
  142. ULONG flFlags,
  143. ULONG ulReserved);
  144. BMAPI_ENTRY BMAPIFindNext(LHANDLE hSession,
  145. ULONG ulUIParam,
  146. BSTR * bstrType,
  147. BSTR * bstrSeed,
  148. ULONG flFlags,
  149. ULONG ulReserved,
  150. BSTR * lpbstrId);
  151. BMAPI_ENTRY BMAPIReadMail (LPULONG lpulMessage,
  152. LPULONG nRecips,
  153. LPULONG nFiles,
  154. LHANDLE hSession,
  155. ULONG ulUIParam,
  156. BSTR * lpbstrID,
  157. ULONG flFlags,
  158. ULONG ulReserved);
  159. BMAPI_ENTRY BMAPIGetReadMail(ULONG lpMessage,
  160. LPVB_MESSAGE lpvbMessage,
  161. LPSAFEARRAY * lppsaRecips,
  162. LPSAFEARRAY * lppsaFiles,
  163. LPVB_RECIPIENT lpvbOrig);
  164. BMAPI_ENTRY BMAPISaveMail( LHANDLE hSession,
  165. ULONG ulUIParam,
  166. LPVB_MESSAGE lpM,
  167. LPSAFEARRAY * lppsaRecips,
  168. LPSAFEARRAY * lppsaFiles,
  169. ULONG flFlags,
  170. ULONG ulReserved,
  171. BSTR * lpbstrID);
  172. BMAPI_ENTRY BMAPIAddress (LPULONG lpulRecip,
  173. LHANDLE hSession,
  174. ULONG ulUIParam,
  175. BSTR * lpbstrCaption,
  176. ULONG ulEditFields,
  177. BSTR * lpbstrLabel,
  178. LPULONG lpulRecipients,
  179. LPSAFEARRAY * lppsaRecip, // LPVB_RECIPIENT
  180. ULONG ulFlags,
  181. ULONG ulReserved);
  182. BMAPI_ENTRY BMAPIGetAddress (ULONG ulRecipientData,
  183. ULONG count,
  184. LPSAFEARRAY * lppsaRecips);
  185. BMAPI_ENTRY BMAPIDetails (LHANDLE hSession,
  186. ULONG ulUIParam,
  187. LPVB_RECIPIENT lpVB,
  188. ULONG ulFlags,
  189. ULONG ulReserved);
  190. BMAPI_ENTRY BMAPIResolveName (LHANDLE hSession,
  191. ULONG ulUIParam,
  192. BSTR bstrMapiName,
  193. ULONG ulFlags,
  194. ULONG ulReserved,
  195. LPVB_RECIPIENT lpVB);
  196. */
  197. typedef ULONG (FAR PASCAL BMAPISENDMAIL)(
  198. LHANDLE hSession,
  199. ULONG ulUIParam,
  200. LPVB_MESSAGE lpM,
  201. LPSAFEARRAY * lppsaRecips,
  202. LPSAFEARRAY * lppsaFiles,
  203. ULONG flFlags,
  204. ULONG ulReserved
  205. );
  206. typedef BMAPISENDMAIL FAR *LPBMAPISENDMAIL;
  207. BMAPISENDMAIL BMAPISendMail;
  208. typedef ULONG (FAR PASCAL BMAPIFINDNEXT)(
  209. LHANDLE hSession,
  210. ULONG ulUIParam,
  211. BSTR * bstrType,
  212. BSTR * bstrSeed,
  213. ULONG flFlags,
  214. ULONG ulReserved,
  215. BSTR * lpbstrId
  216. );
  217. typedef BMAPIFINDNEXT FAR *LPBMAPIFINDNEXT;
  218. BMAPIFINDNEXT BMAPIFindNext;
  219. typedef ULONG (FAR PASCAL BMAPIREADMAIL)(
  220. LPULONG lpulMessage,
  221. LPULONG nRecips,
  222. LPULONG nFiles,
  223. LHANDLE hSession,
  224. ULONG ulUIParam,
  225. BSTR * lpbstrID,
  226. ULONG flFlags,
  227. ULONG ulReserved
  228. );
  229. typedef BMAPIREADMAIL FAR *LPBMAPIREADMAIL;
  230. BMAPIREADMAIL BMAPIReadMail;
  231. typedef ULONG (FAR PASCAL BMAPIGETREADMAIL)(
  232. ULONG lpMessage,
  233. LPVB_MESSAGE lpvbMessage,
  234. LPSAFEARRAY * lppsaRecips,
  235. LPSAFEARRAY * lppsaFiles,
  236. LPVB_RECIPIENT lpvbOrig
  237. );
  238. typedef BMAPIGETREADMAIL FAR *LPBMAPIGETREADMAIL;
  239. BMAPIGETREADMAIL BMAPIGetReadMail;
  240. typedef ULONG (FAR PASCAL BMAPISAVEMAIL)(
  241. LHANDLE hSession,
  242. ULONG ulUIParam,
  243. LPVB_MESSAGE lpM,
  244. LPSAFEARRAY * lppsaRecips,
  245. LPSAFEARRAY * lppsaFiles,
  246. ULONG flFlags,
  247. ULONG ulReserved,
  248. BSTR * lpbstrID
  249. );
  250. typedef BMAPISAVEMAIL FAR *LPBMAPISAVEMAIL;
  251. BMAPISAVEMAIL BMAPISaveMail;
  252. typedef ULONG (FAR PASCAL BMAPIADDRESS)(
  253. LPULONG lpulRecip,
  254. LHANDLE hSession,
  255. ULONG ulUIParam,
  256. BSTR * lpbstrCaption,
  257. ULONG ulEditFields,
  258. BSTR * lpbstrLabel,
  259. LPULONG lpulRecipients,
  260. LPSAFEARRAY * lppsaRecip, // LPVB_RECIPIENT
  261. ULONG ulFlags,
  262. ULONG ulReserved
  263. );
  264. typedef BMAPIADDRESS FAR *LPBMAPIADDRESS;
  265. BMAPIADDRESS BMAPIAddress;
  266. typedef ULONG (FAR PASCAL BMAPIGETADDRESS)(
  267. ULONG ulRecipientData,
  268. ULONG count,
  269. LPSAFEARRAY * lppsaRecips
  270. );
  271. typedef BMAPIGETADDRESS FAR *LPBMAPIGETADDRESS;
  272. BMAPIGETADDRESS BMAPIGetAddress;
  273. typedef ULONG (FAR PASCAL BMAPIDETAILS)(
  274. LHANDLE hSession,
  275. ULONG ulUIParam,
  276. LPVB_RECIPIENT lpVB,
  277. ULONG ulFlags,
  278. ULONG ulReserved
  279. );
  280. typedef BMAPIDETAILS FAR *LPBMAPIDETAILS;
  281. BMAPIDETAILS BMAPIDetails;
  282. typedef ULONG (FAR PASCAL BMAPIRESOLVENAME)(
  283. LHANDLE hSession,
  284. ULONG ulUIParam,
  285. BSTR bstrMapiName,
  286. ULONG ulFlags,
  287. ULONG ulReserved,
  288. LPVB_RECIPIENT lpVB
  289. );
  290. typedef BMAPIRESOLVENAME FAR *LPBMAPIRESOLVENAME;
  291. BMAPIRESOLVENAME BMAPIResolveName;