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

  1. #if !defined( _MSFS_H )
  2. #define _MSFS_H
  3.  
  4. /*
  5.  *  M S F S . H
  6.  *
  7.  *
  8.  *  Copyright 1986 - 1998 Microsoft Corporation.  All Rights Reserved.
  9.  *
  10.  *
  11.  *  Definitions used by the the Microsoft Mail transport, address book
  12.  *  and shared folder service providers.
  13.  *
  14.  *  The following MSFS defined properties are configurable via ConfigureMsgService()
  15.  *  calls.  They are grouped by function.
  16.  *
  17.  *  C o n n e c t i o n   P r o p e r t i e s
  18.  *
  19.  *  PR_CFG_SERVER_PATH
  20.  *      --  The path to the users post office.  Mapped network drives, UNC and NETWARE paths
  21.  *          are acceptable.  NETWARE paths of the type NWServer/share:dir\dir1 are converted to 
  22.  *          UNC paths of the type \\NWServer\share\dir\dir1. 
  23.  *
  24.  *  PR_CFG_MAILBOX
  25.  *      --  The users mailbox name.  eg. in a NET/PO/USER address,
  26.  *          this is USER.  The maximum mailbox name is 10 characters.
  27.  *
  28.  *  PR_CFG_PASSWORD
  29.  *      --  The users mailbox password.  The maximum password is 8 characters.
  30.  *
  31.  *  PR_CFG_REMEMBER
  32.  *      --  A boolean value indicating whether the users password is
  33.  *          to be remembered in the profile or not.  This is useful because
  34.  *          if the password is remembered the user can bypass the logon prompt
  35.  *          if his server path, mailbox name and password are all supplied.
  36.  *
  37.  *  PR_CFG_CONN_TYPE
  38.  *      --  The connection type.  This may be one of CFG_CONN_AUTO, CFG_CONN_LAN,
  39.  *          CFG_CONN_REMOTE, CFG_CONN_OFFLINE as defined below.
  40.  *
  41.  *          CFG_CONN_AUTO       --  Automatically detect whether the connection type is LAN or REMOTE.
  42.  *                                  This connection type is only available on Win95.
  43.  *          CFG_CONN_LAN        --  LAN type connection.  Used to connect to the post office using a
  44.  *                                  UNC path or pre-existing mapped drive.
  45.  *          CFG_CONN_REMOTE     --  Dial up connection using Dial-up Networking.
  46.  *          CFG_CONN_OFFLINE    --  Not connected.
  47.  *
  48.  *  PR_CFG_SESSION_LOG
  49.  *      --  A boolean value indicating whether session logging
  50.  *          is on or off.
  51.  *
  52.  *  PR_CFG_SESSION_LOG_FILE
  53.  *      --  The path to the session log file.
  54.  *
  55.  *  D e l i v e r y   P r o p e r t i e s
  56.  *
  57.  *  PR_CFG_ENABLE_UPLOAD
  58.  *      --  A boolean value which indicates whether mail in the outbox
  59.  *          is sent.
  60.  *
  61.  *  PR_CFG_ENABLE_DOWNLOAD
  62.  *      --  A boolean value which indicates whether mail in the server
  63.  *          mailbag is downloaded.
  64.  *
  65.  *  PR_CFG_UPLOADTO
  66.  *      --  A bit array which allows the user to indicate which addresses
  67.  *          for which the transport is to attempt delivery.  This is useful
  68.  *          in order to allow a user to specify that a transport only handle
  69.  *          delivery for a subset of the addresses it can really process.
  70.  *          When multiple transports are installed and the user wants a
  71.  *          different transport to handle some specific address types they
  72.  *          can use this bit array to specify that the MSMAIL transport
  73.  *          only handle a specific set of addresses.
  74.  *
  75.  *          Possible values as defined below include:
  76.  *
  77.  *          CFG_UPLOADTO_PCMAIL     --  Local Post Office and External Post Office address types
  78.  *          CFG_UPLOADTO_PROFS      --  PROFS address types
  79.  *          CFG_UPLOADTO_SNADS      --  SNADS address types
  80.  *          CFG_UPLOADTO_OV         --  OfficeVision address types
  81.  *          CFG_UPLOADTO_MCI        --  MCI address types
  82.  *          CFG_UPLOADTO_X400       --  X.400 address types
  83.  *          CFG_UPLOADTO_FAX        --  FAX address types
  84.  *          CFG_UPLOADTO_MHS        --  MHS address types
  85.  *          CFG_UPLOADTO_SMTP       --  SMTP address types
  86.  *          CFG_UPLOADTO_MACMAIL    --  MacMail address types
  87.  *          CFG_UPLOADTO_ALL        --  All of the above address types
  88.  *
  89.  *
  90.  *  PR_CFG_NETBIOS_NTFY
  91.  *      --  A boolean value which indicates whether a netbios notification
  92.  *          is sent to a recipients transport when mail is delivered to
  93.  *          their server inbox.
  94.  *
  95.  *  PR_CFG_SPOOLER_POLL
  96.  *      --  The polling interval in minutes when the transport
  97.  *          checks for new mail.  1 <= polling interval <= 9999
  98.  *
  99.  *  PR_CFG_GAL_ONLY
  100.  *      --  A boolean value which, if TRUE, only displays the Microsoft Mail Global Address
  101.  *          list for name selection.  The Postoffice list, external post office lists, and gateway
  102.  *          address lists are not shown.
  103.  *
  104.  *  F a s t  L A N  P r o p e r t i e s
  105.  *
  106.  *  PR_CFG_LAN_HEADERS
  107.  *      --  A boolean value which indicates whether the user wants to enable
  108.  *          headers while working on the LAN.  Headers mode allows the user
  109.  *          to download message headers and selectively choose which mail
  110.  *          to download.
  111.  *
  112.  *  PR_CFG_LAN_LOCAL_AB
  113.  *      --  A boolean value which indicates whether the user wants to use
  114.  *          name resolution based on a local copy of the server address book
  115.  *          rather than the server address book itself.
  116.  *
  117.  *  PR_CFG_LAN_EXTERNAL_DELIVERY
  118.  *      --  A boolean value which indicates whether EXTERNAL.EXE, a server process, should be used
  119.  *          to deliver submitted mail messages.  This is sometimes useful when mail is running 
  120.  *          on a slow LAN connection.
  121.  *
  122.  *  S l o w  L A N  P r o p e r t i e s
  123.  *
  124.  *  PR_CFG_RAS_HEADERS
  125.  *      --  A boolean value which indicates whether the user wants to enable
  126.  *          headers while working over a slow speed link.  Headers mode
  127.  *          allows the user to download message headers and selectively
  128.  *          choose which mail to download.
  129.  *
  130.  *  PR_CFG_RAS_LOCAL_AB
  131.  *      --  A boolean value which indicates whether the user wants to use
  132.  *          name resolution based on a local copy of the server address book
  133.  *          rather than the server address book itself.
  134.  *
  135.  *  PR_CFG_RAS_EXTERNAL_DELIVERY
  136.  *      --  A boolean value which indicates whether EXTERNAL.EXE, a server process, should be used
  137.  *          to deliver submitted mail messages.  This speeds up message delivery when mail is
  138.  *          running on a Dial-up network connection.
  139.  *
  140.  *  PR_CFG_RAS_INIT_ON_START
  141.  *      --  A boolean value which indicates that a Dial-up Network connection should
  142.  *          be established when the transport provider starts up.
  143.  *
  144.  *  PR_CFG_RAS_TERM_ON_HDRS
  145.  *      --  A boolean value which indicates that a Dial-up Network connection should
  146.  *          be automatically terminated when headers are finished downloading.
  147.  *
  148.  *  PR_CFG_RAS_TERM_ON_XFER
  149.  *      --  A boolean value which indicates that a Dial-up Network connection should
  150.  *          be automatically terminated after mail has finished being sent
  151.  *          received.
  152.  *
  153.  *  PR_CFG_RAS_TERM_ON_EXIT
  154.  *      --  A boolean value which indicates that a Dial-up Network connection should
  155.  *          be automatically terminated when the provider is exited.
  156.  *
  157.  *  PR_CFG_RAS_PROFILE
  158.  *      --  The name of the Dial-up Network profile that the transport will use by
  159.  *          default to attempt the connection.
  160.  *
  161.  *  PR_CFG_RAS_RETRYATTEMPTS
  162.  *      --  Number of times to attempt dial for connection.
  163.  *          1 <= retry attempts <= 9999
  164.  *
  165.  *  PR_CFG_RAS_RETRYDELAY
  166.  *      --  Delay between retry attempts in seconds.
  167.  *          30 <= retry delay <= 9999
  168.  *
  169.  *  PR_CFG_RAS_CONFIRM
  170.  *      --  A value which determines whether, at connection time, the
  171.  *          user should be prompted to select a Dial-up Network connection.
  172.  *          Possible values as defined below include:
  173.  *          CFG_ALWAYS      --  Always use the default Dial-up Network profile.
  174.  *                              Never prompt the user.
  175.  *          CFG_ASK_FIRST   --  Prompt the user to select a profile on the
  176.  *                              first connection or after any error occurs.
  177.  *          CFG_ASK_EVERY   --  Always prompt the user to select the 
  178.  *                              Dial-up Network profile.
  179.  *
  180.  *  S c h e d u l e d   S e s s i o n   P r o p e r t i e s 
  181.  *
  182.  *  PR_CFG_SCHED_SESS
  183.  *      --  A property that contains information on scheduled sessions.  The
  184.  *          maximum number of entries that may be stored is CFG_SS_MAX.  The
  185.  *          information is stored in the data structure SchedSess.
  186.  *
  187.  *          typedef struct SchedSess {
  188.  *              USHORT          sSessType;
  189.  *              USHORT          sDayMask;
  190.  *              FILETIME        ftTime;
  191.  *              FILETIME        ftStart;
  192.  *              ULONG           ulFlags;
  193.  *              TCHAR           szPhoneEntry[RAS_MaxEntryName+1];
  194.  *          } SCHEDSESS, FAR *LPSCHEDSESS;
  195.  *      
  196.  *          SchedSess.sSessType can be one of CFG_SS_ONCE, CFG_SS_WEEKLY, or  CFG_SS_EVERY.
  197.  *         
  198.  *              CFG_SS_ONCE     is a session that is scheduled to execute only once on a specific
  199.  *                              date and time.
  200.  *
  201.  *              CFG_SS_WEEKLY   is a session that is scheduled to execute at a specific time on any
  202.  *                              of a given specified set of days during the week.
  203.  *      
  204.  *              CFG_SS_EVERY    is a session that is scheduled to execute at regularly scheduled 
  205.  *                              intervals of time.
  206.  *
  207.  *          SchedSess.sDayMask is only used when SchedSess.sSessType is set to CFG_SS_WEEKLY.  
  208.  *          SchedSess.sDayMask can be any combination of CFG_SS_SUN, CFG_SS_MON, CFG_SS_TUE, 
  209.  *          CFG_SS_WED, CFG_SS_THU, CFG_SS_FRI, or CFG_SS_SAT.
  210.  *
  211.  *          SchedSess.ftTime varies depending on the SchedSess.sSessType as follows:
  212.  *          
  213.  *                  SchedSess.sSessType             SchedSess.ftTime
  214.  *          
  215.  *                  CFG_SS_ONCE                     Date/time for the single scheduled session
  216.  *                  CFG_SS_WEEKLY                   Time for any weekly scheduled sessions
  217.  *                  CFG_SS_EVERY                    Duration between re-occuring scheduled sessions
  218.  *
  219.  *          SchedSess.ftStart is only used as the initial start time for sessions of type CFG_SS_EVERY.
  220.  *
  221.  *          SchedSess.ulFlags is currently unused and is reserved for future use.
  222.  *
  223.  *          SchedSess.szPhoneEntry is the name of the Dial-up Networking connection to use
  224.  *          when the session is scheduled to execute.  The Dial-up Network connection contains
  225.  *          the phone number and other relevent information needed to perform the connection.
  226.  *
  227.  *          Note:   All FILETIME structure members should always use local time.  ie. GetLocalTime()
  228.  *                  returns a SYSTEMTIME structure which can then be converted to FILETIME via 
  229.  *                  SystemTimetoFileTime().
  230.  */
  231.  
  232. #include <ras.h>
  233. #include <mapitags.h>
  234.  
  235. /*
  236.  * Connection Properties
  237.  */
  238. #define PR_CFG_SERVER_PATH              PROP_TAG (PT_STRING8,   0x6600)
  239. #define PR_CFG_MAILBOX                  PROP_TAG (PT_STRING8,   0x6601)
  240. // Password must be in the secure property range (See MAPITAGS.H)
  241. #define PR_CFG_PASSWORD                 PROP_TAG (PT_STRING8,   PROP_ID_SECURE_MIN)
  242. #define PR_CFG_CONN_TYPE                PROP_TAG (PT_LONG,      0x6603)
  243. #define     CFG_CONN_LAN            0
  244. #define     CFG_CONN_REMOTE         1
  245. #define     CFG_CONN_OFFLINE        2
  246. #define     CFG_CONN_AUTO           3
  247. #define PR_CFG_SESSION_LOG              PROP_TAG (PT_BOOLEAN,   0x6604)
  248. #define PR_CFG_SESSION_LOG_FILE         PROP_TAG (PT_STRING8,   0x6605)
  249. #define PR_CFG_REMEMBER                 PROP_TAG (PT_BOOLEAN,   0x6606)
  250.  
  251. /*
  252.  * Delivery Properties
  253.  */
  254.  
  255. #define PR_CFG_ENABLE_UPLOAD            PROP_TAG (PT_BOOLEAN,   0x6620)
  256. #define PR_CFG_ENABLE_DOWNLOAD          PROP_TAG (PT_BOOLEAN,   0x6621)
  257. #define PR_CFG_UPLOADTO                 PROP_TAG (PT_LONG,      0x6622)
  258. #define     CFG_UPLOADTO_PCMAIL     0x00000001
  259. #define     CFG_UPLOADTO_PROFS      0x00000002
  260. #define     CFG_UPLOADTO_SNADS      0x00000004
  261. #define     CFG_UPLOADTO_MCI        0x00000008
  262. #define     CFG_UPLOADTO_X400       0x00000010
  263. #define     CFG_UPLOADTO_FAX        0x00000040
  264. #define     CFG_UPLOADTO_MHS        0x00000080
  265. #define     CFG_UPLOADTO_SMTP       0x00000100
  266. #define     CFG_UPLOADTO_OV         0x00000800
  267. #define     CFG_UPLOADTO_MACMAIL    0x00001000
  268. #define     CFG_UPLOADTO_ALL        CFG_UPLOADTO_PCMAIL | CFG_UPLOADTO_PROFS | CFG_UPLOADTO_SNADS | \
  269.                                     CFG_UPLOADTO_MCI | CFG_UPLOADTO_X400 | CFG_UPLOADTO_FAX | \
  270.                                     CFG_UPLOADTO_MHS | CFG_UPLOADTO_SMTP | CFG_UPLOADTO_OV | \
  271.                                     CFG_UPLOADTO_MACMAIL
  272. #define PR_CFG_NETBIOS_NTFY             PROP_TAG (PT_BOOLEAN,   0x6623)
  273. #define PR_CFG_SPOOLER_POLL             PROP_TAG (PT_STRING8,   0x6624)
  274. #define PR_CFG_GAL_ONLY             PROP_TAG (PT_BOOLEAN,       0x6625)
  275.  
  276. /*
  277.  * LAN Properties
  278.  */
  279.  
  280. #define PR_CFG_LAN_HEADERS              PROP_TAG (PT_BOOLEAN,   0x6630)
  281. #define PR_CFG_LAN_LOCAL_AB             PROP_TAG (PT_BOOLEAN,   0x6631)
  282. #define PR_CFG_LAN_EXTERNAL_DELIVERY    PROP_TAG (PT_BOOLEAN,   0x6632)
  283.  
  284. /*
  285.  * Dial-up Network Properties
  286.  */
  287.  
  288. #define PR_CFG_RAS_EXTERNAL_DELIVERY    PROP_TAG (PT_BOOLEAN,   0x6639)
  289. #define PR_CFG_RAS_HEADERS              PROP_TAG (PT_BOOLEAN,   0x6640)
  290. #define PR_CFG_RAS_LOCAL_AB             PROP_TAG (PT_BOOLEAN,   0x6641)
  291. #define PR_CFG_RAS_INIT_ON_START        PROP_TAG (PT_BOOLEAN,   0x6642)
  292. #define PR_CFG_RAS_TERM_ON_HDRS         PROP_TAG (PT_BOOLEAN,   0x6643)
  293. #define PR_CFG_RAS_TERM_ON_XFER         PROP_TAG (PT_BOOLEAN,   0x6644)
  294. #define PR_CFG_RAS_TERM_ON_EXIT         PROP_TAG (PT_BOOLEAN,   0x6645)
  295. #define PR_CFG_RAS_PROFILE              PROP_TAG (PT_STRING8,   0x6646)
  296. #define PR_CFG_RAS_CONFIRM              PROP_TAG (PT_LONG,      0x6647)
  297. #define     CFG_ALWAYS              0
  298. #define     CFG_ASK_FIRST           1
  299. #define     CFG_ASK_EVERY           2
  300. #define PR_CFG_RAS_RETRYATTEMPTS        PROP_TAG (PT_STRING8,   0x6648)
  301. #define PR_CFG_RAS_RETRYDELAY           PROP_TAG (PT_STRING8,   0x6649)
  302.  
  303.  
  304. /*
  305.  * Message Header Property
  306.  */
  307.  
  308. #define PR_CFG_LOCAL_HEADER             PROP_TAG (PT_BOOLEAN,   0x6680)
  309.  
  310. /*
  311.  * Scheduled Session Properties
  312.  */
  313. #define     CFG_SS_MAX          16
  314. #define     CFG_SS_BASE_ID      0x6700
  315. #define     CFG_SS_MAX_ID       CFG_SS_BASE_ID + CFG_SS_MAX - 1
  316. #define SchedPropTag(n)         PROP_TAG (PT_BINARY, CFG_SS_BASE_ID+(n))
  317. #define PR_CFG_SCHED_SESS       SchedPropTag(0)
  318.  
  319. typedef struct SchedSess {
  320.     USHORT          sSessType;
  321.     USHORT          sDayMask;
  322.     FILETIME        ftTime;
  323.     FILETIME        ftStart;
  324.     ULONG           ulFlags;
  325.     TCHAR           szPhoneEntry[RAS_MaxEntryName+1];
  326. } SCHEDSESS, FAR *LPSCHEDSESS;
  327.  
  328. // Day bits
  329. #define     CFG_SS_SUN  0x0001
  330. #define     CFG_SS_MON  0x0002
  331. #define     CFG_SS_TUE  0x0004
  332. #define     CFG_SS_WED  0x0008
  333. #define     CFG_SS_THU  0x0010
  334. #define     CFG_SS_FRI  0x0020
  335. #define     CFG_SS_SAT  0x0040
  336.  
  337. #define IsDayChecked(sDayMask, nDay)  ( (sDayMask) & (1<<(nDay)) )
  338.  
  339. // Session types
  340. #define     CFG_SS_EVERY    0
  341. #define     CFG_SS_WEEKLY   1
  342. #define     CFG_SS_ONCE     2
  343. #define     CFG_SS_NULLTYPE 3
  344.  
  345. // Property range identifiers; useful for asserting
  346. #define PR_CFG_MIN              PROP_TAG (PT_STRING8,   0x6600)
  347. #define PR_CFG_MAX              SchedPropTag(CFG_SS_MAX-1)
  348.  
  349. // Shared Folder Service Provider Properties
  350.  
  351. // PR_ASSIGNED_ACCESS - MAPI Access rights given to users other than the owner of the folder
  352. //                      This property can be retrieved and set. The following MAPI access flags
  353. //                      are valid: 
  354. //                          MAPI_ACCESS_READ
  355. //                          (MAPI_ACCESS_CREATE_HIERARCHY | MAPI_ACCESS_CREATE_CONTENTS)
  356. //                          MAPI_ACCESS_DELETE
  357. //  
  358. #define PR_ASSIGNED_ACCESS  PROP_TAG(PT_LONG, 0x66ff)
  359.  
  360. // PR_OWNER_NAME      - Owner's name of the shared folder.
  361. //                      This property can be retrieved and cannot be set.
  362. //  
  363. #define PR_OWNER_NAME       PROP_TAG(PT_STRING8, 0x66fe)
  364.  
  365. // SFSP_ACCESS_OWNER -  This flag is returned when PR_ASSIGNED_ACCESS is retrieved by the owner
  366. //                      of the folder. It can not be set.
  367. #define SFSP_ACCESS_OWNER   0x8000
  368.  
  369.  
  370. // Unique Provider Identifiers
  371. //
  372. #define MSFS_UID_ABPROVIDER     { 0x00,0x60,0x94,0x64,0x60,0x41,0xb8,0x01, \
  373.                                   0x08,0x00,0x2b,0x2b,0x8a,0x29,0x00,0x00 }
  374.  
  375. #define MSFS_UID_SFPROVIDER     { 0x00,0xff,0xb8,0x64,0x60,0x41,0xb8,0x01, \
  376.                                   0x08,0x00,0x2b,0x2b,0x8a,0x29,0x00,0x00 }
  377.                                                                             
  378.  
  379. #endif // _MSFS_H
  380.