home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / SVRAPI.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  47KB  |  1,322 lines

  1. /********************************************************************/
  2. /**                     Microsoft Windows                          **/
  3. /**               Copyright(c) Microsoft Corp., 1995               **/
  4. /********************************************************************/
  5.  
  6. /********************************************************************
  7.  *                                                                  *
  8.  *  About this file ...  SVRAPI.H                                   *
  9.  *                                                                  *
  10.  *  This file contains information about the NetAccess,             *
  11.  *  NetConnection, NetFile, NetServer, NetSession, NetShare and     *
  12.  *  NetSecurity APIs.                                               *
  13.  *  There is a section for each set of APIs.                        *
  14.  *  Each section contains:                                          *
  15.  *                                                                  *
  16.  *      Function prototypes.                                        *
  17.  *                                                                  *
  18.  *      Data structure templates.                                   *
  19.  *                                                                  *
  20.  *      Definition of special values.                               *
  21.  *                                                                  *
  22.  *      Description of level of Win95 peer server support           *
  23.  *
  24.  *  For background information refer to the Lan Manager Programmer's
  25.  *  Reference.
  26.  *
  27.  *  WARNING:
  28.  *      The APIs documented herein are not guaranteed to be supported
  29.  * in future versions of Windows. Their primary purpose is to       *
  30.  * administer Win95 peer servers.                                   *
  31.  *                                                                  *
  32.  ********************************************************************/
  33.  
  34. /*
  35.  *      NOTE:  Lengths of ASCIIZ strings are given as the maximum
  36.  *      strlen() value.  This does not include space for the
  37.  *      terminating 0-byte.  When allocating space for such an item,
  38.  *      use the form:
  39.  *
  40.  *              char username[LM20_UNLEN+1];
  41.  *
  42.  *      An exception to this is the PATHLEN manifest, which does
  43.  *      include space for the terminating 0-byte.
  44.  *
  45.  *      User names, computer names and share names should be
  46.  *      upper-cased by the caller and drawn from the ANSI 
  47.  *      character set.
  48.  * 
  49.  */
  50.  
  51. /*NOINC*/
  52. #ifndef SVRAPI_INCLUDED
  53. #define SVRAPI_INCLUDED
  54. #pragma option -b
  55.  
  56. #pragma option -b.
  57. #include <lmcons.h>
  58. #pragma option -b
  59. #pragma option -b.
  60. #include <lmerr.h>
  61. #pragma option -b
  62.  
  63. #ifndef RC_INVOKED
  64. #pragma pack(1)         /* Assume byte packing throughout */
  65. #endif
  66.  
  67. #ifdef __cplusplus
  68. extern "C" {            /* Assume C declarations for C++ */
  69. #endif    /* __cplusplus */
  70.  
  71. #if !defined(_SVRAPI_)
  72. #define API_FUNCTION DECLSPEC_IMPORT API_RET_TYPE APIENTRY
  73. #else
  74. #define API_FUNCTION API_RET_TYPE APIENTRY
  75. #endif
  76.  
  77. /*INC*/
  78.  
  79.  
  80. /****************************************************************
  81.  *                                                              *
  82.  *                 Access Class                                 *
  83.  *                                                              *
  84.  ****************************************************************/
  85.  
  86.  
  87. /****************************************************************
  88.  *                                                              *
  89.  *                  Function prototypes - ACCESS                *
  90.  *
  91.  *     Requires User level security to be enabled
  92.  *                                                              *
  93.  *    Peer Server Support:
  94.  *      Remote support of these APIs on NWSERVER is limited as
  95.  *      described below:
  96.  *
  97.  *        NetAccessAdd -
  98.  *                local and remote VSERVER - level 2
  99.  *              remote NWSERVER -          level 2
  100.  *        NetAccessCheck - local only
  101.  *      NetAccessDel - 
  102.  *              local, remote NWSERVER and remote VSERVER
  103.  *      NetAccessEnum -
  104.  *              sLevel 0 on remote NWSERVER (fRecursive = 1),
  105.  *              slevel 0, 1, 2 on local and remote VSERVER
  106.  *        NetAccessGetInfo -
  107.  *               all sLevels on local and remote VSERVER,
  108.  *               sLevel 0, 12 on remote NWSERVER
  109.  *      NetAccessSetInfo - 
  110.  *              sLevel 1, 12 on local and remote VSERVER,
  111.  *              sLevel 12 on remote NWSERVER
  112.  *              parmnum = PARMNUM_ALL only
  113.  *      NetAccessGetUserPerms - local and remote VSERVER only
  114.  ****************************************************************/
  115.  
  116. extern API_FUNCTION
  117.   NetAccessAdd ( const char FAR * pszServer,
  118.                  short            sLevel,
  119.                  char FAR *       pbBuffer,
  120.                  unsigned short   cbBuffer );
  121.  
  122. extern API_FUNCTION
  123.   NetAccessCheck ( char FAR *           pszReserved,
  124.                    char FAR *           pszUserName,
  125.                    char FAR *           pszResource,
  126.                    unsigned short       usOperation,
  127.                    unsigned short FAR * pusResult );
  128.  
  129. extern API_FUNCTION
  130.   NetAccessDel ( const char FAR * pszServer,
  131.                  char FAR *       pszResource );
  132.  
  133. extern API_FUNCTION
  134.   NetAccessEnum ( const char FAR *     pszServer,
  135.                   char FAR *           pszBasePath,
  136.                   short                fsRecursive,
  137.                   short                sLevel,
  138.                   char FAR *           pbBuffer,
  139.                   unsigned short       cbBuffer,
  140.                   unsigned short FAR * pcEntriesRead,
  141.                   unsigned short FAR * pcTotalAvail );
  142.  
  143. extern API_FUNCTION
  144.   NetAccessGetInfo ( const char FAR *     pszServer,
  145.                      char FAR *           pszResource,
  146.                      short                sLevel,
  147.                      char FAR *           pbBuffer,
  148.                      unsigned short       cbBuffer,
  149.                      unsigned short FAR * pcbTotalAvail );
  150.  
  151. extern API_FUNCTION
  152.   NetAccessSetInfo ( const char FAR * pszServer,
  153.                      char FAR *       pszResource,
  154.                      short            sLevel,
  155.                      char FAR *       pbBuffer,
  156.                      unsigned short   cbBuffer,
  157.                      short            sParmNum );
  158.  
  159. extern API_FUNCTION
  160.   NetAccessGetUserPerms ( char FAR *           pszServer,
  161.                           char FAR *           pszUgName,
  162.                           char FAR *           pszResource,
  163.                           unsigned short FAR * pusPerms );
  164.  
  165.  
  166. /****************************************************************
  167.  *                                                              *
  168.  *              Data structure templates - ACCESS               *
  169.  *                                                              *
  170.  ****************************************************************/
  171.  
  172. struct access_list {
  173.         char            acl_ugname[LM20_UNLEN+1];
  174.         char            acl_ugname_pad_1;
  175.         short           acl_access;
  176. };      /* access_list */
  177.  
  178. struct access_list_2
  179. {
  180.         char FAR *      acl2_ugname;
  181.         unsigned short  acl2_access;
  182. };      /* access_list_2 */
  183.              
  184. struct access_list_12
  185. {
  186.         char FAR *      acl12_ugname;
  187.         unsigned short  acl12_access;
  188. };      /* access_list_12 */
  189.              
  190. struct access_info_0 {
  191.         char FAR *      acc0_resource_name;
  192. };      /* access_info_0 */
  193.  
  194. struct access_info_1 {
  195.         char  FAR *     acc1_resource_name;
  196.         short           acc1_attr;                      /* See values below */
  197.         short           acc1_count;
  198. };      /* access_info_1 */
  199.  
  200. struct access_info_2 
  201. {
  202.         char  FAR *     acc2_resource_name;
  203.         short           acc2_attr;
  204.         short           acc2_count;
  205. };      /* access_info_2 */
  206.  
  207. struct access_info_10 {
  208.         char FAR *      acc10_resource_name;
  209. };      /* access_info_10 */
  210.  
  211. struct access_info_12 
  212. {
  213.         char  FAR *     acc12_resource_name;
  214.         short           acc12_attr;
  215.         short           acc12_count;
  216. };      /* access_info_12 */
  217.  
  218.  
  219. /****************************************************************
  220.  *                                                              *
  221.  *              Special values and constants - ACCESS           *
  222.  *                                                              *
  223.  ****************************************************************/
  224.  
  225. /*
  226.  *      Maximum number of permission entries for each resource.
  227.  */
  228.  
  229. #define MAXPERMENTRIES  64
  230.  
  231.  
  232. /*
  233.  *      Bit values for the access permissions.  ACCESS_ALL is a handy
  234.  *      way to specify maximum permissions.  These are used in
  235.  *      acl_access field of access_list structures.
  236.  */
  237. /*NOINC*/
  238. #define         ACCESS_NONE     0
  239. #define         ACCESS_ALL     (ACCESS_READ|ACCESS_WRITE|ACCESS_CREATE|ACCESS_EXEC|ACCESS_DELETE|ACCESS_ATRIB|ACCESS_PERM|ACCESS_FINDFIRST)
  240. /*INC*/
  241. #define         ACCESS_READ     0x1
  242. #define         ACCESS_WRITE    0x2
  243. #define         ACCESS_CREATE   0x4
  244. #define         ACCESS_EXEC     0x8
  245. #define         ACCESS_DELETE   0x10
  246. #define         ACCESS_ATRIB    0x20
  247. #define         ACCESS_PERM     0x40
  248. #define         ACCESS_FINDFIRST 0x80
  249.  
  250. #define         ACCESS_GROUP    0x8000
  251.  
  252. /*
  253.  *      Bit values for the acc1_attr field of the access_info_1 structure.
  254.  *      Only one bit is currently defined.
  255.  */
  256.  
  257. #define         ACCESS_AUDIT            0x1
  258.  
  259. /*
  260.  *      Parmnum value for NetAccessSetInfo.
  261.  */
  262.  
  263. #define         ACCESS_ATTR_PARMNUM     2
  264.  
  265.  
  266. /*
  267.  *      ACCESS_LETTERS defines a letter for each bit position in
  268.  *      the acl_access field of struct access_list.  Note that some
  269.  *      bits have a corresponding letter of ' ' (space).
  270.  */
  271.  
  272. #define         ACCESS_LETTERS          "RWCXDAP         "
  273.  
  274.  
  275.  
  276. /****************************************************************
  277.  *                                *
  278.  *          Share Class                            *
  279.  *                                *
  280.  ****************************************************************/
  281.  
  282. /****************************************************************
  283.  *                                                              *
  284.  *              Function prototypes - SHARE                     *
  285.  *                                                              *
  286.  *    Peer Server Support
  287.  *         NetShareAdd() - sLevel 50 on VSERVER and NWSERVER
  288.  *         NetShareDel() - VSERVER and NWSERVER
  289.  *        NetShareEnum() - sLevel 1,50 on VSERVER; 50 on NWSERVER
  290.  *      NetShareGetInfo() - sLevel 50 on VSERVER, NWSERVER
  291.  *         NetShareSetInfo() - sLevel 50, sParmNum PARMNUM_ALL
  292.  *                         on VSERVER, NWSERVER
  293.  ****************************************************************/
  294.  
  295. /***    NetShareAdd - add a new share to the server tables
  296.  *
  297.  *    NetShareAdd( servername, level, buf, buflen )
  298.  *
  299.  *    ENTRY:    servername - asciz string containing name of server
  300.  *                       or NULL if local
  301.  *        level- Must be 50 for Win95 peer servers.
  302.  *        buf - far ptr to struct share_info
  303.  *        buflen - unsigned int length of buffer
  304.  *
  305.  *    EXIT:    0 = success
  306.  *        ERROR_INVALID_LEVEL
  307.  *      ERROR_BAD_NETPATH
  308.  *        ERROR_INVALID_PARAMETER
  309.  *        NERR_UnknownDevDir
  310.  *        NERR_ShareExists
  311.  *        NERR_UnknownServer
  312.  *        NERR_ServerNotStarted
  313.  *        NERR_RedirectedPath
  314.  *        NERR_DuplicateShare
  315.  *        NERR_BufTooSmall
  316.  *        ERROR_NOT_ENOUGH_MEMORY
  317.  *
  318.  */
  319. extern API_FUNCTION
  320.   NetShareAdd ( const char FAR * pszServer,
  321.                 short            sLevel,
  322.                 const char FAR * pbBuffer,
  323.                 unsigned short   cbBuffer );
  324.  
  325. /***    NetShareDel (Admin only)
  326.  *
  327.  *    API_FUNCTION NetShareDel( servername, netname, reserved )
  328.  *
  329.  *    ENTRY
  330.  *
  331.  *    char FAR *  servername;     asciz remote srv name, NULL if local
  332.  *    char FAR *  netname;        asciz network name of share being deleted
  333.  *    unsigned short reserved;    MBZ
  334.  *
  335.  *    EXIT
  336.  *
  337.  *    0 = success
  338.  *    NERR_NetNotStarted
  339.  *  ERROR_BAD_NETPATH
  340.  *    NERR_ServerNotStarted
  341.  *    NERR_NetNameNotFound
  342.  *    ERROR_INVALID_PARAMETER
  343.  *
  344.  *
  345.  *    Note:  Deleting a share will also delete any existing connections
  346.  *        to the shared resource, and close open files within the
  347.  *        connections.
  348.  */
  349. extern API_FUNCTION
  350.   NetShareDel ( const char FAR * pszServer,
  351.                 const char FAR * pszNetName,
  352.                 unsigned short   usReserved );
  353.  
  354. /* 2.1  NetShareEnum
  355.  *
  356.  * API_FUNCTION
  357.  * NetShareEnum( servername, level, buf, buflen, entriesread, totalentries )
  358.  * char FAR *          servername;     asciz remote server name or NULL if local
  359.  * short               sLevel;         level of detail requested; 1 or 50
  360.  * char FAR *          pbBuffer;       buffer to return entries in
  361.  * unsigned short      cbBuffer;       size of buffer on call
  362.  * unsigned short FAR *pcEntriesRead;  # of entries supplied on return
  363.  * unsigned short FAR *pcTotalAvail ;  total # of entries available
  364.  *
  365.  * Supply information about existing shares at specified level.
  366.  *
  367.  * Buffer contents on response (format for a single entry):
  368.  *     Level 1 contains a "struct share_info_1".
  369.  *     Level 50 contains a "struct share_info_50".
  370.  *
  371.  * Returns 0 if successful.  Possible error returns:
  372.  *  ERROR_INVALID_LEVEL
  373.  *  ERROR_BAD_NETPATH
  374.  *  NERR_NetNotStarted
  375.  *  NERR_ServerNotStarted
  376.  *  ERROR_MORE_DATA
  377.  */
  378. extern API_FUNCTION
  379.   NetShareEnum ( const char FAR *     pszServer,
  380.                  short                sLevel,
  381.                  char FAR *           pbBuffer,
  382.                  unsigned short       cbBuffer,
  383.                  unsigned short FAR * pcEntriesRead,
  384.                  unsigned short FAR * pcTotalAvail );
  385.  
  386. /* 2.2  NetShareGetInfo
  387.  *
  388.  * Purpose: Read complete information about a single outstanding share.
  389.  *
  390.  * API_FUNCTION
  391.  * NetShareGetInfo( servername, netname, level, buf, buflen, totalavail )
  392.  * char FAR *          servername;     asciz remote server name or NULL if local
  393.  * char FAR *          netname;        asciz network name of share being queried
  394.  * short               level;          level of info requested (50 for Win95 peer servers)
  395.  * char FAR *          buf;            for returned entry
  396.  * unsigned short      buflen;         size of buffer
  397.  * unsigned short FAR *totalavail;     total size needed for buffer
  398.  *
  399.  * Buffer contents on response:
  400.  *     Level 50 contains a "struct share_info_50".
  401.  *
  402.  * Returns 0 if successful.  Possible error returns:
  403.  *  ERROR_INVALID_LEVEL
  404.  *  ERROR_INVALID_PARAMETER
  405.  *  ERROR_BAD_NETPATH
  406.  *  NERR_NetNotStarted
  407.  *  NERR_ServerNotStarted
  408.  *  NERR_NetNameNotFound
  409.  *  NERR_MoreData
  410.  *  NERR_BufTooSmall
  411.  */
  412. extern API_FUNCTION
  413.   NetShareGetInfo ( const char FAR *     pszServer,
  414.                     const char FAR *     pszNetName,
  415.                     short                sLevel,
  416.                     char FAR *           pbBuffer,
  417.                     unsigned short       cbBuffer,
  418.                     unsigned short FAR * pcbTotalAvail );
  419.  
  420. /***    NetShareSetInfo (Admin only)
  421.  *
  422.  *    API_FUNCTION NetShareSetInfo( servername,
  423.  *                    netname,
  424.  *                    level,
  425.  *                    buf,
  426.  *                    buflen,
  427.  *                    parmnum )
  428.  *                    
  429.  *    ENTRY
  430.  *
  431.  *    servername;     asciz remote srv name, NULL if local
  432.  *    netname;        asciz network name of share being set
  433.  *    level;        level of info provided (50 for Win95 peer servers)
  434.  *    buf;            contents described below
  435.  *    buflen;         size of buffer
  436.  *    parmnum;        must be PARMNUM_ALL for Win95 peer servers
  437.  *
  438.  *    Buffer contents on call if parmnum is zero:
  439.  *           Level 50 contains a "struct share_info_50".
  440.  *
  441.  *    Settable fields are:
  442.  *          shi_remark
  443.  *          shi_passwd
  444.  *
  445.  *    EXIT
  446.  *
  447.  *    0 = success
  448.  *    NERR_NetNotStarted
  449.  *    NERR_ServerNotStarted
  450.  *    NERR_NetNameNotFound
  451.  *    ERROR_INVALID_LEVEL
  452.  *     NERR_BufTooSmall
  453.  *    NERR_RemoteErr
  454.  *    ERROR_MORE_DATA
  455.  *    ERROR_INVALID_PARAMETER
  456.  ***/
  457. extern API_FUNCTION
  458.   NetShareSetInfo ( const char FAR * pszServer,
  459.                     const char FAR * pszNetName,
  460.                     short            sLevel,
  461.                     const char FAR * pbBuffer,
  462.                     unsigned short   cbBuffer,
  463.                     short            sParmNum );
  464.  
  465.  
  466. /****************************************************************
  467.  *                                *
  468.  *          Data structure templates - SHARE        *
  469.  *
  470.  ****************************************************************/
  471.  
  472. struct share_info_0 {
  473.     char        shi0_netname[LM20_NNLEN+1];
  474. };  /* share_info_0 */
  475.  
  476. struct share_info_1 {
  477.     char        shi1_netname[LM20_NNLEN+1];
  478.     char        shi1_pad1;
  479.     unsigned short    shi1_type;
  480.     char FAR *        shi1_remark;
  481. };  /* share_info_1 */
  482.  
  483. struct share_info_2 {
  484.     char        shi2_netname[LM20_NNLEN+1];
  485.     char        shi2_pad1;
  486.     unsigned short    shi2_type;
  487.     char FAR *        shi2_remark;
  488.     unsigned short    shi2_permissions;
  489.     unsigned short    shi2_max_uses;
  490.     unsigned short    shi2_current_uses;
  491.     char FAR *        shi2_path;
  492.     char         shi2_passwd[SHPWLEN+1];
  493.     char        shi2_pad2;
  494. };  /* share_info_2 */
  495.  
  496. struct share_info_50 {
  497.     char        shi50_netname[LM20_NNLEN+1];    /* share name */
  498.     unsigned char     shi50_type;                 /* see below */
  499.     unsigned short    shi50_flags;                /* see below */
  500.     char FAR *    shi50_remark;                   /* ANSI comment string */
  501.     char FAR *    shi50_path;                     /* shared resource */
  502.     char        shi50_rw_password[SHPWLEN+1];   /* read-write password (share-level security) */
  503.     char        shi50_ro_password[SHPWLEN+1];   /* read-only password (share-level security) */
  504. };    /* share_info_50 */
  505.  
  506.  
  507. /****************************************************************
  508.  *                                *
  509.  *          Special values and constants - SHARE        *
  510.  *                                *
  511.  ****************************************************************/
  512.  
  513. /* Field values for shi50_flags; */
  514.  
  515. /* These flags are relevant for share-level security on VSERVER
  516.  * When operating with user-level security, use SHI50F_FULL - the actual
  517.  * access rights are determined by the NetAccess APIs.
  518.  */
  519. #define    SHI50F_RDONLY        0x0001
  520. #define    SHI50F_FULL            0x0002
  521. #define    SHI50F_DEPENDSON    (SHI50F_RDONLY|SHI50F_FULL)
  522. #define    SHI50F_ACCESSMASK    (SHI50F_RDONLY|SHI50F_FULL)
  523.  
  524. /* The share is restored on system startup */
  525. #define    SHI50F_PERSIST        0x0100
  526. /* The share is not normally visible  */
  527. #define SHI50F_SYSTEM        0x0200
  528.  
  529.  
  530. /*
  531.  *    Values for parmnum parameter to NetShareSetInfo.
  532.  */
  533.  
  534. #ifndef PARMNUM_ALL
  535. #define PARMNUM_ALL                0
  536. #endif
  537.  
  538. #define    SHI_REMARK_PARMNUM        4
  539. #define    SHI_PERMISSIONS_PARMNUM        5
  540. #define    SHI_MAX_USES_PARMNUM        6
  541. #define    SHI_PASSWD_PARMNUM        9
  542.  
  543. #define    SHI1_NUM_ELEMENTS        4
  544. #define    SHI2_NUM_ELEMENTS        10
  545.  
  546.  
  547. /*
  548.  *    Share types .
  549.  *  
  550.  *  STYPE_DISKTREE and STYPE_PRINTQ are recognized on peer servers
  551.  */
  552.  
  553. #define STYPE_DISKTREE             0       /* disk share */
  554. #define STYPE_PRINTQ               1       /* printer share */
  555. #define STYPE_DEVICE               2
  556. #define STYPE_IPC                  3
  557.  
  558. #define SHI_USES_UNLIMITED        -1
  559.  
  560.  
  561.  
  562. /****************************************************************
  563.  *                                *
  564.  *          Session Class                            *
  565.  *                                *
  566.  ****************************************************************/
  567.  
  568. /****************************************************************
  569.  *                                                              *
  570.  *              Function prototypes - SESSION                   *
  571.  *
  572.  *    Peer Server Support                                         *
  573.  *      NetSessionDel() - NWSERVER and VSERVER                     *
  574.  *        NetSessionEnum() - sLevel 50 on NWSERVER and VSERVER    *
  575.  *        NetSessionGetInfo() - not supported on peer servers     *
  576.  ****************************************************************/
  577.  
  578. /***    NetSessionDel (Admin only)
  579.  *
  580.  *
  581.  *    API_FUNCTION NetSessionDel( servername, clientname, reserved )
  582.  *
  583.  *    ENTRY
  584.  *
  585.  *     servername;     asciz remote srv name, NULL if local
  586.  *    clientname;     asciz remote computer name (returned by NetSessionEnum)
  587.  *                                   of session being deleted
  588.  *                  In the case of a Win95 NWSERVER, the clientname should be the
  589.  *                  ascii connection number
  590.  *    reserved;       session key returned by NetSessionEnum
  591.  *
  592.  *     EXIT
  593.  *
  594.  *    0 = success
  595.  *    NERR_NetNotStarted
  596.  *  ERROR_BAD_NETPATH
  597.  *    NERR_ServerNotStarted
  598.  *    ERROR_INVALID_LEVEL
  599.  *    NERR_RemoteErr
  600.  *    NERR_RemoteOnly
  601.  *     ERROR_ACCESS_DENIED
  602.  *    NERR_BufTooSmall
  603.  *    NERR_ClientNameNotFound
  604.  *
  605.  ***/
  606. extern API_FUNCTION
  607.   NetSessionDel ( const char FAR * pszServer,
  608.                   const char FAR * pszClientName,
  609.                   short            sReserved );
  610.  
  611. /***    NetSessionEnum
  612.  *
  613.  *    API_FUNCTION NetSessionEnum( servername,
  614.  *                       level,
  615.  *                       buf,
  616.  *                       buflen,
  617.  *                       entriesread,
  618.  *                       totalentries )
  619.  *    ENTRY
  620.  *                
  621.  *    servername;     asciz remote srv name, NULL if local
  622.  *     level;          level of detail requested; (50 for Win95 peer servers)
  623.  *    buf;            for returned entries
  624.  *    buflen;         size of buffer on call;
  625.  *    entriesread;    # of entries supplied on return
  626.  *    totalentries;   total # of entries available
  627.  *
  628.  *     EXIT
  629.  *
  630.  *    0 = success
  631.  *    NERR_NetNotStarted
  632.  *    NERR_ServerNotStarted
  633.  *  ERROR_BAD_NETPATH
  634.  *    ERROR_INVALID_LEVEL
  635.  *    NERR_RemoteErr
  636.  *    ERROR_MORE_DATA
  637.  *     ERROR_ACCESS_DENIED
  638.  *
  639.  *    Buffer contains an array of session_info structures.
  640.  *
  641.  ***/
  642. extern API_FUNCTION
  643.   NetSessionEnum ( const char FAR *     pszServer,
  644.                    short                sLevel,
  645.                    char FAR *           pbBuffer,
  646.                    unsigned short       cbBuffer,
  647.                    unsigned short FAR * pcEntriesRead,
  648.                    unsigned short FAR * pcTotalAvail );
  649.  
  650.  
  651. extern API_FUNCTION
  652.   NetSessionGetInfo ( const char FAR *     pszServer,
  653.                       const char FAR *     pszClientName,
  654.                       short                sLevel,
  655.                       char FAR *           pbBuffer,
  656.                       unsigned short       cbBuffer,
  657.                       unsigned short FAR * pcbTotalAvail );
  658.  
  659.  
  660. /****************************************************************
  661.  *                                *
  662.  *        Data structure templates - SESSION        *
  663.  *                                *
  664.  ****************************************************************/
  665.  
  666.  
  667. struct session_info_0 {
  668.     char FAR *        sesi0_cname;
  669. };  /* session_info_0 */
  670.  
  671. struct session_info_1 {
  672.     char FAR *        sesi1_cname;
  673.     char FAR *        sesi1_username;
  674.     unsigned short    sesi1_num_conns;
  675.     unsigned short    sesi1_num_opens;
  676.     unsigned short    sesi1_num_users;
  677.     unsigned long    sesi1_time;
  678.     unsigned long    sesi1_idle_time;
  679.     unsigned long    sesi1_user_flags;
  680. };  /* session_info_1 */
  681.  
  682. struct session_info_2 {
  683.     char FAR *         sesi2_cname;
  684.     char FAR *         sesi2_username;
  685.     unsigned short     sesi2_num_conns;
  686.     unsigned short     sesi2_num_opens;
  687.     unsigned short     sesi2_num_users;
  688.     unsigned long     sesi2_time;
  689.     unsigned long     sesi2_idle_time;
  690.     unsigned long     sesi2_user_flags;
  691.     char FAR *         sesi2_cltype_name;
  692. };  /* session_info_2 */
  693.  
  694. struct session_info_10 {
  695.         char FAR *     sesi10_cname;
  696.         char FAR *     sesi10_username;
  697.         unsigned long  sesi10_time;
  698.         unsigned long  sesi10_idle_time;
  699. };  /* session_info_10 */
  700.  
  701.  
  702. struct session_info_50 {
  703.     char FAR * sesi50_cname;            //remote computer name (connection id in Netware)
  704.     char FAR * sesi50_username;
  705.     unsigned long sesi50_key;           // used to delete session (not used in Netware)
  706.     unsigned short sesi50_num_conns;
  707.     unsigned short sesi50_num_opens;    //not available in Netware
  708.     unsigned long sesi50_time;
  709.     unsigned long sesi50_idle_time;        //not available in Netware
  710.     unsigned char sesi50_protocol;
  711.     unsigned char pad1;
  712. };    /* session_info_50 */
  713.  
  714.  
  715. /****************************************************************
  716.  *                                *
  717.  *          Special values and constants - SESSION        *
  718.  *                                *
  719.  ****************************************************************/
  720.  
  721. /*
  722.  *    Bits defined in sesi1_user_flags.
  723.  */
  724.  
  725. #define SESS_GUEST        1    /* session is logged on as a guest */
  726. #define SESS_NOENCRYPTION    2    /* session is not using encryption */
  727.  
  728.  
  729. #define SESI1_NUM_ELEMENTS    8
  730. #define SESI2_NUM_ELEMENTS    9
  731.  
  732.  
  733.  
  734. /****************************************************************
  735.  *                                *
  736.  *          Connection Class                    *
  737.  *                                *
  738.  ****************************************************************/
  739.  
  740. /****************************************************************
  741.  *                                                              *
  742.  *              Function prototypes - CONNECTION                *
  743.  *                                                              *
  744.  *  Peer Server Support
  745.  *         NetConnectionEnum -
  746.  *               sLevel 50 on VSERVER and NWSERVER              *
  747.  *               On NWSERVER, this API doesnt provide more      *
  748.  *               information than NetSessionEnum
  749.  ****************************************************************/
  750.  
  751. /***    NetConnectionEnum (Admin only)
  752.  *
  753.  *    API_FUNCTION NetConnectionEnum( servername, 
  754.  *                      qualifier, 
  755.  *                      level, 
  756.  *                      buf, 
  757.  *                      buflen, 
  758.  *                      totalavail )
  759.  *
  760.  *    ENTRY
  761.  *
  762.  *    servername;     asciz remote srv name, NULL if local
  763.  *    qualifier;      netname or client computer name.
  764.  *                  computer name should be prefaced by '\\'.
  765.  *    level;            level of info requested
  766.  *    buf;            for returned entry
  767.  *    buflen;         size of buffer 
  768.  *    totalavail;     total size needed for buffer
  769.  *
  770.  *    EXIT
  771.  *
  772.  *    0 = success
  773.  *    NERR_NetNotStarted
  774.  *    NERR_ServerNotStarted
  775.  *    ERROR_INVALID_LEVEL
  776.  *    NERR_RemoteErr
  777.  *    NERR_RemoteOnly        (DOS)
  778.  *    ERROR_MORE_DATA
  779.  *     ERROR_ACCESS_DENIED
  780.  *    NERR_ClientNameNotFound
  781.  *    NERR_NetNameNotFound
  782.  *
  783.  *    Buffer contents on response (format for a single entry):
  784.  *           Level 50 contains a "struct connection_info_50".
  785.  ***/
  786. extern API_FUNCTION
  787.   NetConnectionEnum ( const char FAR *     pszServer,
  788.                       const char FAR *     pszQualifier,   /* upper case */
  789.                       short                sLevel,
  790.                       char FAR *           pbBuffer,
  791.                       unsigned short       cbBuffer,
  792.                       unsigned short FAR * pcEntriesRead,
  793.                       unsigned short FAR * pcTotalAvail );
  794.  
  795.  
  796. /****************************************************************
  797.  *                                *
  798.  *          Data structure templates - CONNECTION        *
  799.  *                                *
  800.  ****************************************************************/
  801.  
  802. struct connection_info_0 {
  803.     unsigned short    coni0_id;
  804. };  /* connection_info_0 */
  805.  
  806. struct connection_info_1 {
  807.     unsigned short    coni1_id;
  808.     unsigned short    coni1_type;
  809.     unsigned short    coni1_num_opens;
  810.     unsigned short    coni1_num_users;
  811.     unsigned long    coni1_time;
  812.     char FAR *        coni1_username;
  813.     char FAR *        coni1_netname;
  814. };  /* connection_info_1 */
  815.  
  816. struct connection_info_50 {
  817.     unsigned short coni50_type;         // share type
  818.     unsigned short coni50_num_opens;    //not used in Netware
  819.     unsigned long coni50_time;
  820.     char FAR * coni50_netname;          // share name          
  821.     char FAR * coni50_username;         // user connected to share
  822. }; /* connection_info_50 */
  823.  
  824.  
  825. /****************************************************************
  826.  *                                *
  827.  *          File Class                            *
  828.  *                                *
  829.  ****************************************************************/
  830.  
  831.  
  832. /****************************************************************
  833.  *                                                              *
  834.  *              Function prototypes - FILE                      *
  835.  *                                                              *
  836.  *  Peer Server Support
  837.  *         NetFileEnum - sLevel 50 on VSERVER and NWSERVER        *
  838.  *      NetFileClose2 - VSERVER only
  839.  ****************************************************************/
  840.  
  841. /***    NetFileClose2
  842.  *
  843.  *    int FAR PASCAL    NetFileClose2( servername, fileid )
  844.  *
  845.  *    ENTRY
  846.  *
  847.  *    servername;     asciz remote srv name, NULL if local
  848.  *    fileid;         file id supplied by NetFileEnum
  849.  *
  850.  *    EXIT
  851.  *
  852.  *    0 = success
  853.  *    NERR_NetNotStarted
  854.  *    NERR_ServerNotStarted
  855.  *    NERR_RemoteErr
  856.  *     ERROR_ACCESS_DENIED
  857.  *    NERR_FileIdNotFound
  858.  *
  859.  ***/
  860. extern API_FUNCTION
  861.   NetFileClose2 ( const char FAR * pszServer,
  862.                   unsigned long    ulFileId );
  863.  
  864. /***    NetFileEnum (Admin Only)
  865.  *
  866.  *    int FAR PASCAL NetFileEnum( servername,
  867.  *                    level, 
  868.  *                    buf, 
  869.  *                    buflen, 
  870.  *                    entriesread, 
  871.  *                    totalentries )
  872.  *
  873.  *    ENTRY
  874.  *
  875.  *    servername;     asciz remote srv name, NULL if local
  876.  *    basepath;    path qualifier for file matching
  877.  *              (not used for Win95 NWSERVER)
  878.  *    level;          level of detail requested; (50 for Win95 peer servers)
  879.  *    buf;            for returned entries
  880.  *    buflen;         size of buffer on call; 
  881.  *    entriesread;    # of entries supplied on return
  882.  *    totalentries;   total # of entries available
  883.  *
  884.  *     EXIT
  885.  *
  886.  *    0 = success
  887.  *    NERR_RemoteOnly
  888.  *    NERR_NetNotStarted
  889.  *    NERR_ServerNotStarted
  890.  *    ERROR_INVALID_LEVEL
  891.  *    NERR_RemoteErr
  892.  *    ERROR_MORE_DATA
  893.  *     ERROR_ACCESS_DENIED
  894.  *
  895.  *    
  896.  *    Buffer contents on response (format for a single entry):
  897.  *           Level 0 contains a "struct file_info_0".
  898.  *           Level 50 contains a "struct file_info_50".
  899.  *
  900.  ***/
  901.  
  902. extern API_FUNCTION
  903.   NetFileEnum ( const char FAR *     pszServer,
  904.                 const char FAR *     pszBasePath,
  905.                 short                sLevel,
  906.                 char FAR *           pbBuffer,
  907.                 unsigned short       cbBuffer,
  908.                 unsigned short FAR * pcEntriesRead,
  909.                 unsigned short FAR * pcTotalAvail );
  910.  
  911.  
  912. /****************************************************************
  913.  *                                *
  914.  *          Data structure templates - FILE            *
  915.  *                                *
  916.  ****************************************************************/
  917.  
  918. struct file_info_0 {
  919.     unsigned short    fi0_id;
  920. };  /* file_info_0 */
  921.  
  922. struct file_info_1 {
  923.     unsigned short    fi1_id;
  924.     unsigned short    fi1_permissions;
  925.     unsigned short    fi1_num_locks;
  926.     char FAR *        fi1_pathname;
  927.     char FAR *        fi1_username;
  928. };  /* file_info_1 */
  929.  
  930. struct file_info_2 {
  931.     unsigned long    fi2_id;
  932. };  /* file_info_2 */
  933.  
  934. struct file_info_3 {
  935.     unsigned long    fi3_id;
  936.     unsigned short    fi3_permissions;
  937.     unsigned short    fi3_num_locks;
  938.     char FAR *        fi3_pathname;
  939.     char FAR *        fi3_username;
  940. };  /* file_info_3 */
  941.  
  942. struct file_info_50 {
  943.     unsigned long fi50_id;              // not used on NWSERVER
  944.     unsigned short fi50_permissions;    // not available on NWSERVER
  945.     unsigned short fi50_num_locks;      // not available on NWSERVER
  946.     char FAR * fi50_pathname;
  947.     char FAR * fi50_username;
  948.     char FAR * fi50_sharename;
  949. }; /* file_info_50 */
  950.  
  951. struct res_file_enum_2 {
  952.     unsigned short    res_pad;     /* not used now */
  953.     unsigned short      res_fs;          /* server type */
  954.     unsigned long    res_pro;      /* progressive */
  955. };  /* res_file_enum_2 */
  956.  
  957. /****************************************************************
  958.  *                                *
  959.  *        Special values and constants - FILE        *
  960.  *                                *
  961.  ****************************************************************/
  962.  
  963.                     /* bit values for permissions */
  964. #define    PERM_FILE_READ        0x1    /* user has read access */
  965. #define    PERM_FILE_WRITE        0x2    /* user has write access */
  966. #define    PERM_FILE_CREATE    0x4    /* user has create access */
  967.  
  968.  
  969. typedef struct res_file_enum_2 FRK;
  970.  
  971. /*NOINC*/
  972. #define FRK_INIT( f )    \
  973.     {        \
  974.         (f).res_pad = 0L;    \
  975.         (f).res_fs = 0;    \
  976.         (f).res_pro = 0;    \
  977.     }
  978.  
  979. /*INC*/
  980.  
  981.  
  982. /****************************************************************
  983.  *                                *
  984.  *          Server Class                            *
  985.  *                                *
  986.  ****************************************************************/
  987.  
  988.  
  989. /****************************************************************
  990.  *                                                              *
  991.  *              Function prototypes - SERVER                    *
  992.  *                                                              *
  993.  * Peer Server Support
  994.  *     NetServerGetInfo - sLevel 1,50 on NWSERVER, VSERVER
  995.  ****************************************************************/
  996.  
  997. /* 6.2  NetServerGetInfo 
  998.  *
  999.  * Purpose: Read the current configuration parameters of the server.
  1000.  *
  1001.  * int FAR PASCAL
  1002.  * NetServerGetInfo( servername, level, buf, buflen, totalavail )
  1003.  * char FAR *          servername;   asciz remote server name or NULL if local
  1004.  * short               level;          level of information to be returned
  1005.  * char FAR *          buf;            for returned data
  1006.  * unsigned short      buflen;         size of buffer
  1007.  * unsigned short FAR *totalavail;     total size needed for buffer
  1008.  *
  1009.  * Buffer contents on response (format for a single entry):
  1010.  *     Level 1 contains a "struct server_info_1".
  1011.  *     Level 50 contains a "struct server_info_50".
  1012.  *
  1013.  * If the buflen is not large enough for all of the information, the call
  1014.  * will return as much as will fit in the buffer.
  1015.  *
  1016.  * Returns 0 if successful. Error return information:
  1017.  *
  1018.  *     - ERROR_INVALID_LEVEL       - Level parameter specified is invalid
  1019.  *     - ERROR_INVALID_PARAMETER   - An invalid input parameter was detected.
  1020.  *     - NERR_NetNotStarted        - Network not installed on local machine
  1021.  *     - NERR_ServerNotStarted     - Server is not started
  1022.  *     - NERR_BufTooSmall          - The buffer supplied was to small to
  1023.  *                                   return the fixed length structure
  1024.  *                     requested.
  1025.  *     - NERR_MoreData             - The buffer supplied was too small to
  1026.  *                     return all the information available
  1027.  *                     for this server.
  1028.  *
  1029.  */
  1030.  
  1031.  
  1032. extern API_FUNCTION
  1033.   NetServerGetInfo ( const char FAR *     pszServer,
  1034.                      short                sLevel,
  1035.                      char FAR *           pbBuffer,
  1036.                      unsigned short       cbBuffer,
  1037.                      unsigned short FAR * pcbTotalAvail );
  1038.  
  1039.  
  1040. /****************************************************************
  1041.  *                                *
  1042.  *          Data structure templates - SERVER        *
  1043.  *                                *
  1044.  ****************************************************************/
  1045.  
  1046. struct server_info_0 {
  1047.     char        sv0_name[CNLEN + 1];     /* Server name            */
  1048. };     /* server_info_0 */
  1049.  
  1050.  
  1051. struct server_info_1 {
  1052.     char        sv1_name[CNLEN + 1];
  1053.     unsigned char   sv1_version_major;        /* Major version # of net   */
  1054.     unsigned char   sv1_version_minor;        /* Minor version # of net   */
  1055.     unsigned long   sv1_type;                 /* Server type             */
  1056.     char FAR *        sv1_comment;         /* Exported server comment  */
  1057. };     /* server_info_1 */
  1058.  
  1059.  
  1060. /* NOTE struct prefix must equal server_info_1 like below! */
  1061.  
  1062. struct server_info_50 {
  1063.     char        sv50_name[CNLEN + 1];
  1064.     unsigned char   sv50_version_major;        /* Major version # of net   */
  1065.     unsigned char   sv50_version_minor;        /* Minor version # of net   */
  1066.     unsigned long   sv50_type;                 /* Server type             */
  1067.     char FAR *        sv50_comment;         /* Exported server comment  */
  1068.     unsigned short  sv50_security;            /* SV_SECURITY_* (see below) */
  1069.     unsigned short  sv50_auditing;    /* 0 = no auditing; nonzero = auditing */
  1070.     char FAR *      sv50_container;        /* Security server/domain    */
  1071.     char FAR *        sv50_ab_server;        /* Address book server       */
  1072.     char FAR *        sv50_ab_dll;        /* Address book provider DLL */
  1073. };    /* server_info_50 */
  1074.  
  1075.  
  1076. struct server_info_2 {
  1077.     char            sv2_name[CNLEN + 1];
  1078.     unsigned char   sv2_version_major;
  1079.     unsigned char   sv2_version_minor;
  1080.     unsigned long   sv2_type;    
  1081.     char FAR *        sv2_comment;        
  1082.     unsigned long   sv2_ulist_mtime; /* User list, last modification time    */
  1083.     unsigned long   sv2_glist_mtime; /* Group list, last modification time   */
  1084.     unsigned long   sv2_alist_mtime; /* Access list, last modification time  */
  1085.     unsigned short  sv2_users;       /* max number of users allowed          */
  1086.     unsigned short  sv2_disc;        /* auto-disconnect timeout(in minutes)  */
  1087.     char FAR *        sv2_alerts;        /* alert names (semicolon separated)    */
  1088.     unsigned short  sv2_security;    /* SV_USERSECURITY or SV_SHARESECURITY  */
  1089.     unsigned short  sv2_auditing;    /* 0 = no auditing; nonzero = auditing  */
  1090.  
  1091.     unsigned short  sv2_numadmin;    /* max number of administrators allowed */
  1092.     unsigned short  sv2_lanmask;     /* bit mask representing the srv'd nets */
  1093.     unsigned short  sv2_hidden;      /* 0 = visible; nonzero = hidden        */
  1094.     unsigned short  sv2_announce;    /* visible server announce rate (sec)   */
  1095.     unsigned short  sv2_anndelta;    /* announce randomize interval (sec)    */
  1096.                                     /* name of guest account                */
  1097.     char            sv2_guestacct[LM20_UNLEN + 1];
  1098.     unsigned char   sv2_pad1;        /* Word alignment pad byte            */
  1099.     char FAR *      sv2_userpath;    /* ASCIIZ path to user directories      */
  1100.     unsigned short  sv2_chdevs;      /* max # shared character devices       */
  1101.     unsigned short  sv2_chdevq;      /* max # character device queues        */
  1102.     unsigned short  sv2_chdevjobs;   /* max # character device jobs          */
  1103.     unsigned short  sv2_connections; /* max # of connections            */
  1104.     unsigned short  sv2_shares;        /* max # of shares                */
  1105.     unsigned short  sv2_openfiles;   /* max # of open files            */
  1106.     unsigned short  sv2_sessopens;   /* max # of open files per session        */
  1107.     unsigned short  sv2_sessvcs;     /* max # of virtual circuits per client */
  1108.     unsigned short  sv2_sessreqs;    /* max # of simul. reqs. from a client  */
  1109.     unsigned short  sv2_opensearch;  /* max # of open searches            */
  1110.     unsigned short  sv2_activelocks; /* max # of active file locks           */
  1111.     unsigned short  sv2_numreqbuf;   /* number of server (standard) buffers  */
  1112.     unsigned short  sv2_sizreqbuf;   /* size of svr (standard) bufs (bytes)  */
  1113.     unsigned short  sv2_numbigbuf;   /* number of big (64K) buffers          */
  1114.     unsigned short  sv2_numfiletasks;/* number of file worker processes      */
  1115.     unsigned short  sv2_alertsched;  /* alert counting interval (minutes)    */
  1116.     unsigned short  sv2_erroralert;  /* error log alerting threshold         */
  1117.     unsigned short  sv2_logonalert;  /* logon violation alerting threshold   */
  1118.     unsigned short  sv2_accessalert; /* access violation alerting threshold  */
  1119.     unsigned short  sv2_diskalert;   /* low disk space alert threshold (KB)  */
  1120.     unsigned short  sv2_netioalert;  /* net I/O error ratio alert threshold  */
  1121.                                     /*  (tenths of a percent)               */
  1122.     unsigned short  sv2_maxauditsz;  /* Maximum audit file size (KB)        */
  1123.     char FAR *        sv2_srvheuristics; /* performance related server switches*/
  1124. };    /* server_info_2 */
  1125.  
  1126.  
  1127. struct server_info_3 {
  1128.     char        sv3_name[CNLEN + 1];
  1129.     unsigned char   sv3_version_major;
  1130.     unsigned char   sv3_version_minor;
  1131.     unsigned long   sv3_type;
  1132.     char FAR *        sv3_comment;
  1133.     unsigned long   sv3_ulist_mtime; /* User list, last modification time    */
  1134.     unsigned long   sv3_glist_mtime; /* Group list, last modification time   */
  1135.     unsigned long   sv3_alist_mtime; /* Access list, last modification time  */
  1136.     unsigned short  sv3_users;         /* max number of users allowed         */
  1137.     unsigned short  sv3_disc;        /* auto-disconnect timeout(in minutes)  */
  1138.     char FAR *        sv3_alerts;     /* alert names (semicolon separated)    */
  1139.     unsigned short  sv3_security;    /* SV_USERSECURITY or SV_SHARESECURITY  */
  1140.     unsigned short  sv3_auditing;    /* 0 = no auditing; nonzero = auditing  */
  1141.  
  1142.     unsigned short  sv3_numadmin;    /* max number of administrators allowed */
  1143.     unsigned short  sv3_lanmask;     /* bit mask representing the srv'd nets */
  1144.     unsigned short  sv3_hidden;      /* 0 = visible; nonzero = hidden         */
  1145.     unsigned short  sv3_announce;    /* visible server announce rate (sec)   */
  1146.     unsigned short  sv3_anndelta;    /* announce randomize interval (sec)    */
  1147.                     /* name of guest account            */
  1148.     char        sv3_guestacct[LM20_UNLEN + 1];
  1149.     unsigned char   sv3_pad1;        /* Word alignment pad byte            */
  1150.     char FAR *        sv3_userpath;    /* ASCIIZ path to user directories         */
  1151.     unsigned short  sv3_chdevs;      /* max # shared character devices         */
  1152.     unsigned short  sv3_chdevq;      /* max # character device queues         */
  1153.     unsigned short  sv3_chdevjobs;   /* max # character device jobs         */
  1154.     unsigned short  sv3_connections; /* max # of connections            */
  1155.     unsigned short  sv3_shares;     /* max # of shares                */
  1156.     unsigned short  sv3_openfiles;   /* max # of open files            */
  1157.     unsigned short  sv3_sessopens;   /* max # of open files per session     */
  1158.     unsigned short  sv3_sessvcs;     /* max # of virtual circuits per client */
  1159.     unsigned short  sv3_sessreqs;    /* max # of simul. reqs. from a client  */
  1160.     unsigned short  sv3_opensearch;  /* max # of open searches            */
  1161.     unsigned short  sv3_activelocks; /* max # of active file locks         */
  1162.     unsigned short  sv3_numreqbuf;   /* number of server (standard) buffers  */
  1163.     unsigned short  sv3_sizreqbuf;   /* size of svr (standard) bufs (bytes)  */
  1164.     unsigned short  sv3_numbigbuf;   /* number of big (64K) buffers         */
  1165.     unsigned short  sv3_numfiletasks;/* number of file worker processes      */
  1166.     unsigned short  sv3_alertsched;  /* alert counting interval (minutes)    */
  1167.     unsigned short  sv3_erroralert;  /* error log alerting threshold         */
  1168.     unsigned short  sv3_logonalert;  /* logon violation alerting threshold   */
  1169.     unsigned short  sv3_accessalert; /* access violation alerting threshold  */
  1170.     unsigned short  sv3_diskalert;   /* low disk space alert threshold (KB)  */
  1171.     unsigned short  sv3_netioalert;  /* net I/O error ratio alert threshold  */
  1172.                                     /*  (tenths of a percent)               */
  1173.     unsigned short  sv3_maxauditsz;  /* Maximum audit file size (KB)         */
  1174.     char FAR *        sv3_srvheuristics; /* performance related server switches*/
  1175.     unsigned long   sv3_auditedevents; /* Audit event control mask         */
  1176.     unsigned short  sv3_autoprofile; /* (0,1,2,3) = (NONE,LOAD,SAVE,or BOTH) */
  1177.     char FAR *        sv3_autopath;    /* file pathname (where to load & save) */
  1178. };    /* server_info_3 */
  1179.  
  1180.  
  1181.  
  1182. /****************************************************************
  1183.  *                                *
  1184.  *          Special values and constants - SERVER        *
  1185.  *                                *
  1186.  ****************************************************************/
  1187.  
  1188. /*
  1189.  *    Mask to be applied to svX_version_major in order to obtain
  1190.  *    the major version number.
  1191.  */
  1192.  
  1193. #define MAJOR_VERSION_MASK    0x0F
  1194.  
  1195. /*
  1196.  *    Bit-mapped values for svX_type fields. X = 1, 2 or 3.
  1197.  */
  1198.  
  1199. #define SV_TYPE_WORKSTATION    0x00000001
  1200. #define SV_TYPE_SERVER        0x00000002
  1201. #define SV_TYPE_SQLSERVER    0x00000004
  1202. #define SV_TYPE_DOMAIN_CTRL    0x00000008
  1203. #define SV_TYPE_DOMAIN_BAKCTRL    0x00000010
  1204. #define SV_TYPE_TIME_SOURCE    0x00000020
  1205. #define SV_TYPE_AFP        0x00000040
  1206. #define SV_TYPE_NOVELL        0x00000080      /* This flag is also set by Win95 NWSERVER */
  1207. #define SV_TYPE_DOMAIN_MEMBER    0x00000100
  1208. #define SV_TYPE_PRINTQ_SERVER    0x00000200
  1209. #define SV_TYPE_DIALIN_SERVER    0x00000400
  1210. #define SV_TYPE_ALL        0xFFFFFFFF   /* handy for NetServerEnum2 */
  1211.  
  1212. /*
  1213.  *    Special value for svX_disc that specifies infinite disconnect
  1214.  *    time. X = 2 or 3.
  1215.  */
  1216.  
  1217. #define SV_NODISC        0xFFFF    /* No autodisconnect timeout enforced */
  1218.  
  1219. /*
  1220.  *    Values of svX_security field. X = 2 or 3.
  1221.  */
  1222.  
  1223. #define SV_USERSECURITY        1
  1224. #define SV_SHARESECURITY    0
  1225.  
  1226. /*
  1227.  *    Values of svX_security field. X = 50.
  1228.  *  For Win95 NWSERVER, the only possible returned value is SV_SECURITY_NETWARE.
  1229.  */
  1230.  
  1231. #define SV_SECURITY_SHARE    0    /* Share-level */
  1232. #define SV_SECURITY_WINNT    1    /* User-level - Windows NT workst'n */
  1233. #define SV_SECURITY_WINNTAS    2    /* User-level - Windows NT domain */
  1234. #define SV_SECURITY_NETWARE    3    /* User-level - NetWare 3.x bindery */
  1235.  
  1236. /*
  1237.  *    Values of svX_hidden field. X = 2 or 3.
  1238.  */
  1239.  
  1240. #define SV_HIDDEN        1
  1241. #define SV_VISIBLE        0
  1242.  
  1243. #define SVI1_NUM_ELEMENTS    5
  1244. #define SVI2_NUM_ELEMENTS    44
  1245. #define SVI3_NUM_ELEMENTS    45
  1246.  
  1247.  
  1248. /*
  1249.  *      Masks describing AUTOPROFILE parameters
  1250.  */
  1251.  
  1252. #define SW_AUTOPROF_LOAD_MASK    0x1
  1253. #define SW_AUTOPROF_SAVE_MASK    0x2
  1254.  
  1255.  
  1256.  
  1257. /****************************************************************
  1258.  *                                                              *
  1259.  *                 Security Class                               *
  1260.  *                                                              *
  1261.  ****************************************************************/
  1262.  
  1263.  
  1264. /****************************************************************
  1265.  *                                                              *
  1266.  *                  Function prototypes - SECURITY              *
  1267.  *                                                              *
  1268.  ****************************************************************/
  1269.  
  1270. extern API_FUNCTION
  1271.   NetSecurityGetInfo ( const char FAR *     pszServer,
  1272.                        short                sLevel,
  1273.                        char FAR *           pbBuffer,
  1274.                        unsigned short       cbBuffer,
  1275.                        unsigned short FAR * pcbTotalAvail );
  1276.  
  1277.  
  1278. /****************************************************************
  1279.  *                                *
  1280.  *          Data structure templates - SECURITY        *
  1281.  *                                *
  1282.  ****************************************************************/
  1283.  
  1284. struct security_info_1 {
  1285.     unsigned long   sec1_security;        /* SEC_SECURITY_* (see below) */
  1286.     char FAR *      sec1_container;    /* Security server/domain     */
  1287.     char FAR *        sec1_ab_server;    /* Address book server        */
  1288.     char FAR *        sec1_ab_dll;    /* Address book provider DLL  */
  1289. };    /* security_info_1 */
  1290.  
  1291.  
  1292. /****************************************************************
  1293.  *                                *
  1294.  *          Special values and constants - SECURITY        *
  1295.  *                                *
  1296.  ****************************************************************/
  1297.  
  1298. /*
  1299. /*
  1300.  *    Values of secX_security field. X = 1.
  1301.  */
  1302.  
  1303. #define SEC_SECURITY_SHARE    SV_SECURITY_SHARE
  1304. #define SEC_SECURITY_WINNT    SV_SECURITY_WINNT
  1305. #define SEC_SECURITY_WINNTAS    SV_SECURITY_WINNTAS
  1306. #define SEC_SECURITY_NETWARE    SV_SECURITY_NETWARE
  1307.  
  1308.  
  1309.  
  1310. /*NOINC*/
  1311. #ifdef __cplusplus
  1312. }
  1313. #endif    /* __cplusplus */
  1314.  
  1315. #ifndef RC_INVOKED
  1316. #pragma pack()          /* Revert to default packing */
  1317. #endif
  1318.  
  1319. #pragma option -b.
  1320. #endif /* SVRAPI_INCLUDED */
  1321. /*INC*/
  1322.