home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / edkcfg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  9.6 KB  |  204 lines

  1. // --edkcfg.h-------------------------------------------------------------------
  2. // 
  3. //  EDK Gateway Configuration Routines
  4. //
  5. // Copyright 1986 - 1998 Microsoft Corporation.  All Rights Reserved.
  6. //
  7. // -----------------------------------------------------------------------------
  8.  
  9. #ifndef _EDKCFG_H_
  10. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  11. #define _EDKCFG_H_
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // __cplusplus
  16.  
  17. //
  18. // Type Definitions
  19. //
  20.  
  21. //$--ADVISECALLBACK-------------------------------------------------------------
  22. //  Function type for routine to be called when a binary blob changes.
  23. // -----------------------------------------------------------------------------
  24. typedef HRESULT (ADVISECALLBACK) (
  25.     LPVOID              lpvUserContext, 
  26.     LPWSTR              lpwszOwnerTag, 
  27.     ULONG               cProps, 
  28.     LPSPropValue        lpProps);
  29.  
  30. typedef ADVISECALLBACK *LPADVISECALLBACK;
  31.  
  32. //$--ADVISENOTIFY---------------------------------------------------------------
  33. //  Object attached to an ADVISEOBJ, which represents a single blob and the 
  34. //  callback routine to call when it is modified.
  35. // -----------------------------------------------------------------------------
  36. typedef struct _AdviseNotify {
  37.     struct _AdviseNotify * lpNext;
  38.     LPSTR              lpszOwnerTag;
  39.     LPWSTR              lpwszOwnerTag;
  40.     LPBYTE              lpbBlob;
  41.     ULONG               cbBlob;
  42.     LPADVISECALLBACK    lpfnCallback;
  43.     LPVOID              lpvUserContext;
  44.     BOOL                fFirstTime;
  45. } ADVISENOTIFY, *LPADVISENOTIFY;
  46.  
  47. //$--ADVISEOBJ------------------------------------------------------------------
  48. //  Object representing a MAPI session whose extension data is being monitored.
  49. // -----------------------------------------------------------------------------
  50. typedef struct {
  51.     LPMAPISESSION       lpSession;
  52.     LPMAPIPROP          lpCurrentObject;
  53.     ULONG               nPollInterval;
  54.     ULONG               ulUSNChangedPropTag;
  55.     ULONG               ulExtensionDataPropTag;
  56.     CRITICAL_SECTION    csCriticalSection;
  57.     HANDLE              hPollThreadStop;
  58.     HANDLE              hPollThread;
  59.     ULONG               ulPollThreadID;
  60.     ULONG               ulUSNChanged;
  61.     LPSPropValue        lpExtensionData;
  62.     LPADVISENOTIFY      lpNotifyList;
  63. } ADVISEOBJ, *LPADVISEOBJ;
  64.  
  65. //
  66. // Function Prototypes
  67. //
  68.  
  69. //$--HrCfgCreateAdviseObj-------------------------------------------------------
  70. //  Begin monitoring of a MAPI session for changes to extension data.
  71. //  This routine should be called once to create an advise object for a MAPI 
  72. //  session that is being monitored.  Then, HrCfgAdvise() should be called 
  73. //  once for each extension data section that is being monitored.
  74. //  If nPollInterval == 0 then no monitoring thread is created, and the user 
  75. //  must do polling manually by calling HrCfgPollAdviseObj().
  76. // -----------------------------------------------------------------------------
  77. HRESULT HrCfgCreateAdviseObj(               // RETURNS: HRESULT
  78.     IN  LPMAPISESSION       lpSession,      // MAPI session to monitor
  79.     IN  ULONG               nPollInterval,  // milliseconds between polling
  80.     OUT LPADVISEOBJ *       lppAdviseObj);  // created advise object
  81.  
  82. //$--HrCfgPollAdviseObj---------------------------------------------------------
  83. //  Checks an advise object against what is stored in the DSA.  Calls the 
  84. //  notification routines if there are any changes.
  85. // -----------------------------------------------------------------------------
  86. HRESULT HrCfgPollAdviseObj(                 // RETURNS: HRESULT
  87.     IN  LPADVISEOBJ     lpAdviseObj);       // advise object to poll
  88.  
  89. //$--HrCfgDestroyAdviseObj------------------------------------------------------
  90. //  End monitoring of a MAPI session.  This routine calls HrCfgUnadvise() for 
  91. //  any extension data sections that are actively being monitored.
  92. // -----------------------------------------------------------------------------
  93. HRESULT HrCfgDestroyAdviseObj(              // RETURNS: HRESULT
  94.     IN  LPADVISEOBJ         lpAdviseObj);   // advise object to destroy
  95.  
  96. //$--HrCfgAdvise----------------------------------------------------------------
  97. //  Begin monitoring of an extension data section.  When the extension data 
  98. //  changes, the specified callback routine is called.  Note: The callback 
  99. //  routine will be called once from hrCfgAdvise() to set the initial extension 
  100. //  data values.
  101. // -----------------------------------------------------------------------------
  102. HRESULT HrCfgAdvise(                        // RETURNS: HRESULT
  103.     IN  LPADVISEOBJ         lpAdviseObj,    // advise object
  104.     IN  LPSTR               lpszSection,    // name of extension data section
  105.     IN  LPADVISECALLBACK    lpfnCallback,   // function to call on changes
  106.     IN  LPVOID              lpvUserContext); // user-defined context
  107.  
  108. //$--HrCfgUnadvise--------------------------------------------------------------
  109. //  End monitoring of an extension data section.
  110. // -----------------------------------------------------------------------------
  111. HRESULT HrCfgUnadvise(                      // RETURNS: HRESULT
  112.     IN  LPADVISEOBJ         lpAdviseObj,    // advise object
  113.     IN  LPSTR               lpszSection);   // name of extension data section
  114.  
  115. //$--HrCfgPackData--------------------------------------------------------------
  116. //  Take a configuration name and a set of MAPI properties and pack them into 
  117. //  a binary buffer suitable to be saved in the directory information tree for 
  118. //  the gateway or other object.
  119. // -----------------------------------------------------------------------------
  120. HRESULT HrCfgPackDataA(                        // RETURN: HRESULT
  121.     IN    LPSTR            lpszOwnerTag,        // name of configuration (or NULL)
  122.     IN    ULONG            cProps,                // number of MAPI properties
  123.     IN    LPSPropValue    lpProps,            // MAPI properties for this config.
  124.     OUT    ULONG *            lpcbConfigData,        // size of resulting binary struct.
  125.     OUT    LPBYTE *        lppbConfigData);    // resulting binary structure
  126.  
  127. HRESULT HrCfgPackDataW(                        // RETURN: HRESULT
  128.     IN    LPWSTR            lpwszOwnerTag,        // name of configuration (or NULL)
  129.     IN    ULONG            cProps,                // number of MAPI properties
  130.     IN    LPSPropValue    lpProps,            // MAPI properties for this config.
  131.     OUT    ULONG *            lpcbConfigData,        // size of resulting binary struct.
  132.     OUT    LPBYTE *        lppbConfigData);    // resulting binary structure
  133.  
  134. #ifdef UNICODE
  135. #define HrCfgPackData HrCfgPackDataW
  136. #else
  137. #define HrCfgPackData HrCfgPackDataA
  138. #endif
  139.  
  140. //$--HrCfgUnpackData------------------------------------------------------------
  141. //  Take a packed binary buffer and unpack it to yield a configuration name, 
  142. //  number of properties, and an array of MAPI properties.  If the number of 
  143. //  properties is zero then NULL is returned for the array of properties.
  144. // -----------------------------------------------------------------------------
  145. HRESULT HrCfgUnpackDataA(                    // RETURNS: HRESULT
  146.     IN    ULONG            cbConfigData,        // size of of binary structure
  147.     IN    LPBYTE            lpbConfigData,        // pointer to binary structure
  148.     OUT    LPSTR *            lppszOwnerTag,      // name of configuration (or NULL)
  149.     OUT    ULONG *            lpcProps,            // number of MAPI properties
  150.     OUT    LPSPropValue *    lppProps);            // MAPI properties for this config.
  151.  
  152. HRESULT HrCfgUnpackDataW(                    // RETURNS: HRESULT
  153.     IN    ULONG            cbConfigData,        // size of of binary structure
  154.     IN    LPBYTE            lpbConfigData,        // pointer to binary structure
  155.     OUT    LPWSTR *        lppwszOwnerTag,     // name of configuration (or NULL)
  156.     OUT    ULONG *            lpcProps,            // number of MAPI properties
  157.     OUT    LPSPropValue *    lppProps);            // MAPI properties for this config.
  158.  
  159. #ifdef UNICODE
  160. #define HrCfgUnpackData HrCfgUnpackDataW
  161. #else
  162. #define HrCfgUnpackData HrCfgUnpackDataA
  163. #endif
  164.  
  165. //$--HrOpenSiteContainer-----------------------------------------------------------------
  166. //  Takes a pointer to a MAPI session and returns an IMAPIProp interface for 
  167. //  the current site object.
  168. // -----------------------------------------------------------------------------
  169. HRESULT HrOpenSiteContainer(                            // RETURNS: HRESULT
  170.     IN    LPMAPISESSION    lpSession,            // MAPI session
  171.     OUT    LPMAPIPROP *    lppSite);           // current site
  172.  
  173. //$--HrOpenSiteContainerAddressing-------------------------------------------------------
  174. //  Takes a pointer to a MAPI session and returns an IMAPIProp interface for 
  175. //  the current site addressing object.
  176. // -----------------------------------------------------------------------------
  177. HRESULT HrOpenSiteContainerAddressing(               // RETURNS: HRESULT
  178.     IN    LPMAPISESSION    lpSession,          // MAPI session
  179.     OUT    LPMAPIPROP *    lppSiteAddressing); // current site addressing
  180.  
  181. //$--HrOpenSessionObject--------------------------------------------------------
  182. //  Takes a pointer to a MAPI session and returns an IMAPIProp interface for 
  183. //  the current object that the session is logged in as.
  184. // -----------------------------------------------------------------------------
  185. HRESULT HrOpenSessionObject(                // RETURNS: HRESULT
  186.     IN    LPMAPISESSION    lpSession,            // MAPI session
  187.     OUT    LPMAPIPROP *    lppCurrentObject);    // current object
  188.  
  189. //$--HrCfgPropertyTagFromNameId----------------------------------------------------
  190. //  Takes a pointer to an IMAPIProp interface and a name ID, and returns the 
  191. //  MAPI property tag that represents the given name ID for that interface.
  192. // -----------------------------------------------------------------------------
  193. HRESULT HrCfgPropertyTagFromNameId(            // RETURNS: HRESULT
  194.     IN    LPMAPIPROP        lpMAPIProp,            // IMAPIProp interface
  195.     IN  LONG            lNameID,            // Name ID
  196.     OUT    ULONG *            lpulPropTag);        // MAPI property tag of name ID
  197.  
  198. #ifdef __cplusplus
  199. }
  200. #endif
  201.  
  202. #pragma option pop /*P_O_Pop*/
  203. #endif
  204.