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.

843 lines
24 KiB

  1. /*
  2. * WABUTIL.H
  3. *
  4. * Definitions and prototypes for utility functions provided by MAPI
  5. * in MAPI[xx].DLL.
  6. *
  7. * Copyright 1986-1998 Microsoft Corporation. All Rights Reserved.
  8. */
  9. #if !defined(_MAPIUTIL_H) && !defined(_WABUTIL_H)
  10. #define _WABUTIL_H
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #ifndef BEGIN_INTERFACE
  15. #define BEGIN_INTERFACE
  16. #endif
  17. /* IMAPITable in memory */
  18. /* ITableData Interface ---------------------------------------------------- */
  19. DECLARE_MAPI_INTERFACE_PTR(ITableData, LPTABLEDATA);
  20. typedef void (STDAPICALLTYPE CALLERRELEASE)(
  21. ULONG ulCallerData,
  22. LPTABLEDATA lpTblData,
  23. LPMAPITABLE lpVue
  24. );
  25. #define MAPI_ITABLEDATA_METHODS(IPURE) \
  26. MAPIMETHOD(HrGetView) \
  27. (THIS_ LPSSortOrderSet lpSSortOrderSet, \
  28. CALLERRELEASE FAR * lpfCallerRelease, \
  29. ULONG ulCallerData, \
  30. LPMAPITABLE FAR * lppMAPITable) IPURE; \
  31. MAPIMETHOD(HrModifyRow) \
  32. (THIS_ LPSRow) IPURE; \
  33. MAPIMETHOD(HrDeleteRow) \
  34. (THIS_ LPSPropValue lpSPropValue) IPURE; \
  35. MAPIMETHOD(HrQueryRow) \
  36. (THIS_ LPSPropValue lpsPropValue, \
  37. LPSRow FAR * lppSRow, \
  38. ULONG FAR * lpuliRow) IPURE; \
  39. MAPIMETHOD(HrEnumRow) \
  40. (THIS_ ULONG ulRowNumber, \
  41. LPSRow FAR * lppSRow) IPURE; \
  42. MAPIMETHOD(HrNotify) \
  43. (THIS_ ULONG ulFlags, \
  44. ULONG cValues, \
  45. LPSPropValue lpSPropValue) IPURE; \
  46. MAPIMETHOD(HrInsertRow) \
  47. (THIS_ ULONG uliRow, \
  48. LPSRow lpSRow) IPURE; \
  49. MAPIMETHOD(HrModifyRows) \
  50. (THIS_ ULONG ulFlags, \
  51. LPSRowSet lpSRowSet) IPURE; \
  52. MAPIMETHOD(HrDeleteRows) \
  53. (THIS_ ULONG ulFlags, \
  54. LPSRowSet lprowsetToDelete, \
  55. ULONG FAR * cRowsDeleted) IPURE; \
  56. #undef INTERFACE
  57. #define INTERFACE ITableData
  58. DECLARE_MAPI_INTERFACE_(ITableData, IUnknown)
  59. {
  60. BEGIN_INTERFACE
  61. MAPI_IUNKNOWN_METHODS(PURE)
  62. MAPI_ITABLEDATA_METHODS(PURE)
  63. };
  64. /* Entry Point for in memory ITable */
  65. /* CreateTable()
  66. * Creates the internal memory structures and object handle
  67. * to bring a new table into existence.
  68. *
  69. * lpInterface
  70. * Interface ID of the TableData object (IID_IMAPITableData)
  71. *
  72. * lpAllocateBuffer, lpAllocateMore, and lpFreeBuffer
  73. * Function addresses are provided by the caller so that
  74. * this DLL allocates/frees memory appropriately.
  75. * lpvReserved
  76. * Reserved. Should be NULL.
  77. * ulTableType
  78. * TBLTYPE_DYNAMIC, etc. Visible to the calling application
  79. * as part of the GetStatus return data on its views
  80. * ulPropTagIndexColumn
  81. * Index column for use when changing the data
  82. * lpSPropTagArrayColumns
  83. * Column proptags for the minimum set of columns in the table
  84. * lppTableData
  85. * Address of the pointer which will receive the TableData object
  86. */
  87. STDAPI_(SCODE)
  88. CreateTable( LPCIID lpInterface,
  89. ALLOCATEBUFFER FAR * lpAllocateBuffer,
  90. ALLOCATEMORE FAR * lpAllocateMore,
  91. FREEBUFFER FAR * lpFreeBuffer,
  92. LPVOID lpvReserved,
  93. ULONG ulTableType,
  94. ULONG ulPropTagIndexColumn,
  95. LPSPropTagArray lpSPropTagArrayColumns,
  96. LPTABLEDATA FAR * lppTableData );
  97. /* HrGetView()
  98. * This function obtains a new view on the underlying data
  99. * which supports the IMAPITable interface. All rows and columns
  100. * of the underlying table data are initially visible
  101. * lpSSortOrderSet
  102. * if specified, results in the view being sorted
  103. * lpfCallerRelease
  104. * pointer to a routine to be called when the view is released, or
  105. * NULL.
  106. * ulCallerData
  107. * arbitrary data the caller wants saved with this view and returned in
  108. * the Release callback.
  109. */
  110. /* HrModifyRows()
  111. * Add or modify a set of rows in the table data
  112. * ulFlags
  113. * Must be zero
  114. * lpSRowSet
  115. * Each row in the row set contains all the properties for one row
  116. * in the table. One of the properties must be the index column. Any
  117. * row in the table with the same value for its index column is
  118. * replaced, or if there is no current row with that value the
  119. * row is added.
  120. * Each row in LPSRowSet MUST have a unique Index column!
  121. * If any views are open, the view is updated as well.
  122. * The properties do not have to be in the same order as the
  123. * columns in the current table
  124. */
  125. /* HrModifyRow()
  126. * Add or modify one row in the table
  127. * lpSRow
  128. * This row contains all the properties for one row in the table.
  129. * One of the properties must be the index column. Any row in
  130. * the table with the same value for its index column is
  131. * replaced, or if there is no current row with that value the
  132. * row is added
  133. * If any views are open, the view is updated as well.
  134. * The properties do not have to be in the same order as the
  135. * columns in the current table
  136. */
  137. /* HrDeleteRows()
  138. * Delete a row in the table.
  139. * ulFlags
  140. * TAD_ALL_ROWS - Causes all rows in the table to be deleted
  141. * lpSRowSet is ignored in this case.
  142. * lpSRowSet
  143. * Each row in the row set contains all the properties for one row
  144. * in the table. One of the properties must be the index column. Any
  145. * row in the table with the same value for its index column is
  146. * deleted.
  147. * Each row in LPSRowSet MUST have a unique Index column!
  148. * If any views are open, the view is updated as well.
  149. * The properties do not have to be in the same order as the
  150. * columns in the current table
  151. */
  152. #define TAD_ALL_ROWS 1
  153. /* HrDeleteRow()
  154. * Delete a row in the table.
  155. * lpSPropValue
  156. * This property value specifies the row which has this value
  157. * for its index column
  158. */
  159. /* HrQueryRow()
  160. * Returns the values of a specified row in the table
  161. * lpSPropValue
  162. * This property value specifies the row which has this value
  163. * for its index column
  164. * lppSRow
  165. * Address of where to return a pointer to an SRow
  166. * lpuliRow
  167. * Address of where to return the row number. This can be NULL
  168. * if the row number is not required.
  169. *
  170. */
  171. /* HrEnumRow()
  172. * Returns the values of a specific (numbered) row in the table
  173. * ulRowNumber
  174. * Indicates row number 0 to n-1
  175. * lppSRow
  176. * Address of where to return a pointer to a SRow
  177. */
  178. /* HrInsertRow()
  179. * Inserts a row into the table.
  180. * uliRow
  181. * The row number before which this row will be inserted into the table.
  182. * Row numbers can be from 0 to n where o to n-1 result in row insertion
  183. * a row number of n results in the row being appended to the table.
  184. * lpSRow
  185. * This row contains all the properties for one row in the table.
  186. * One of the properties must be the index column. Any row in
  187. * the table with the same value for its index column is
  188. * replaced, or if there is no current row with that value the
  189. * row is added
  190. * If any views are open, the view is updated as well.
  191. * The properties do not have to be in the same order as the
  192. * columns in the current table
  193. */
  194. /* IMAPIProp in memory */
  195. /* IPropData Interface ---------------------------------------------------- */
  196. #define MAPI_IPROPDATA_METHODS(IPURE) \
  197. MAPIMETHOD(HrSetObjAccess) \
  198. (THIS_ ULONG ulAccess) IPURE; \
  199. MAPIMETHOD(HrSetPropAccess) \
  200. (THIS_ LPSPropTagArray lpPropTagArray, \
  201. ULONG FAR * rgulAccess) IPURE; \
  202. MAPIMETHOD(HrGetPropAccess) \
  203. (THIS_ LPSPropTagArray FAR * lppPropTagArray, \
  204. ULONG FAR * FAR * lprgulAccess) IPURE; \
  205. MAPIMETHOD(HrAddObjProps) \
  206. (THIS_ LPSPropTagArray lppPropTagArray, \
  207. LPSPropProblemArray FAR * lprgulAccess) IPURE;
  208. #undef INTERFACE
  209. #define INTERFACE IPropData
  210. DECLARE_MAPI_INTERFACE_(IPropData, IMAPIProp)
  211. {
  212. BEGIN_INTERFACE
  213. MAPI_IUNKNOWN_METHODS(PURE)
  214. MAPI_IMAPIPROP_METHODS(PURE)
  215. MAPI_IPROPDATA_METHODS(PURE)
  216. };
  217. DECLARE_MAPI_INTERFACE_PTR(IPropData, LPPROPDATA);
  218. /* Entry Point for in memory IMAPIProp */
  219. /* CreateIProp()
  220. * Creates the internal memory structures and object handle
  221. * to bring a new property interface into existance.
  222. *
  223. * lpInterface
  224. * Interface ID of the TableData object (IID_IMAPIPropData)
  225. *
  226. * lpAllocateBuffer, lpAllocateMore, and lpFreeBuffer
  227. * Function addresses are provided by the caller so that
  228. * this DLL allocates/frees memory appropriately.
  229. * lppPropData
  230. * Address of the pointer which will receive the IPropData object
  231. * lpvReserved
  232. * Reserved. Should be NULL.
  233. */
  234. // If MAPI isn't included, use WABCreateIProp instead
  235. #ifndef CreateIProp
  236. STDAPI_(SCODE)
  237. CreateIProp( LPCIID lpInterface,
  238. ALLOCATEBUFFER FAR * lpAllocateBuffer,
  239. ALLOCATEMORE FAR * lpAllocateMore,
  240. FREEBUFFER FAR * lpFreeBuffer,
  241. LPVOID lpvReserved,
  242. LPPROPDATA FAR * lppPropData );
  243. #endif
  244. STDAPI_(SCODE)
  245. WABCreateIProp( LPCIID lpInterface,
  246. ALLOCATEBUFFER FAR * lpAllocateBuffer,
  247. ALLOCATEMORE FAR * lpAllocateMore,
  248. FREEBUFFER FAR * lpFreeBuffer,
  249. LPVOID lpvReserved,
  250. LPPROPDATA FAR * lppPropData );
  251. /*
  252. * Defines for prop/obj access
  253. */
  254. #define IPROP_READONLY ((ULONG) 0x00000001)
  255. #define IPROP_READWRITE ((ULONG) 0x00000002)
  256. #define IPROP_CLEAN ((ULONG) 0x00010000)
  257. #define IPROP_DIRTY ((ULONG) 0x00020000)
  258. /*
  259. - HrSetPropAccess
  260. -
  261. * Sets access right attributes on a per-property basis. By default,
  262. * all properties are read/write.
  263. *
  264. */
  265. /*
  266. - HrSetObjAccess
  267. -
  268. * Sets access rights for the object itself. By default, the object has
  269. * read/write access.
  270. *
  271. */
  272. #ifndef NOIDLEENGINE
  273. /* Idle time scheduler */
  274. /*
  275. * PRI
  276. *
  277. * Priority of an idle task.
  278. * The idle engine sorts tasks by priority, and the one with the higher
  279. * value runs first. Within a priority level, the functions are called
  280. * round-robin.
  281. */
  282. #define PRILOWEST -32768
  283. #define PRIHIGHEST 32767
  284. #define PRIUSER 0
  285. /*
  286. * IRO
  287. *
  288. * Idle routine options. This is a combined bit mask consisting of
  289. * individual firo's. Listed below are the possible bit flags.
  290. *
  291. * FIROWAIT and FIROINTERVAL are mutually exclusive.
  292. * If neither of the flags are specified, the default action
  293. * is to ignore the time parameter of the idle function and
  294. * call it as often as possible if firoPerBlock is not set;
  295. * otherwise call it one time only during the idle block
  296. * once the time constraint has been set. FIROINTERVAL
  297. * is also incompatible with FIROPERBLOCK.
  298. *
  299. * FIROWAIT - time given is minimum idle time before calling
  300. * for the first time in the block of idle time,
  301. * afterwhich call as often as possible.
  302. * FIROINTERVAL - time given is minimum interval between each
  303. * successive call
  304. * FIROPERBLOCK - called only once per contiguous block of idle
  305. * time
  306. * FIRODISABLED - initially disabled when registered, the
  307. * default is to enable the function when registered.
  308. * FIROONCEONLY - called only one time by the scheduler and then
  309. * deregistered automatically.
  310. */
  311. #define IRONULL ((USHORT) 0x0000)
  312. #define FIROWAIT ((USHORT) 0x0001)
  313. #define FIROINTERVAL ((USHORT) 0x0002)
  314. #define FIROPERBLOCK ((USHORT) 0x0004)
  315. #define FIRODISABLED ((USHORT) 0x0020)
  316. #define FIROONCEONLY ((USHORT) 0x0040)
  317. /*
  318. * IRC
  319. *
  320. * Idle routine change options. This is a combined bit mask consisting
  321. * of individual firc's; each one identifies an aspect of the idle task
  322. * that can be changed.
  323. *
  324. */
  325. #define IRCNULL ((USHORT) 0x0000)
  326. #define FIRCPFN ((USHORT) 0x0001) /* change function pointer */
  327. #define FIRCPV ((USHORT) 0x0002) /* change parameter block */
  328. #define FIRCPRI ((USHORT) 0x0004) /* change priority */
  329. #define FIRCCSEC ((USHORT) 0x0008) /* change time */
  330. #define FIRCIRO ((USHORT) 0x0010) /* change routine options */
  331. /*
  332. * Type definition for idle functions. An idle function takes one
  333. * parameter, an PV, and returns a BOOL value.
  334. */
  335. typedef BOOL (STDAPICALLTYPE FNIDLE) (LPVOID);
  336. typedef FNIDLE FAR *PFNIDLE;
  337. /*
  338. * FTG
  339. *
  340. * Function Tag. Used to identify a registered idle function.
  341. *
  342. */
  343. typedef void FAR *FTG;
  344. typedef FTG FAR *PFTG;
  345. #define FTGNULL ((FTG) NULL)
  346. /*
  347. - MAPIInitIdle/MAPIDeinitIdle
  348. -
  349. * Purpose:
  350. * Initialises the idle engine
  351. * If the initialisation succeded, returns 0, else returns -1
  352. *
  353. * Arguments:
  354. * lpvReserved Reserved, must be NULL.
  355. */
  356. STDAPI_(LONG)
  357. MAPIInitIdle (LPVOID lpvReserved);
  358. STDAPI_(VOID)
  359. MAPIDeinitIdle (VOID);
  360. /*
  361. * FtgRegisterIdleRoutine
  362. *
  363. * Registers the function pfn of type PFNIDLE, i.e., (BOOL (*)(LPVOID))
  364. * as an idle function.
  365. *
  366. * The idle function will be called with the parameter pv by the
  367. * idle engine. The function has initial priority priIdle,
  368. * associated time csecIdle, and options iroIdle.
  369. */
  370. STDAPI_(FTG)
  371. FtgRegisterIdleRoutine (PFNIDLE lpfnIdle, LPVOID lpvIdleParam,
  372. short priIdle, ULONG csecIdle, USHORT iroIdle);
  373. /*
  374. * DeregisterIdleRoutine
  375. *
  376. * Removes the given routine from the list of idle routines.
  377. * The routine will not be called again. It is the responsibility
  378. * of the caller to clean up any data structures pointed to by the
  379. * pvIdleParam parameter; this routine does not free the block.
  380. */
  381. STDAPI_(void)
  382. DeregisterIdleRoutine (FTG ftg);
  383. /*
  384. * EnableIdleRoutine
  385. *
  386. * Enables or disables an idle routine.
  387. */
  388. STDAPI_(void)
  389. EnableIdleRoutine (FTG ftg, BOOL fEnable);
  390. /*
  391. * ChangeIdleRoutine
  392. *
  393. * Changes some or all of the characteristics of the given idle
  394. * function. The changes to make are indicated with flags in the
  395. * ircIdle parameter.
  396. */
  397. STDAPI_(void)
  398. ChangeIdleRoutine (FTG ftg, PFNIDLE lpfnIdle, LPVOID lpvIdleParam,
  399. short priIdle, ULONG csecIdle, USHORT iroIdle, USHORT ircIdle);
  400. #endif /* ! NOIDLEENGINE */
  401. /* IMalloc Utilities */
  402. STDAPI_(LPMALLOC) MAPIGetDefaultMalloc(VOID);
  403. /* StreamOnFile (SOF) */
  404. /*
  405. * Methods and #define's for implementing an OLE 2.0 storage stream
  406. * (as defined in the OLE 2.0 specs) on top of a system file.
  407. */
  408. #define SOF_UNIQUEFILENAME ((ULONG) 0x80000000)
  409. STDMETHODIMP OpenStreamOnFile(
  410. LPALLOCATEBUFFER lpAllocateBuffer,
  411. LPFREEBUFFER lpFreeBuffer,
  412. ULONG ulFlags,
  413. LPTSTR lpszFileName,
  414. LPTSTR lpszPrefix,
  415. LPSTREAM FAR * lppStream);
  416. typedef HRESULT (STDMETHODCALLTYPE FAR * LPOPENSTREAMONFILE) (
  417. LPALLOCATEBUFFER lpAllocateBuffer,
  418. LPFREEBUFFER lpFreeBuffer,
  419. ULONG ulFlags,
  420. LPTSTR lpszFileName,
  421. LPTSTR lpszPrefix,
  422. LPSTREAM FAR * lppStream);
  423. #ifdef _WIN32
  424. #define OPENSTREAMONFILE "OpenStreamOnFile"
  425. #endif
  426. #ifdef WIN16
  427. #define OPENSTREAMONFILE "_OPENSTREAMONFILE"
  428. #endif
  429. /* Property interface utilities */
  430. /*
  431. * Copies a single SPropValue from Src to Dest. Handles all the various
  432. * types of properties and will link its allocations given the master
  433. * allocation object and an allocate more function.
  434. */
  435. STDAPI_(SCODE)
  436. PropCopyMore( LPSPropValue lpSPropValueDest,
  437. LPSPropValue lpSPropValueSrc,
  438. ALLOCATEMORE * lpfAllocMore,
  439. LPVOID lpvObject );
  440. /*
  441. * Returns the size in bytes of structure at lpSPropValue, including the
  442. * Value.
  443. */
  444. STDAPI_(ULONG)
  445. UlPropSize( LPSPropValue lpSPropValue );
  446. STDAPI_(BOOL)
  447. FEqualNames( LPMAPINAMEID lpName1, LPMAPINAMEID lpName2 );
  448. #if defined(_WIN32) && !defined(_WINNT) && !defined(_WIN95) && !defined(_MAC)
  449. #define _WINNT
  450. #endif
  451. STDAPI_(void)
  452. GetInstance(LPSPropValue lpPropMv, LPSPropValue lpPropSv, ULONG uliInst);
  453. extern unsigned char rgchCsds[];
  454. extern unsigned char rgchCids[];
  455. extern unsigned char rgchCsdi[];
  456. extern unsigned char rgchCidi[];
  457. STDAPI_(BOOL)
  458. FPropContainsProp( LPSPropValue lpSPropValueDst,
  459. LPSPropValue lpSPropValueSrc,
  460. ULONG ulFuzzyLevel );
  461. STDAPI_(BOOL)
  462. FPropCompareProp( LPSPropValue lpSPropValue1,
  463. ULONG ulRelOp,
  464. LPSPropValue lpSPropValue2 );
  465. STDAPI_(LONG)
  466. LPropCompareProp( LPSPropValue lpSPropValueA,
  467. LPSPropValue lpSPropValueB );
  468. STDAPI_(HRESULT)
  469. HrAddColumns( LPMAPITABLE lptbl,
  470. LPSPropTagArray lpproptagColumnsNew,
  471. LPALLOCATEBUFFER lpAllocateBuffer,
  472. LPFREEBUFFER lpFreeBuffer);
  473. STDAPI_(HRESULT)
  474. HrAddColumnsEx( LPMAPITABLE lptbl,
  475. LPSPropTagArray lpproptagColumnsNew,
  476. LPALLOCATEBUFFER lpAllocateBuffer,
  477. LPFREEBUFFER lpFreeBuffer,
  478. void (FAR *lpfnFilterColumns)(LPSPropTagArray ptaga));
  479. /* Notification utilities */
  480. /*
  481. * Function that creates an advise sink object given a notification
  482. * callback function and context.
  483. */
  484. STDAPI
  485. HrAllocAdviseSink( LPNOTIFCALLBACK lpfnCallback,
  486. LPVOID lpvContext,
  487. LPMAPIADVISESINK FAR *lppAdviseSink );
  488. /*
  489. * Wraps an existing advise sink with another one which guarantees
  490. * that the original advise sink will be called in the thread on
  491. * which it was created.
  492. */
  493. STDAPI
  494. HrThisThreadAdviseSink( LPMAPIADVISESINK lpAdviseSink,
  495. LPMAPIADVISESINK FAR *lppAdviseSink);
  496. /*
  497. * Allows a client and/or provider to force notifications
  498. * which are currently queued in the MAPI notification engine
  499. * to be dispatched without doing a message dispatch.
  500. */
  501. STDAPI HrDispatchNotifications (ULONG ulFlags);
  502. /* Service Provider Utilities */
  503. /*
  504. * Structures and utility function for building a display table
  505. * from resources.
  506. */
  507. typedef struct {
  508. ULONG ulCtlType; /* DTCT_LABEL, etc. */
  509. ULONG ulCtlFlags; /* DT_REQUIRED, etc. */
  510. LPBYTE lpbNotif; /* pointer to notification data */
  511. ULONG cbNotif; /* count of bytes of notification data */
  512. LPTSTR lpszFilter; /* character filter for edit/combobox */
  513. ULONG ulItemID; /* to validate parallel dlg template entry */
  514. union { /* ulCtlType discriminates */
  515. LPVOID lpv; /* Initialize this to avoid warnings */
  516. LPDTBLLABEL lplabel;
  517. LPDTBLEDIT lpedit;
  518. LPDTBLLBX lplbx;
  519. LPDTBLCOMBOBOX lpcombobox;
  520. LPDTBLDDLBX lpddlbx;
  521. LPDTBLCHECKBOX lpcheckbox;
  522. LPDTBLGROUPBOX lpgroupbox;
  523. LPDTBLBUTTON lpbutton;
  524. LPDTBLRADIOBUTTON lpradiobutton;
  525. LPDTBLMVLISTBOX lpmvlbx;
  526. LPDTBLMVDDLBX lpmvddlbx;
  527. LPDTBLPAGE lppage;
  528. } ctl;
  529. } DTCTL, FAR *LPDTCTL;
  530. typedef struct {
  531. ULONG cctl;
  532. LPTSTR lpszResourceName; /* as usual, may be an integer ID */
  533. union { /* as usual, may be an integer ID */
  534. LPTSTR lpszComponent;
  535. ULONG ulItemID;
  536. };
  537. LPDTCTL lpctl;
  538. } DTPAGE, FAR *LPDTPAGE;
  539. STDAPI
  540. BuildDisplayTable( LPALLOCATEBUFFER lpAllocateBuffer,
  541. LPALLOCATEMORE lpAllocateMore,
  542. LPFREEBUFFER lpFreeBuffer,
  543. LPMALLOC lpMalloc,
  544. HINSTANCE hInstance,
  545. UINT cPages,
  546. LPDTPAGE lpPage,
  547. ULONG ulFlags,
  548. LPMAPITABLE * lppTable,
  549. LPTABLEDATA * lppTblData );
  550. /* MAPI structure validation/copy utilities */
  551. /*
  552. * Validate, copy, and adjust pointers in MAPI structures:
  553. * notification
  554. * property value array
  555. * option data
  556. */
  557. STDAPI_(SCODE)
  558. ScCountNotifications(int cNotifications, LPNOTIFICATION lpNotifications,
  559. ULONG FAR *lpcb);
  560. STDAPI_(SCODE)
  561. ScCopyNotifications(int cNotification, LPNOTIFICATION lpNotifications,
  562. LPVOID lpvDst, ULONG FAR *lpcb);
  563. STDAPI_(SCODE)
  564. ScRelocNotifications(int cNotification, LPNOTIFICATION lpNotifications,
  565. LPVOID lpvBaseOld, LPVOID lpvBaseNew, ULONG FAR *lpcb);
  566. STDAPI_(SCODE)
  567. ScCountProps(int cValues, LPSPropValue lpPropArray, ULONG FAR *lpcb);
  568. STDAPI_(LPSPropValue)
  569. LpValFindProp(ULONG ulPropTag, ULONG cValues, LPSPropValue lpPropArray);
  570. STDAPI_(SCODE)
  571. ScCopyProps(int cValues, LPSPropValue lpPropArray, LPVOID lpvDst,
  572. ULONG FAR *lpcb);
  573. STDAPI_(SCODE)
  574. ScRelocProps(int cValues, LPSPropValue lpPropArray,
  575. LPVOID lpvBaseOld, LPVOID lpvBaseNew, ULONG FAR *lpcb);
  576. STDAPI_(SCODE)
  577. ScDupPropset(int cValues, LPSPropValue lpPropArray,
  578. LPALLOCATEBUFFER lpAllocateBuffer, LPSPropValue FAR *lppPropArray);
  579. /* General utility functions */
  580. /* Related to the OLE Component object model */
  581. STDAPI_(ULONG) UlAddRef(LPVOID lpunk);
  582. STDAPI_(ULONG) UlRelease(LPVOID lpunk);
  583. /* Related to the MAPI interface */
  584. STDAPI HrGetOneProp(LPMAPIPROP lpMapiProp, ULONG ulPropTag,
  585. LPSPropValue FAR *lppProp);
  586. STDAPI HrSetOneProp(LPMAPIPROP lpMapiProp,
  587. LPSPropValue lpProp);
  588. STDAPI_(BOOL) FPropExists(LPMAPIPROP lpMapiProp, ULONG ulPropTag);
  589. STDAPI_(LPSPropValue) PpropFindProp(LPSPropValue lpPropArray, ULONG cValues,
  590. ULONG ulPropTag);
  591. STDAPI_(void) FreePadrlist(LPADRLIST lpAdrlist);
  592. STDAPI_(void) FreeProws(LPSRowSet lpRows);
  593. STDAPI HrQueryAllRows(LPMAPITABLE lpTable,
  594. LPSPropTagArray lpPropTags,
  595. LPSRestriction lpRestriction,
  596. LPSSortOrderSet lpSortOrderSet,
  597. LONG crowsMax,
  598. LPSRowSet FAR *lppRows);
  599. /* C runtime substitutes */
  600. STDAPI_(LPTSTR) SzFindCh(LPCTSTR lpsz, USHORT ch); /* strchr */
  601. STDAPI_(LPTSTR) SzFindLastCh(LPCTSTR lpsz, USHORT ch); /* strrchr */
  602. STDAPI_(LPTSTR) SzFindSz(LPCTSTR lpsz, LPCTSTR lpszKey); /*strstr */
  603. STDAPI_(unsigned int) UFromSz(LPCTSTR lpsz); /* atoi */
  604. STDAPI_(SCODE) ScUNCFromLocalPath(LPSTR lpszLocal, LPSTR lpszUNC,
  605. UINT cchUNC);
  606. STDAPI_(SCODE) ScLocalPathFromUNC(LPSTR lpszUNC, LPSTR lpszLocal,
  607. UINT cchLocal);
  608. /* 64-bit arithmetic with times */
  609. STDAPI_(FILETIME) FtAddFt(FILETIME ftAddend1, FILETIME ftAddend2);
  610. STDAPI_(FILETIME) FtMulDwDw(DWORD ftMultiplicand, DWORD ftMultiplier);
  611. STDAPI_(FILETIME) FtMulDw(DWORD ftMultiplier, FILETIME ftMultiplicand);
  612. STDAPI_(FILETIME) FtSubFt(FILETIME ftMinuend, FILETIME ftSubtrahend);
  613. STDAPI_(FILETIME) FtNegFt(FILETIME ft);
  614. /* Message composition */
  615. STDAPI_(SCODE) ScCreateConversationIndex (ULONG cbParent,
  616. LPBYTE lpbParent,
  617. ULONG FAR * lpcbConvIndex,
  618. LPBYTE FAR * lppbConvIndex);
  619. /* Store support */
  620. STDAPI WrapStoreEntryID (ULONG ulFlags, LPTSTR lpszDLLName, ULONG cbOrigEntry,
  621. LPENTRYID lpOrigEntry, ULONG *lpcbWrappedEntry, LPENTRYID *lppWrappedEntry);
  622. /* RTF Sync Utilities */
  623. #define RTF_SYNC_RTF_CHANGED ((ULONG) 0x00000001)
  624. #define RTF_SYNC_BODY_CHANGED ((ULONG) 0x00000002)
  625. STDAPI_(HRESULT)
  626. RTFSync (LPMESSAGE lpMessage, ULONG ulFlags, BOOL FAR * lpfMessageUpdated);
  627. /* Flags for WrapCompressedRTFStream() */
  628. /****** MAPI_MODIFY ((ULONG) 0x00000001) mapidefs.h */
  629. /****** STORE_UNCOMPRESSED_RTF ((ULONG) 0x00008000) mapidefs.h */
  630. STDAPI_(HRESULT)
  631. WrapCompressedRTFStream (LPSTREAM lpCompressedRTFStream,
  632. ULONG ulFlags, LPSTREAM FAR * lpUncompressedRTFStream);
  633. /* Storage on Stream */
  634. #if defined(_WIN32) || defined(WIN16)
  635. STDAPI_(HRESULT)
  636. HrIStorageFromStream (LPUNKNOWN lpUnkIn,
  637. LPCIID lpInterface, ULONG ulFlags, LPSTORAGE FAR * lppStorageOut);
  638. #endif
  639. /*
  640. * Setup and cleanup.
  641. *
  642. * Providers never need to make these calls.
  643. *
  644. * Test applications and the like which do not call MAPIInitialize
  645. * may want to call them, so that the few utility functions which
  646. * need MAPI allocators (and do not ask for them explicitly)
  647. * will work.
  648. */
  649. /* All flags are reserved for ScInitMapiUtil. */
  650. STDAPI_(SCODE) ScInitMapiUtil(ULONG ulFlags);
  651. STDAPI_(VOID) DeinitMapiUtil(VOID);
  652. /*
  653. * Entry point names.
  654. *
  655. * These are for new entry points defined since MAPI first shipped
  656. * in Windows 95. Using these names in a GetProcAddress call makes
  657. * it easier to write code which uses them optionally.
  658. */
  659. #if defined (WIN16)
  660. #define szHrDispatchNotifications "HrDispatchNotifications"
  661. #elif defined (_WIN32) && defined (_X86_)
  662. #define szHrDispatchNotifications "_HrDispatchNotifications@4"
  663. #elif defined (_ALPHA_) || defined (_MIPS_) || defined (_PPC_)
  664. #define szHrDispatchNotifications "HrDispatchNotifications"
  665. #endif
  666. typedef HRESULT (STDAPICALLTYPE DISPATCHNOTIFICATIONS)(ULONG ulFlags);
  667. typedef DISPATCHNOTIFICATIONS FAR * LPDISPATCHNOTIFICATIONS;
  668. #if defined (WIN16)
  669. #define szScCreateConversationIndex "ScCreateConversationIndex"
  670. #elif defined (_WIN32) && defined (_X86_)
  671. #define szScCreateConversationIndex "_ScCreateConversationIndex@16"
  672. #elif defined (_ALPHA_) || defined (_MIPS_) || defined (_PPC_)
  673. #define szScCreateConversationIndex "ScCreateConversationIndex"
  674. #endif
  675. typedef SCODE (STDAPICALLTYPE CREATECONVERSATIONINDEX)(ULONG cbParent,
  676. LPBYTE lpbParent, ULONG FAR *lpcbConvIndex, LPBYTE FAR *lppbConvIndex);
  677. typedef CREATECONVERSATIONINDEX FAR *LPCREATECONVERSATIONINDEX;
  678. #ifdef __cplusplus
  679. }
  680. #endif
  681. #endif /* _WABUTIL_H_ */