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