home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / adminext.h < prev    next >
Text File  |  1998-04-25  |  10KB  |  302 lines

  1. /**********************************************************************/
  2. /**                         Microsoft Exchange                       **/
  3. /**  Copyright (c) Microsoft Corp. 1986-1996. All Rights Reserved.   **/
  4. /**********************************************************************/
  5.  
  6. /*
  7.     adminext.h
  8.     This file contains the common messages, manifests, types, and
  9.     structures used by Microsoft Exchange Administration Extensions.
  10.  
  11.     NOTE:  You must include windows.h and mapix.h before this file.
  12.  
  13. */
  14.  
  15.  
  16.  
  17. #ifndef _ADMINEXT_H_
  18. #define _ADMINEXT_H_
  19.  
  20.  
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25.  
  26.  
  27.  
  28. // Miscellanous definitions
  29.  
  30. #define    ADMIN_ExtensionAPIVersion    0x000d
  31.  
  32.  
  33. // List of dialog page IDs passed to the ShowPage proc in the
  34. // extension DLL for approval.
  35.  
  36. // for gateway objects (ObjID_GW)
  37. #define    iddGWGeneral                3020
  38. #define    iddGWPermissions            3500
  39. #define    iddGWSchedule                4011
  40. #define    iddGWConnected_Sites        4020
  41. #define    iddGWAddress_Space            3021
  42. #define    iddGWDelivery_Restrictions    4008
  43. #define    iddGWAdvanced                3022
  44. #define    iddGWImportContainer        3063
  45. #define    iddGWExportContainers        3067
  46. #define iddGWDiagLogSetting            4030
  47.  
  48. // for mail agent objects (ObjID_MA)
  49. #define    iddMAGeneral                4028
  50. #define    iddMAPermissions            3500
  51. #define    iddMADistributionList        4090
  52. #define    iddMAEMailAddresses            4014
  53. #define    iddMADeliveryRestrictions    4008
  54. #define    iddMADeliveryOptions        4007
  55. #define    iddMASecurity                4051
  56. #define    iddMACustomAttributes        4022
  57. #define    iddMASchedule                4011
  58. #define    iddMAAdvanced                4040
  59.  
  60.  
  61.  
  62. typedef struct _ADMIN_ObjectInfo
  63. {
  64.     LPWSTR        szComputerName;            // Computer on which the gateway runs, when applicable
  65.     LPWSTR        szDistinguishedName;    // of the object administered
  66.     LPWSTR        szDNHomeMDB;            // Distinguished name of the server running the home message database
  67.     LPWSTR        szDNHomeMTA;            // Distinguished name of the server running the home message transport agent
  68.     LCID        lcid;                    // locale ID
  69.     UINT        uObjectID;                // object ID code
  70.     HFONT        hfontDialog;            // font handle
  71. } ADMIN_ObjectInfo;
  72.  
  73.  
  74. // Object ID codes
  75. #define ObjID_UK            0        // UnKnown
  76.  
  77. #define ObjID_DSFirst        1        // first DS DOC
  78.  
  79. #define ObjID_EP            2        // Enterprise
  80. #define ObjID_DM            3        // Domain (Site)
  81. #define ObjID_CT            4        // Container
  82. #define ObjID_SV            5        // Server
  83.  
  84.     // Recipients
  85. #define ObjID_MR            6        // Mail Recipients
  86. #define ObjID_MB            7        // Mailbox
  87. #define ObjID_DL            8        // Distribution List
  88. #define ObjID_RR            9        // Remote Recipient
  89. #define ObjID_PF            10        // Public Folder
  90. #define ObjID_MA            11        // Mail Agent
  91.  
  92.     // Connections
  93. #define ObjID_GW            12        // Gateway
  94. #define ObjID_MGW            13        // Special Gateway for Goalline
  95. #define ObjID_DXAREQ        14        // DXA requestor, was Remote DXA
  96. #define ObjID_DXASV            15        // DXA Site server
  97. #define ObjID_DXACONN        16        // DXA Server Connection
  98. #define ObjID_ISC            17        // Site Connector
  99. #define ObjID_LNKRAS        18        // Dynamic RAS Connector
  100. #define ObjID_LNKTCP        19        // TCP (RFC1006) X.400 Connector
  101. #define ObjID_LNKTP4        20        // TP4 X.400 Connector
  102. #define ObjID_LNKX25        21        // X.25 X.400 Connector
  103. #define ObjID_DRC            22        // Directory Replication Connector
  104.  
  105.     // Server Objects
  106. #define ObjID_MTA            23        // MTA
  107. #define ObjID_DSA            24        // Directory
  108. #define ObjID_MDB            26        // Private Information Store
  109. #define ObjID_PMDB            27        // Public Information Store
  110. #define ObjID_LDXA            28        // Local DXA
  111. #define ObjID_SAA            29        // System Attendant
  112. #define ObjID_STKRAS        30        // RAS MTA Transport Stack
  113. #define ObjID_STKTCP        31        // TCP (RFC1006) MTA Transport Stack
  114. #define ObjID_STKTP4        32        // TP4 MTA Transport Stack
  115. #define ObjID_STKX25        33        // X.25 MTA Transport Stack
  116.  
  117.     // Monitor Configurations
  118. #define ObjID_MSV            34        // Monitoring Server Configuration (DS)
  119. #define ObjID_MLK            35        // Monitoring Link Configuration (DS)
  120.  
  121.     // Templates
  122. #define ObjID_ATP            36        // Address Type
  123. #define ObjID_ATL            37        // Address Template
  124. #define ObjID_DTL            38        // Display Template
  125.  
  126.     // Schema Objects
  127. #define ObjID_Schema        39        // The Schema container (DMD)
  128. #define ObjID_SchemaAttr    40        // Schema Attribute
  129. #define ObjID_SchemaObj        41        // Schema Object
  130.  
  131.     // Site Configurations
  132. #define ObjID_ENC            42        // Encryption Configuration
  133. #define ObjID_SADR            43        // Site Addressing
  134. #define ObjID_SDSA            44        // Site Directory Configuration
  135. #define ObjID_SMDB            45        // Site Information Store Configuration
  136. #define ObjID_SMTA            46        // Site MTA Configuration
  137.  
  138. #define ObjID_ADDIN            47        // Add-In
  139. #define ObjID_EXT            48        // Admin Extension
  140.  
  141.  
  142.  
  143.  
  144.  
  145. typedef struct _ADMIN_SheetInfo
  146. {
  147.     HINSTANCE    hInstance;
  148.     UINT        iddDialog;        // To pass to MAKEINTRESOURCE()
  149.     DLGPROC        lpfnDlgProc;
  150.     UINT        idsName;        // For LoadString()
  151.     LPARAM        lParam;            // Passed to DlgProc on WM_INITDIALOG
  152.     LANGID         langid;            // language ID of dialog to be loaded
  153. } ADMIN_SheetInfo;
  154.  
  155.  
  156. /*********************************************************************************/
  157. /*********************************************************************************/
  158.  
  159. // Functions implemented by the Extension DLL
  160. // and called by the Microsoft Exchange Administrator program.
  161.  
  162. typedef BOOL (PASCAL * PADMIN_InstallExtension) (ADMIN_ObjectInfo * poi);
  163. typedef BOOL (PASCAL * PADMIN_DeinstallExtension) (ADMIN_ObjectInfo * poi);
  164. typedef BOOL (PASCAL * PADMIN_ShowPage) (UINT iddAdminPage);
  165. typedef INT (PASCAL * PADMIN_StartPage) (void);
  166. typedef BOOL (PASCAL * PADMIN_InitSheet)
  167.             (    ADMIN_ObjectInfo * poi,
  168.                 ULONG fFlags,
  169.                 ADMIN_SheetInfo ** ppsi,
  170.                 UINT * pcsi,
  171.                 VOID ** ppvExtensionData);
  172.  
  173. // PADMIN_InitSheet definitions for fFlags
  174. #define fxfReadOnly                    0x00000001
  175. // high byte of fFlags reserved as private for extension dll writers to use as they see fit.
  176. #define MaskExtensionPrivateFlags    0x00ffffff
  177.  
  178. /*********************************************************************************/
  179. /*********************************************************************************/
  180.  
  181. // FSetActive()   typedef BOOL (PASCAL * PADMIN_RefreshDisplay) (VOID * pvExtensionData, HWND hwnd);
  182. typedef BOOL (PASCAL * PADMIN_HasHelp) (VOID * pvExtensionData, HWND hwnd);
  183. typedef VOID (PASCAL * PADMIN_DoHelp) (VOID * pvExtensionData, HWND hwnd);
  184. typedef BOOL (PASCAL * PADMIN_SaveData) (VOID * pvExtensionData, HWND hwnd);
  185. typedef BOOL (PASCAL * PADMIN_CommitData) (VOID * pvExtensionData, HWND hwnd);
  186.  
  187. typedef VOID (PASCAL * PADMIN_DeinitSheet)
  188.                 (VOID * pvExtensionData);
  189.  
  190.  
  191. // The pointers in this structure (except pfnInitSheet) can be NULL
  192. // if a pointer is null, no call is made.
  193. typedef struct _ADMIN_ExtensionFunction
  194. {
  195.     int                            nAPIVersion;
  196.     PADMIN_InstallExtension        pfnInstallExtension;
  197.     PADMIN_DeinstallExtension    pfnDeinstallExtension;
  198.     PADMIN_InitSheet            pfnInitSheet;
  199.     PADMIN_ShowPage                pfnShowPage;
  200.     PADMIN_StartPage            pfnStartPage;
  201.     PADMIN_HasHelp                pfnHasHelp;
  202.     PADMIN_DoHelp                pfnDoHelp;
  203.     PADMIN_SaveData                pfnSaveData;
  204.     PADMIN_CommitData            pfnCommitData;
  205.     PADMIN_DeinitSheet            pfnDeinitSheet;
  206. } ADMIN_ExtensionFunction;
  207.  
  208.  
  209.  
  210. // Functions implemented by the Microsoft Exchange Administrator Program
  211. // and called by the Extension DLL.
  212.  
  213. typedef RC (PASCAL * PADMIN_GetObjectDataSize)
  214.                 (HWND hwnd, LPWSTR wszBlobName, UINT * pcb);
  215.  
  216. typedef RC (PASCAL * PADMIN_GetObjectData)
  217.                 (HWND hwnd, LPWSTR wszBlobName, BYTE * pb, UINT cb);
  218.  
  219. typedef RC (PASCAL * PADMIN_SetObjectData)
  220.                 (HWND hwnd, BYTE * pb, UINT cb, BOOL fNew);
  221.  
  222. // These 2 APIs take WCHAR *, NOT TCHAR!!!
  223. // szServiceName is the SHORT name of the service.
  224. typedef BOOL (PASCAL * PADMIN_AddService)
  225.                 (HWND hwnd, LPWSTR wszServiceName);
  226. typedef BOOL (PASCAL * PADMIN_RemoveService)
  227.                 (HWND hwnd, LPWSTR wszServiceName);
  228.  
  229. typedef VOID (PASCAL * PADMIN_InfoHasChanged)
  230.                 (HWND hwnd);
  231.  
  232. typedef VOID (PASCAL * PADMIN_SetIcon)
  233.                 (HWND hwnd, int id);
  234.  
  235. typedef VOID (PASCAL * PADMIN_SetTitle)
  236.                 (HWND hwnd, int id);
  237.  
  238. typedef BOOL (PASCAL * PADMIN_LoadDialogResource)
  239.                 (HINSTANCE hinst, UINT iddDialog, LANGID langid, BYTE ** ppbDialog);
  240.  
  241. // *ppbDialog will be set to NULL after being freed in this call
  242. typedef VOID (PASCAL * PADMIN_FreeDialogResource)
  243.                 (BYTE ** ppbDialog);
  244.  
  245. /*
  246.  *        psz is a pointer to an array of string pointers. The array is
  247.  *        cstr elements long.
  248.  *            Name 0:        psz[0], etc.
  249.  *        The extension is responsible for calling FreeNameList to reelease the memory
  250.  */
  251. typedef BOOL (PASCAL * PADMIN_GetNameList)
  252.                 (HWND hwnd, int * pcstr, LPWSTR ** ppsz);
  253. typedef void (PASCAL * PADMIN_FreeNameList)
  254.                 (int cstr, LPWSTR * psz);
  255. /*
  256.  *    Admin will make a copy of the strings, so the extension can release the memory
  257.  *    it allocated when the SetProxy call returns.
  258.  */
  259. typedef BOOL (PASCAL * PADMIN_SetNameList)
  260.                 (HWND hwnd, int cstr, LPWSTR * psz);
  261. // NOTE on both GetNameList and SetNameList: Admin will issue the error message if appropriate
  262.  
  263.  
  264. typedef struct _ADMIN_AdministratorFunction
  265. {
  266.     PADMIN_GetObjectDataSize    pfnGetObjectDataSize;
  267.     PADMIN_GetObjectData        pfnGetObjectData;
  268.     PADMIN_SetObjectData        pfnSetObjectData;
  269.     PADMIN_AddService            pfnAddService;
  270.     PADMIN_RemoveService        pfnRemoveService;
  271.     PADMIN_InfoHasChanged        pfnInfoHasChanged;
  272.     PADMIN_SetIcon                pfnSetIcon;
  273.     PADMIN_SetTitle                pfnSetTitle;
  274.     PADMIN_GetNameList            pfnGetNameList;
  275.     PADMIN_FreeNameList            pfnFreeNameList;
  276.     PADMIN_SetNameList            pfnSetNameList;
  277.     PADMIN_LoadDialogResource    pfnLoadDialogResource;
  278.     PADMIN_FreeDialogResource    pfnFreeDialogResource;
  279. } ADMIN_AdministratorFunction;
  280.  
  281. typedef struct _ADMIN_AdministratorConnections
  282. {
  283.     IMAPISession *        psesMapi;
  284.     IAddrBook *            pab;
  285.     IABContainer *        pabContainer;
  286. } ADMIN_AdministratorConnections;
  287.  
  288.  
  289. // Initialization function where the API is clarified.
  290.  
  291. typedef VOID (PASCAL * PADMIN_Initialize)
  292.             (    ADMIN_AdministratorConnections * pac,
  293.                 ADMIN_AdministratorFunction * pAdminFunction,
  294.                 ADMIN_ExtensionFunction ** ppExtensionFunction);
  295.  
  296.  
  297. #ifdef __cplusplus
  298. }
  299. #endif
  300.  
  301. #endif        // #ifndef _ADMINEXT_H_
  302.