home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / LMCONS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  7.1 KB  |  245 lines

  1. /*++ BUILD Version: 0003    // Increment this if a change has global effects
  2.  
  3. Copyright 1990 - 1998 Microsoft Corporation
  4.  
  5.  
  6.     LMCONS.H (was NETCONS.H in LM 2.x)
  7.  
  8. Abstract:
  9.  
  10.     This file contains constants used throughout the LAN Manager
  11.     API header files.  It should be included in any source file
  12.     that is going to include other LAN Manager API header files or
  13.     call a LAN Manager API.
  14.  
  15.     NOTE:  Lengths of strings are given as the maximum lengths of the
  16.     string in characters (not bytes).  This does not include space for the
  17.     terminating 0-characters.  When allocating space for such an item,
  18.     use the form:
  19.  
  20.         TCHAR username[UNLEN+1];
  21.  
  22.     Definitions of the form LN20_* define those values in effect for
  23.     LanMan 2.0.
  24.  
  25.  
  26.  
  27. --*/
  28.  
  29. /*NOINC*/
  30. #ifndef NETCONS_INCLUDED
  31. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  32.  
  33. #define NETCONS_INCLUDED
  34. /*INC*/
  35.  
  36. #ifndef PASCAL
  37. #define PASCAL                          // pascal on OS/2
  38. #endif
  39.  
  40. #ifndef FAR
  41. #define FAR                             // far on OS/2
  42. #endif
  43.  
  44. //
  45. // String Lengths for various LanMan names
  46. //
  47.  
  48. #define CNLEN       15                  // Computer name length
  49. #define LM20_CNLEN  15                  // LM 2.0 Computer name length
  50. #define DNLEN       CNLEN               // Maximum domain name length
  51. #define LM20_DNLEN  LM20_CNLEN          // LM 2.0 Maximum domain name length
  52.  
  53. #if (CNLEN != DNLEN)
  54. #error CNLEN and DNLEN are not equal
  55. #endif
  56.  
  57. #define UNCLEN      (CNLEN+2)           // UNC computer name length
  58. #define LM20_UNCLEN (LM20_CNLEN+2)      // LM 2.0 UNC computer name length
  59.  
  60. #define NNLEN       80                  // Net name length (share name)
  61. #define LM20_NNLEN  12                  // LM 2.0 Net name length
  62.  
  63. #define RMLEN       (UNCLEN+1+NNLEN)    // Max remote name length
  64. #define LM20_RMLEN  (LM20_UNCLEN+1+LM20_NNLEN) // LM 2.0 Max remote name length
  65.  
  66. #define SNLEN       80                  // Service name length
  67. #define LM20_SNLEN  15                  // LM 2.0 Service name length
  68. #define STXTLEN     256                 // Service text length
  69. #define LM20_STXTLEN 63                 // LM 2.0 Service text length
  70.  
  71. #define PATHLEN     256                 // Max. path (not including drive name)
  72. #define LM20_PATHLEN 256                // LM 2.0 Max. path
  73.  
  74. #define DEVLEN      80                  // Device name length
  75. #define LM20_DEVLEN 8                   // LM 2.0 Device name length
  76.  
  77. #define EVLEN       16                  // Event name length
  78.  
  79. //
  80. // User, Group and Password lengths
  81. //
  82.  
  83. #define UNLEN       256                 // Maximum user name length
  84. #define LM20_UNLEN  20                  // LM 2.0 Maximum user name length
  85.  
  86. #define GNLEN       UNLEN               // Group name
  87. #define LM20_GNLEN  LM20_UNLEN          // LM 2.0 Group name
  88.  
  89. #define PWLEN       256                 // Maximum password length
  90. #define LM20_PWLEN  14                  // LM 2.0 Maximum password length
  91.  
  92. #define SHPWLEN     8                   // Share password length (bytes)
  93.  
  94.  
  95. #define CLTYPE_LEN  12                  // Length of client type string
  96.  
  97.  
  98. #define MAXCOMMENTSZ 256                // Multipurpose comment length
  99. #define LM20_MAXCOMMENTSZ 48            // LM 2.0 Multipurpose comment length
  100.  
  101. #define QNLEN       NNLEN               // Queue name maximum length
  102. #define LM20_QNLEN  LM20_NNLEN          // LM 2.0 Queue name maximum length
  103. #if (QNLEN != NNLEN)
  104. # error QNLEN and NNLEN are not equal
  105. #endif
  106.  
  107. //
  108. // The ALERTSZ and MAXDEVENTRIES defines have not yet been NT'ized.
  109. // Whoever ports these components should change these values appropriately.
  110. //
  111.  
  112. #define ALERTSZ     128                 // size of alert string in server
  113. #define MAXDEVENTRIES (sizeof (int)*8)  // Max number of device entries
  114.  
  115.                                         //
  116.                                         // We use int bitmap to represent
  117.                                         //
  118.  
  119. #define NETBIOS_NAME_LEN  16            // NetBIOS net name (bytes)
  120.  
  121. //
  122. // Value to be used with APIs which have a "preferred maximum length"
  123. // parameter.  This value indicates that the API should just allocate
  124. // "as much as it takes."
  125. //
  126.  
  127. #define MAX_PREFERRED_LENGTH    ((DWORD) -1)
  128.  
  129. //
  130. //        Constants used with encryption
  131. //
  132.  
  133. #define CRYPT_KEY_LEN           7
  134. #define CRYPT_TXT_LEN           8
  135. #define ENCRYPTED_PWLEN         16
  136. #define SESSION_PWLEN           24
  137. #define SESSION_CRYPT_KLEN      21
  138.  
  139. //
  140. //  Value to be used with SetInfo calls to allow setting of all
  141. //  settable parameters (parmnum zero option)
  142. //
  143. #ifndef PARMNUM_ALL
  144. #define PARMNUM_ALL             0
  145. #endif
  146.  
  147. #define PARM_ERROR_UNKNOWN      ( (DWORD) (-1) )
  148. #define PARM_ERROR_NONE         0
  149. #define PARMNUM_BASE_INFOLEVEL  1000
  150.  
  151. //
  152. //        Message File Names
  153. //
  154.  
  155. #define MESSAGE_FILENAME        TEXT("NETMSG")
  156. #define OS2MSG_FILENAME         TEXT("BASE")
  157. #define HELP_MSG_FILENAME       TEXT("NETH")
  158.  
  159. /**INTERNAL_ONLY**/
  160.  
  161. // The backup message file named here is a duplicate of net.msg. It
  162. // is not shipped with the product, but is used at buildtime to
  163. // msgbind certain messages to netapi.dll and some of the services.
  164. // This allows for OEMs to modify the message text in net.msg and
  165. // have those changes show up.        Only in case there is an error in
  166. // retrieving the messages from net.msg do we then get the bound
  167. // messages out of bak.msg (really out of the message segment).
  168.  
  169. #define BACKUP_MSG_FILENAME     TEXT("BAK.MSG")
  170.  
  171. /**END_INTERNAL**/
  172.  
  173. #ifndef NULL
  174. #ifdef __cplusplus
  175. #define NULL    0
  176. #else
  177. #define NULL    ((void *)0)
  178. #endif
  179. #endif
  180.  
  181. //
  182. // Keywords used in Function Prototypes
  183. //
  184.  
  185. #define NET_API_STATUS          DWORD
  186. #define API_RET_TYPE            NET_API_STATUS      // Old value: do not use
  187. #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  188. #define NET_API_FUNCTION    __stdcall
  189. #else
  190. #define NET_API_FUNCTION
  191. #endif
  192.  
  193. // Define pseudo-keywords.
  194. #ifndef IN
  195. #define IN
  196. #endif
  197.  
  198. #ifndef OPTIONAL
  199. #define OPTIONAL
  200. #endif
  201.  
  202. #ifndef OUT
  203. #define OUT
  204. #endif
  205. /*INC*/
  206.  
  207.  
  208.  
  209. //
  210. // The platform ID indicates the levels to use for platform-specific
  211. // information.
  212. //
  213.  
  214. #define PLATFORM_ID_DOS 300
  215. #define PLATFORM_ID_OS2 400
  216. #define PLATFORM_ID_NT  500
  217. #define PLATFORM_ID_OSF 600
  218. #define PLATFORM_ID_VMS 700
  219.  
  220. //
  221. //      There message numbers assigned to different LANMAN components
  222. //      are as defined below.
  223. //
  224. //      lmerr.h:        2100 - 2999     NERR_BASE
  225. //      alertmsg.h:     3000 - 3049     ALERT_BASE
  226. //      lmsvc.h:        3050 - 3099     SERVICE_BASE
  227. //      lmerrlog.h:     3100 - 3299     ERRLOG_BASE
  228. //      msgtext.h:      3300 - 3499     MTXT_BASE
  229. //      apperr.h:       3500 - 3999     APPERR_BASE
  230. //      apperrfs.h:     4000 - 4299     APPERRFS_BASE
  231. //      apperr2.h:      4300 - 5299     APPERR2_BASE
  232. //      ncberr.h:       5300 - 5499     NRCERR_BASE
  233. //      alertmsg.h:     5500 - 5599     ALERT2_BASE
  234. //      lmsvc.h:        5600 - 5699     SERVICE2_BASE
  235. //      lmerrlog.h      5700 - 5799     ERRLOG2_BASE
  236. //
  237.  
  238. #define MIN_LANMAN_MESSAGE_ID  NERR_BASE
  239. #define MAX_LANMAN_MESSAGE_ID  5799
  240.  
  241. /*NOINC*/
  242. #pragma option pop /*P_O_Pop*/
  243. #endif // NETCONS_INCLUDED
  244. /*INC*/
  245.