home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / geninc32.pak / LMCONS.H < prev    next >
Text File  |  1997-07-23  |  8KB  |  279 lines

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