ABP.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:21k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /***********************************************************************
  2.  *
  3.  *  ABP.H
  4.  *
  5.  *  Definitions for Sample Address Book Provider
  6.  *
  7.  *  Copyright 1992-1995 Microsoft Corporation.  All Rights Reserved.
  8.  *
  9.  ***********************************************************************/
  10. #ifdef _WIN32
  11. #define INC_OLE2                /* Get the OLE2 stuff */
  12. #define INC_RPC                 /* harmless on Windows NT; Windows 95 needs it */
  13. #endif
  14. #include <windows.h>
  15. #include <windowsx.h>
  16. #include <limits.h>
  17. #include <mapiwin.h>
  18. #include <mapidbg.h>
  19. #include <mapidefs.h>
  20. #include <mapicode.h>
  21. #include <mapitags.h>
  22. #include <mapiguid.h>
  23. #include <mapispi.h>
  24. #include <mapiutil.h>
  25. #include <mapival.h>
  26. #include <memory.h>
  27. #include <commdlg.h>
  28. /*
  29.  *  IUnknown base members
  30.  */
  31. #define SAB_IUnknown                    
  32.     LONG                lcInit;         
  33.     HRESULT             hResult;        
  34.     UINT                idsLastError;   
  35.     HINSTANCE           hLibrary;       
  36.     LPALLOCATEBUFFER    lpAllocBuff;    
  37.     LPALLOCATEMORE      lpAllocMore;    
  38.     LPFREEBUFFER        lpFreeBuff;     
  39.     LPMALLOC            lpMalloc;       
  40.     CRITICAL_SECTION    cs
  41. #define SAB_IUnkWithLogon               
  42.     SAB_IUnknown;                       
  43.     LPABLOGON           lpABLogon
  44. #define SAB_Wrapped                     
  45.     SAB_IUnkWithLogon;                  
  46.     LPMAPIPROP          lpPropData
  47. /*
  48.  *  Definition of all the objects referred to in the various source modules
  49.  *  of this provider.
  50.  */
  51. /*
  52.  *  Declaration of IABProvider object implementation
  53.  *  Code for this is in ABP.C
  54.  */
  55. #undef  INTERFACE
  56. #define INTERFACE struct _ABP
  57. #undef  MAPIMETHOD_
  58. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, ABP_)
  59.         MAPI_IUNKNOWN_METHODS(IMPL)
  60.         MAPI_IABPROVIDER_METHODS(IMPL)
  61. #undef  MAPIMETHOD_
  62. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, ABP_)
  63.         MAPI_IUNKNOWN_METHODS(IMPL)
  64.         MAPI_IABPROVIDER_METHODS(IMPL)
  65. #undef  MAPIMETHOD_
  66. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  67. DECLARE_MAPI_INTERFACE(ABP_)
  68. {
  69.     MAPI_IUNKNOWN_METHODS(IMPL)
  70.     MAPI_IABPROVIDER_METHODS(IMPL)
  71. };
  72. /*
  73.  *  Declaration of IABLogon object implementation
  74.  *  Code for this is in ABP.C
  75.  */
  76. #undef  INTERFACE
  77. #define INTERFACE struct _ABPLOGON
  78. #undef  MAPIMETHOD_
  79. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, ABPLOGON_)
  80.         MAPI_IUNKNOWN_METHODS(IMPL)
  81.         MAPI_IABLOGON_METHODS(IMPL)
  82. #undef  MAPIMETHOD_
  83. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, ABPLOGON_)
  84.         MAPI_IUNKNOWN_METHODS(IMPL)
  85.         MAPI_IABLOGON_METHODS(IMPL)
  86. #undef  MAPIMETHOD_
  87. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  88. DECLARE_MAPI_INTERFACE(ABPLOGON_)
  89. {
  90.     MAPI_IUNKNOWN_METHODS(IMPL)
  91.     MAPI_IABLOGON_METHODS(IMPL)
  92. };
  93. /*
  94.  *  Declaration of IABContainer object implementation
  95.  *  Code for this is in ROOT.C
  96.  */
  97. #undef  INTERFACE
  98. #define INTERFACE   struct _ROOT
  99. #undef  MAPIMETHOD_
  100. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, ROOT_)
  101.         MAPI_IUNKNOWN_METHODS(IMPL)
  102.         MAPI_IMAPIPROP_METHODS(IMPL)
  103.         MAPI_IMAPICONTAINER_METHODS(IMPL)
  104.         MAPI_IABCONTAINER_METHODS(IMPL)
  105. #undef  MAPIMETHOD_
  106. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, ROOT_)
  107.         MAPI_IUNKNOWN_METHODS(IMPL)
  108.         MAPI_IMAPIPROP_METHODS(IMPL)
  109.         MAPI_IMAPICONTAINER_METHODS(IMPL)
  110.         MAPI_IABCONTAINER_METHODS(IMPL)
  111. #undef  MAPIMETHOD_
  112. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  113. DECLARE_MAPI_INTERFACE(ROOT_)
  114. {
  115.     MAPI_IUNKNOWN_METHODS(IMPL)
  116.     MAPI_IMAPIPROP_METHODS(IMPL)
  117.     MAPI_IMAPICONTAINER_METHODS(IMPL)
  118.     MAPI_IABCONTAINER_METHODS(IMPL)
  119. };
  120. #define ROOT_ValidateObject(Method, pThis)          
  121. {                                                   
  122.     HRESULT hResult;                                
  123.     if (IsBadReadPtr(pThis, sizeof(ROOT)))          
  124.     {                                               
  125.         hResult = ResultFromScode(E_INVALIDARG);    
  126.         DebugTraceResult(ROOT##_##Method, hResult); 
  127.         return hResult;                             
  128.     }                                               
  129.                                                     
  130.     if (pThis->lpVtbl != &vtblROOT)                 
  131.     {                                               
  132.         hResult = ResultFromScode(E_INVALIDARG);    
  133.         DebugTraceResult(ROOT##_##Method, hResult); 
  134.         return hResult;                             
  135.     }                                               
  136. }
  137. /*
  138.  *  Declaration of IABContainer object implementation
  139.  *  Code for this is in ABCONT.C
  140.  */
  141. #undef  INTERFACE
  142. #define INTERFACE   struct _ABCNT
  143. #undef  MAPIMETHOD_
  144. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, ABC_)
  145.         MAPI_IUNKNOWN_METHODS(IMPL)
  146.         MAPI_IMAPIPROP_METHODS(IMPL)
  147.         MAPI_IMAPICONTAINER_METHODS(IMPL)
  148.         MAPI_IABCONTAINER_METHODS(IMPL)
  149. #undef  MAPIMETHOD_
  150. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, ABC_)
  151.         MAPI_IUNKNOWN_METHODS(IMPL)
  152.         MAPI_IMAPIPROP_METHODS(IMPL)
  153.         MAPI_IMAPICONTAINER_METHODS(IMPL)
  154.         MAPI_IABCONTAINER_METHODS(IMPL)
  155. #undef  MAPIMETHOD_
  156. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  157. DECLARE_MAPI_INTERFACE(ABC_)
  158. {
  159.     MAPI_IUNKNOWN_METHODS(IMPL)
  160.     MAPI_IMAPIPROP_METHODS(IMPL)
  161.     MAPI_IMAPICONTAINER_METHODS(IMPL)
  162.     MAPI_IABCONTAINER_METHODS(IMPL)
  163. };
  164. #define ABC_ValidateObject(Method, pThis)           
  165. {                                                   
  166.     HRESULT hResult;                                
  167.     if (IsBadReadPtr(pThis, sizeof(ABC)))           
  168.     {                                               
  169.         hResult = ResultFromScode(E_INVALIDARG);    
  170.         DebugTraceResult(ABC##_##Method, hResult);  
  171.         return hResult;                             
  172.     }                                               
  173.                                                     
  174.     if (pThis->lpVtbl != &vtblABC)                  
  175.     {                                               
  176.         hResult = ResultFromScode(E_INVALIDARG);    
  177.         DebugTraceResult(ABC##_##Method, hResult);  
  178.         return hResult;                             
  179.     }                                               
  180. }
  181. /*
  182.  *  Declaration of IMAPIContainer object implementation
  183.  *  Code for this is in ABSEARCH.C
  184.  */
  185. #undef  INTERFACE
  186. #define INTERFACE   struct _ABSRCH
  187. #undef  MAPIMETHOD_
  188. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, ABSRCH_)
  189.         MAPI_IUNKNOWN_METHODS(IMPL)
  190.         MAPI_IMAPIPROP_METHODS(IMPL)
  191.         MAPI_IMAPICONTAINER_METHODS(IMPL)
  192.         MAPI_IABCONTAINER_METHODS(IMPL)
  193. #undef  MAPIMETHOD_
  194. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, ABSRCH_)
  195.         MAPI_IUNKNOWN_METHODS(IMPL)
  196.         MAPI_IMAPIPROP_METHODS(IMPL)
  197.         MAPI_IMAPICONTAINER_METHODS(IMPL)
  198.         MAPI_IABCONTAINER_METHODS(IMPL)
  199. #undef  MAPIMETHOD_
  200. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  201. DECLARE_MAPI_INTERFACE(ABSRCH_)
  202. {
  203.     MAPI_IUNKNOWN_METHODS(IMPL)
  204.     MAPI_IMAPIPROP_METHODS(IMPL)
  205.     MAPI_IMAPICONTAINER_METHODS(IMPL)
  206. };
  207. #define ABSRCH_ValidateObject(Method, pThis)        
  208. {                                                   
  209.     HRESULT hResult;                                
  210.     if (IsBadReadPtr(pThis, sizeof(ABSRCH)))        
  211.     {                                               
  212.         hResult = ResultFromScode(E_INVALIDARG);    
  213.         DebugTraceResult(ABSRCH##_##Method, hResult);   
  214.         return hResult;                             
  215.     }                                               
  216.                                                     
  217.     if (pThis->lpVtbl != &vtblABSRCH)                   
  218.     {                                               
  219.         hResult = ResultFromScode(E_INVALIDARG);    
  220.         DebugTraceResult(ABSRCH##_##Method, hResult);   
  221.         return hResult;                             
  222.     }                                               
  223. }
  224. /*
  225.  *  Declaration of IMailUser object implementation
  226.  *  Code for this is in ABUSER.C
  227.  */
  228. #undef  INTERFACE
  229. #define INTERFACE   struct _ABUSER
  230. #undef  MAPIMETHOD_
  231. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, ABU_)
  232.         MAPI_IUNKNOWN_METHODS(IMPL)
  233.         MAPI_IMAPIPROP_METHODS(IMPL)
  234.         MAPI_IMAILUSER_METHODS(IMPL)
  235. #undef  MAPIMETHOD_
  236. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, ABU_)
  237.         MAPI_IUNKNOWN_METHODS(IMPL)
  238.         MAPI_IMAPIPROP_METHODS(IMPL)
  239.         MAPI_IMAILUSER_METHODS(IMPL)
  240. #undef  MAPIMETHOD_
  241. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  242. DECLARE_MAPI_INTERFACE(ABU_)
  243. {
  244.     MAPI_IUNKNOWN_METHODS(IMPL)
  245.     MAPI_IMAPIPROP_METHODS(IMPL)
  246.     MAPI_IMAILUSER_METHODS(IMPL)
  247. };
  248. #define ABU_ValidateObject(Method, pThis)       
  249. {                                                   
  250.     HRESULT hResult;                                
  251.     if (IsBadReadPtr(pThis, sizeof(ABUSER)))        
  252.     {                                               
  253.         hResult = ResultFromScode(E_INVALIDARG);    
  254.         DebugTraceResult(ABU##_##Method, hResult);  
  255.         return hResult;                             
  256.     }                                               
  257.                                                     
  258.     if (pThis->lpVtbl != &vtblABU)                  
  259.     {                                               
  260.         hResult = ResultFromScode(E_INVALIDARG);    
  261.         DebugTraceResult(ABU##_##Method, hResult);  
  262.         return hResult;                             
  263.     }                                               
  264. }
  265. /*
  266.  *  Declaration of IMAPIProp object implementation
  267.  *  Code for this is in WRAP.C
  268.  */
  269. #undef  INTERFACE
  270. #define INTERFACE   struct _WRAP
  271. #undef  MAPIMETHOD_
  272. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, WRAP_)
  273.         MAPI_IUNKNOWN_METHODS(IMPL)
  274.         MAPI_IMAPIPROP_METHODS(IMPL)
  275. #undef  MAPIMETHOD_
  276. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, WRAP_)
  277.         MAPI_IUNKNOWN_METHODS(IMPL)
  278.         MAPI_IMAPIPROP_METHODS(IMPL)
  279. #undef  MAPIMETHOD_
  280. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  281. DECLARE_MAPI_INTERFACE(WRAP_)
  282. {
  283.     MAPI_IUNKNOWN_METHODS(IMPL)
  284.     MAPI_IMAPIPROP_METHODS(IMPL)
  285. };
  286. #undef  INTERFACE
  287. #define INTERFACE   struct _IVTABC
  288. #undef  MAPIMETHOD_
  289. #define MAPIMETHOD_(type, method)   MAPIMETHOD_DECLARE(type, method, IVTABC_)
  290.         MAPI_IUNKNOWN_METHODS(IMPL)
  291.         MAPI_IMAPITABLE_METHODS(IMPL)
  292. #undef  MAPIMETHOD_
  293. #define MAPIMETHOD_(type, method)   MAPIMETHOD_TYPEDEF(type, method, IVTABC_)
  294.         MAPI_IUNKNOWN_METHODS(IMPL)
  295.         MAPI_IMAPITABLE_METHODS(IMPL)
  296. #undef  MAPIMETHOD_
  297. #define MAPIMETHOD_(type, method)   STDMETHOD_(type, method)
  298. DECLARE_MAPI_INTERFACE(IVTABC_)
  299. {
  300.     MAPI_IUNKNOWN_METHODS(IMPL)
  301.     MAPI_IMAPITABLE_METHODS(IMPL)
  302. };
  303. /*
  304.  *  Internal utility functions that allow access to data stored in the Init object
  305.  */
  306. void
  307. RemoveLogonObject(LPABPROVIDER lpABProvider, LPVOID lpvABLogon, LPFREEBUFFER lpFreeBuff);
  308. void
  309. FindLogonObject(LPABPROVIDER lpABProvider, LPMAPIUID lpMuidToFind, LPABLOGON * lppABLogon);
  310. /*
  311.  *  Internal utility functions that allow access to data stored in the logon object
  312.  */
  313. LPMAPIUID
  314. LpMuidFromLogon(LPABLOGON lpABLogon);
  315. HRESULT
  316. HrLpszGetCurrentFileName(LPABLOGON lpABLogon, LPSTR * lppszFileName);
  317. HRESULT
  318. HrReplaceCurrentFileName(LPABLOGON lpABLogon, LPSTR lpstrT);
  319. void
  320. GenerateContainerDN(LPABLOGON lpABLogon, LPSTR lpszName);
  321. BOOL
  322. FEqualSABFiles( LPABLOGON lpABLogon,
  323.                 LPSTR lpszFileName);
  324. /*
  325.  *
  326.  *  Functions that return new objects
  327.  *
  328.  */
  329. /*
  330.  *  Creates a new ABPLogon object  (see ABLOGON.C)
  331.  */
  332. HRESULT
  333. HrNewABLogon(   LPABLOGON *         lppABLogon,
  334.                 LPABPROVIDER        lpABP,
  335.                 LPMAPISUP           lpMAPISup,
  336.                 LPSTR               lpszSABFile,
  337.                 LPMAPIUID           lpmuid,
  338.                 HINSTANCE           hLibrary,
  339.                 LPALLOCATEBUFFER    lpAllocBuff,
  340.                 LPALLOCATEMORE      lpAllocMore,
  341.                 LPFREEBUFFER        lpFreeBuff,
  342.                 LPMALLOC            lpMalloc );
  343. /*
  344.  *  Creates a new ROOT container object  (see ROOT.C)
  345.  */
  346. HRESULT
  347. HrNewROOT(LPABCONT *        lppROOT,
  348.           ULONG *           lpulObjType,
  349.           LPABLOGON         lpABPLogon,
  350.           LPCIID            lpInterface,
  351.           HINSTANCE         hLibrary,
  352.           LPALLOCATEBUFFER  lpAllocBuff,
  353.           LPALLOCATEMORE    lpAllocMore,
  354.           LPFREEBUFFER      lpFreeBuff,
  355.           LPMALLOC          lpMalloc );
  356. /*
  357.  *  Creates a new directory container object (see ABCONT.C)
  358.  */
  359. HRESULT 
  360. HrNewSampDirectory( LPABCONT *          lppABC,
  361.                     ULONG *             lpulObjType,
  362.                     LPABLOGON           lpABPLogon,
  363.                     LPCIID              lpInterface,
  364.                     HINSTANCE           hLibrary,
  365.                     LPALLOCATEBUFFER    lpAllocBuff,
  366.                     LPALLOCATEMORE      lpAllocMore,
  367.                     LPFREEBUFFER        lpFreeBuff,
  368.                     LPMALLOC            lpMalloc );
  369. /*
  370.  *  Creates the search object associated with the SampDirectory (see ABSEARCH.C)
  371.  */
  372. HRESULT
  373. HrNewSearch(LPMAPICONTAINER *   lppABSearch,
  374.             LPABLOGON           lpABLogon,
  375.             LPCIID              lpInterface,
  376.             HINSTANCE           hLibrary,
  377.             LPALLOCATEBUFFER    lpAllocBuff,
  378.             LPALLOCATEMORE      lpAllocMore,
  379.             LPFREEBUFFER        lpFreeBuff,
  380.             LPMALLOC            lpMalloc );
  381. /*
  382.  *  Creates a new Mail User object  (see ABUSER.C)
  383.  */
  384. HRESULT
  385. HrNewSampUser(  LPMAILUSER *        lppMAPIPropEntry,
  386.                 ULONG *             lpulObjectType,
  387.                 ULONG               cbEntryID,
  388.                 LPENTRYID           lpEntryID,
  389.                 LPABLOGON           lpABPLogon,
  390.                 LPCIID              lpInterface,
  391.                 HINSTANCE           hLibrary,
  392.                 LPALLOCATEBUFFER    lpAllocBuff,
  393.                 LPALLOCATEMORE      lpAllocMore,
  394.                 LPFREEBUFFER        lpFreeBuff,
  395.                 LPMALLOC            lpMalloc );
  396. /*
  397.  *  Creates a new one-off templateID object (see TID.C)
  398.  */
  399. HRESULT 
  400. HrNewOOTID( LPMAPIPROP *        lppMAPIPropNew,
  401.             ULONG               cbTemplateId,
  402.             LPENTRYID           lpTemplateId,
  403.             ULONG               ulTemplateFlags,
  404.             LPMAPIPROP          lpMAPIPropData,
  405.             LPABLOGON           lpABPLogon,
  406.             LPCIID              lpInterface,
  407.             HINSTANCE           hLibrary,
  408.             LPALLOCATEBUFFER    lpAllocBuff,
  409.             LPALLOCATEMORE      lpAllocMore,
  410.             LPFREEBUFFER        lpFreeBuff,
  411.             LPMALLOC            lpMalloc );
  412. /*
  413.  *  Creates a new one-off mail user object (see OOUSER.C)
  414.  */
  415. HRESULT
  416. HrNewSampOOUser(LPMAILUSER *        lppMAPIPropEntry,
  417.                 ULONG *             lpulObjectType,
  418.                 ULONG               cbEntryID,
  419.                 LPENTRYID           lpEntryID,
  420.                 LPABLOGON           lpABPLogon,
  421.                 LPCIID              lpInterface,
  422.                 HINSTANCE           hLibrary,
  423.                 LPALLOCATEBUFFER    lpAllocBuff,
  424.                 LPALLOCATEMORE      lpAllocMore,
  425.                 LPFREEBUFFER        lpFreeBuff,
  426.                 LPMALLOC            lpMalloc );
  427. /*
  428.  *  Creates a new status object for this provider (see STATUS.C)
  429.  */
  430. HRESULT 
  431. HrNewStatusObject(LPMAPISTATUS *    lppABS,
  432.                 ULONG *             lpulObjType,
  433.                 ULONG               ulFlags,
  434.                 LPABLOGON           lpABPLogon,
  435.                 LPCIID              lpInterface,
  436.                 HINSTANCE           hLibrary,
  437.                 LPALLOCATEBUFFER    lpAllocBuff,
  438.                 LPALLOCATEMORE      lpAllocMore,
  439.                 LPFREEBUFFER        lpFreeBuff,
  440.                 LPMALLOC            lpMalloc );
  441. /*
  442.  * Creates a new templateID object that's associated with
  443.  * a SAB mailuser object.
  444.  */
  445. HRESULT
  446. HrNewTID (  LPMAPIPROP *        lppMAPIPropNew,
  447.             ULONG               cbTemplateId,
  448.             LPENTRYID           lpTemplateId,
  449.             ULONG               ulTemplateFlags,
  450.             LPMAPIPROP          lpMAPIPropData,
  451.             LPABLOGON           lpABPLogon,
  452.             LPCIID              lpInterface,
  453.             HINSTANCE           hLibrary,
  454.             LPALLOCATEBUFFER    lpAllocBuff,
  455.             LPALLOCATEMORE      lpAllocMore,
  456.             LPFREEBUFFER        lpFreeBuff,
  457.             LPMALLOC            lpMalloc );
  458. /*
  459.  *  Creates a new contents table object
  460.  */
  461. HRESULT
  462. HrNewIVTAbc (LPMAPITABLE *      lppIVTAbc,
  463.              LPABLOGON          lpABLogon,
  464.              LPABCONT           lpABC,
  465.              HINSTANCE          hLibrary,
  466.              LPALLOCATEBUFFER   lpAllocBuff,
  467.              LPALLOCATEMORE     lpAllocMore,
  468.              LPFREEBUFFER       lpFreeBuff,
  469.              LPMALLOC           lpMalloc );
  470. /*
  471.  *  Creates/Updates the SAB's root hierarchy
  472.  */
  473. HRESULT
  474. HrBuildRootHier(LPABLOGON lpABLogon, LPMAPITABLE * lppMAPITable);
  475. /*
  476.  *  Sets an error string associated with a particular hResult on an object.
  477.  *  It's used in conjunction with the method GetLastError.
  478.  */
  479. VOID SetErrorIDS (LPVOID lpObject, HRESULT hResult, UINT ids);
  480. /*
  481.  *  Loads a string from a resource.  Optionally allocates room for the string
  482.  *  if lpAllocBuff is not NULL.  See ABP.C.
  483.  */
  484. SCODE ScLoadString( UINT                ids,
  485.                     ULONG               ulcch,
  486.                     LPALLOCATEBUFFER    lpAllocBuff,
  487.                     HINSTANCE           hLibrary,
  488.                     LPSTR *             lppsz);
  489. /*
  490.  *  The sample ABPs MAPIUID
  491.  *
  492.  *  This MAPIUID must be unique (see the Service Provider Writer's Guide on
  493.  *  Constructing Entry IDs)
  494.  */
  495. #define MUIDABSAMPLE {0x81,0x2b,0x1f,0x40,0xbe,0xa3,0x10,0x19,0x9d,0x6e,0x00,0xdd,0x01,0x0f,0x54,0x02}
  496. #define SZEMAILTYPE                         "MSPEER"
  497. #define MAX_DISPLAY_NAME                    45
  498. /*
  499.  *  Browse record
  500.  *
  501.  *  The .SAB files are made up of the following records.
  502.  */
  503. #define MAX_NAME_SIZE   30
  504. #define MAX_EMA_SIZE    50
  505. #pragma pack(4)
  506. typedef struct _ABCREC
  507. {
  508.     char rgchDisplayName[MAX_NAME_SIZE + 1];
  509.     char rgchEmailAddress[MAX_EMA_SIZE + 1];
  510. } ABCREC, *LPABCREC;
  511. #pragma pack()
  512. /*
  513.  *  Defines of various entryid types
  514.  */
  515. #define SAMP_DIRECTORY  0x00000000
  516. #define SAMP_USER       0x00000001
  517. #define SAMP_UNKNOWN    0x00000002
  518. #define SAMP_OOUSER     0x00000003
  519. /*
  520.  *  The version of this ABPs entryids
  521.  */
  522. #define SAMP_VERSION    0x000000002
  523. /*
  524.  *  Directory entry id structure
  525.  *
  526.  *  This entryid is permanent.
  527.  */
  528. typedef struct _dir_entryid
  529. {
  530.     BYTE abFlags[4];
  531.     MAPIUID muid;
  532.     ULONG ulVersion;
  533.     ULONG ulType;
  534.     MAPIUID muidID;
  535. } DIR_ENTRYID, *LPDIR_ENTRYID;
  536. /*
  537.  *  Mail user entry id structure
  538.  *
  539.  *  This entryid is permanent.
  540.  */
  541. #pragma pack(4)
  542. typedef struct _usr_entryid
  543. {
  544.     BYTE abFlags[4];
  545.     MAPIUID muid;
  546.     ULONG ulVersion;
  547.     ULONG ulType;
  548.     ABCREC abcrec;
  549. } USR_ENTRYID, *LPUSR_ENTRYID;
  550. #pragma pack()
  551. /*
  552.  *  One off user entry id structure
  553.  *
  554.  *  This entryid is permanent.
  555.  */
  556. typedef struct _oousr_entryid
  557. {
  558.     BYTE abFlags[4];
  559.     MAPIUID muid;
  560.     ULONG ulVersion;
  561.     ULONG ulType;
  562. } OOUSR_ENTRYID, *LPOOUSR_ENTRYID;
  563. /*
  564.  *  Externs used throughout various modules within this provider.
  565.  *  They actually get defined in abp.c
  566.  */
  567. extern LCID lcidUser;
  568. extern MAPIUID muidABSample;
  569. extern MAPIUID muidSABProviderID;
  570. extern DTBLLABEL dtbllabel;
  571. extern DTBLPAGE dtblpage;
  572. extern DTBLGROUPBOX dtblgroupbox;
  573. extern CHAR szNoFilter[];
  574. extern LPSTR lpszEMT;
  575. extern CHAR szAddrTypeFilter[];
  576. extern CHAR szFileNameFilter[];
  577. #define PR_LISTBOX_TABLE                PROP_TAG(PT_OBJECT,0x6605)
  578. #define PR_COMBOBOX_TABLE               PROP_TAG(PT_OBJECT,0x6607)
  579. #define PR_DDLISTBOX_TABLE              PROP_TAG(PT_OBJECT,0x6609)
  580. /*
  581.  *  Properties defined for our one-off entry
  582.  */
  583. #define     PR_SERVER_NAME              PROP_TAG(PT_TSTRING,0x660b)
  584. #define     PR_SHARE_NAME               PROP_TAG(PT_TSTRING,0x660c)
  585. #define     PR_PATH_NAME                PROP_TAG(PT_TSTRING,0x660d)
  586. #define MAX_SERVER_NAME                 15
  587. #define MAX_SHARE_NAME                  12
  588. /*
  589.  *  MACROs for Win16
  590.  */
  591. #ifdef WIN16
  592. #define lstrcatA        lstrcat
  593. #define wsprintfA       wsprintf
  594. #define CharUpperBuffA  CharUpperBuff
  595. #endif /*WIN16*/