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.

166 lines
4.4 KiB

  1. /*
  2. * _RUNT.H
  3. *
  4. * DLL central for the MAPI utilities.
  5. */
  6. #ifndef _RUNT_H_
  7. #define _RUNT_H_
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. // Per-process instance data for utilities functions
  12. DeclareInstList(lpInstUtil);
  13. #define INSTUTIL_SIG_BEG 0x54534E49 // 'INST'
  14. #define INSTUTIL_SIG_END 0x4C495455 // 'UTIL'
  15. typedef struct
  16. {
  17. #ifdef WIN16
  18. DWORD dwBeg; // INSTUTIL_SIG_BEG
  19. WORD wSS; // Stack segment of current task
  20. HTASK hTask; // HTASK of current task
  21. #endif
  22. UINT cRef;
  23. // General stuff
  24. HLH hlhClient; // Heap for allocations
  25. // Idle engine stuff
  26. ULONG cRefIdle; /* reference count */
  27. LPMALLOC lpMalloc; /* memory allocator */
  28. HINSTANCE hInst; /* */
  29. HWND hwnd; /* handle of hidden window */
  30. int iftgMax; /* size of idle routine registry */
  31. int iftgMac; /* number of registered idle routines */
  32. #if !(defined(WIN32) && !defined(MAC))
  33. UINT uiWakeupTimer; /* Timer to wake up & run idle routines */
  34. #endif
  35. #ifdef OLD_STUFF
  36. PFTG pftgIdleTable; /* ptr to table of registered routines */
  37. #endif
  38. int iftgCur; /* Index in pftgIdleTable of currently */
  39. /* running ftgCur routine or recently run */
  40. USHORT schCurrent; /* current idle routine state from last */
  41. /* FDoNextIdleTask() call */
  42. BOOL fIdleExit; /* flag set TRUE if idle routines are */
  43. /* being called from IdleExit */
  44. #if defined(WIN32) && !defined(MAC)
  45. CRITICAL_SECTION cs; /* gate to keep multiple threads from */
  46. /* accessing global data at the same time */
  47. BOOL fSignalled; /* Only do this when we need to */
  48. HANDLE hTimerReset; /* Used to signal timer reset */
  49. HANDLE hTimerThread; /* Timer thread handle */
  50. DWORD dwTimerThread; /* Timer thread ID */
  51. DWORD dwTimerTimeout; /* Current timeout value */
  52. BOOL fExit; /* if TRUE, timer thread should exit */
  53. #endif
  54. #ifdef WIN16
  55. LPVOID pvBeg; // Pointer back to beginning of pinst
  56. DWORD dwEnd; // INSTUTIL_SIG_END
  57. #endif
  58. } INSTUTIL, FAR *LPINSTUTIL;
  59. #define MAPIMDB_VERSION ((BYTE) 0x00)
  60. #define MAPIMDB_NORMAL ((BYTE) 0x00) // Normal wrapped store EntryID
  61. #define MAPIMDB_SECTION ((BYTE) 0x01) // Known section, but no EntryID
  62. #define MUIDSTOREWRAP { \
  63. 0x38, 0xa1, 0xbb, 0x10, \
  64. 0x05, 0xe5, 0x10, 0x1a, \
  65. 0xa1, 0xbb, 0x08, 0x00, \
  66. 0x2b, 0x2a, 0x56, 0xc2 }
  67. typedef struct _MAPIMDBEID {
  68. BYTE abFlags[4];
  69. MAPIUID mapiuid;
  70. BYTE bVersion;
  71. BYTE bFlagInt;
  72. BYTE bData[MAPI_DIM];
  73. } MAPIMDB_ENTRYID, *LPMAPIMDB_ENTRYID;
  74. #define CbNewMAPIMDB_ENTRYID(_cb) \
  75. (offsetof(MAPIMDB_ENTRYID,bData) + (_cb))
  76. #define CbMAPIMDB_ENTRYID(_cb) \
  77. (offsetof(MAPIMDB_ENTRYID,bData) + (_cb))
  78. #define SizedMAPIMDB_ENTRYID(_cb, _name) \
  79. struct _MAPIMDB_ENTRYID_ ## _name \
  80. { \
  81. BYTE abFlags[4]; \
  82. MAPIUID mapiuid; \
  83. BYTE bVersion; \
  84. BYTE bFlagInt; \
  85. BYTE bData[_cb]; \
  86. } _name
  87. // This macro computes the length of the MAPI header on a store entryid.
  88. // The provider-specific data starts on a 4-byte boundary following the
  89. // DLL Name. The cb parameter is the length of the DLL name in bytes (counting
  90. // the NULL terminator).
  91. #define CB_MDB_EID_HEADER(cb) ((CbNewMAPIMDB_ENTRYID(cb) + 3) & ~3)
  92. // Internal function that gets a new UID
  93. STDAPI_(SCODE) ScGenerateMuid(LPMAPIUID lpMuid);
  94. // Internal function that gets the utilities heap
  95. HLH HlhUtilities(VOID);
  96. // Critical section for serializing heap access
  97. #if defined(WIN32) && !defined(MAC)
  98. extern CRITICAL_SECTION csHeap;
  99. #endif
  100. #if defined(WIN32) && !defined(MAC)
  101. extern CRITICAL_SECTION csMapiInit;
  102. #endif
  103. #if defined(WIN32) && !defined(MAC)
  104. extern CRITICAL_SECTION csMapiSearchPath;
  105. #endif
  106. // Access the DLL instance handle
  107. LRESULT STDAPICALLTYPE
  108. DrainFilteredNotifQueue(BOOL fSync, ULONG ibParms, LPNOTIFKEY pskeyFilter);
  109. //$ used by ITable
  110. LPADVISELIST lpAdviseList;
  111. LPNOTIFKEY lpNotifKey;
  112. LPMAPIADVISESINK lpMAPIAdviseSink;
  113. LPNOTIFICATION lpNotification;
  114. STDMETHODIMP HrSubscribe(LPADVISELIST FAR *lppAdviseList, LPNOTIFKEY lpKey,
  115. ULONG ulEventMask, LPMAPIADVISESINK lpAdvise, ULONG ulFlags,
  116. ULONG FAR *lpulConnection);
  117. STDMETHODIMP HrUnsubscribe(LPADVISELIST FAR *lppAdviseList, ULONG ulConnection);
  118. STDMETHODIMP HrNotify(LPNOTIFKEY lpKey, ULONG cNotification,
  119. LPNOTIFICATION lpNotifications, ULONG * lpulFlags);
  120. #ifndef PSTRCVR
  121. #endif //PSTRCVR
  122. //$ END
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126. #endif // _RUNT_H_