home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / WIN_NT / LMAPI.ZIP / H / LMCONS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-07  |  6.3 KB  |  229 lines

  1. /*
  2.  
  3. Copyright (c) 1990-1993  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     LMCONS.H (was NETCONS.H in LM 2.x)
  8.  
  9. Abstract:
  10.  
  11.     This file contains constants used throughout the LAN Manager
  12.     API header files.  It should be included in any source file
  13.     that is going to include other LAN Manager API header files or
  14.     call a LAN Manager API.
  15.  
  16.     NOTE:  Lengths of strings are given as the maximum lengths of the
  17.     string in characters (not bytes).  This does not include space for the
  18.     terminating 0-characters.  When allocating space for such an item,
  19.     use the form:
  20.  
  21.         TCHAR username[UNLEN+1];
  22.  
  23.     Definitions of the form LN20_* define those values in effect for
  24.     LanMan 2.0.
  25.  
  26.  
  27. --*/
  28.  
  29. /*NOINC*/
  30. #ifndef NETCONS_INCLUDED
  31.  
  32. #define NETCONS_INCLUDED
  33. /*INC*/
  34.  
  35. #ifndef PASCAL
  36. #define PASCAL                      
  37. #endif
  38.  
  39. #ifndef FAR
  40. #define FAR                         
  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. //
  109.  
  110. #define ALERTSZ     128                 // size of alert string in server
  111. #define MAXDEVENTRIES (sizeof (int)*8)  // Max number of device entries
  112.  
  113.                                         //
  114.                                         // We use int bitmap to represent
  115.                                         //
  116.  
  117. #define NETBIOS_NAME_LEN  16            // NetBIOS net name (bytes)
  118.  
  119. //
  120. // Value to be used with APIs which have a "preferred maximum length"
  121. // parameter.  This value indicates that the API should just allocate
  122. // "as much as it takes."
  123. //
  124.  
  125. #define MAX_PREFERRED_LENGTH    ((DWORD) -1)
  126.  
  127. //
  128. //        Constants used with encryption
  129. //
  130.  
  131. #define CRYPT_KEY_LEN           7
  132. #define CRYPT_TXT_LEN           8
  133. #define ENCRYPTED_PWLEN         16
  134. #define SESSION_PWLEN           24
  135. #define SESSION_CRYPT_KLEN      21
  136.  
  137. //
  138. //  Value to be used with SetInfo calls to allow setting of all
  139. //  settable parameters (parmnum zero option)
  140. //
  141. #ifndef PARMNUM_ALL
  142. #define PARMNUM_ALL             0
  143. #endif
  144.  
  145. #define PARM_ERROR_UNKNOWN      ( (DWORD) (-1) )
  146. #define PARM_ERROR_NONE         0
  147. #define PARMNUM_BASE_INFOLEVEL  1000
  148.  
  149. //
  150. //        Message File Names
  151. //
  152.  
  153. #define MESSAGE_FILENAME        TEXT("NETMSG")
  154. #define OS2MSG_FILENAME         TEXT("BASE")
  155. #define HELP_MSG_FILENAME       TEXT("NETH")
  156. #define BACKUP_MSG_FILENAME     TEXT("BAK.MSG")
  157.  
  158.  
  159. #ifndef NULL
  160. #ifdef __cplusplus
  161. #define NULL    0
  162. #else
  163. #define NULL    ((void *)0)
  164. #endif
  165. #endif
  166.  
  167. //
  168. // Keywords used in Function Prototypes
  169. //
  170.  
  171. #define NET_API_STATUS          DWORD
  172. #define API_RET_TYPE            NET_API_STATUS      // Old value: do not use
  173. #if (_MSC_VER >= 800)
  174. #define NET_API_FUNCTION    __stdcall
  175. #else
  176. #define NET_API_FUNCTION
  177. #endif
  178.  
  179. // Define pseudo-keywords.
  180. #ifndef IN
  181. #define IN
  182. #endif
  183.  
  184. #ifndef OPTIONAL
  185. #define OPTIONAL
  186. #endif
  187.  
  188. #ifndef OUT
  189. #define OUT
  190. #endif
  191. /*INC*/
  192.  
  193.  
  194.  
  195. //
  196. // The platform ID indicates the levels to use for platform-specific
  197. // information.
  198. //
  199.  
  200. #define PLATFORM_ID_DOS 300
  201. #define PLATFORM_ID_OS2 400
  202. #define PLATFORM_ID_NT  500
  203.  
  204. //
  205. //      There message numbers assigned to different LANMAN components
  206. //      are as defined below.
  207. //
  208. //      lmerr.h:        2100 - 2999     NERR_BASE
  209. //      alertmsg.h:     3000 - 3049     ALERT_BASE
  210. //      lmsvc.h:        3050 - 3099     SERVICE_BASE
  211. //      lmerrlog.h:     3100 - 3299     ERRLOG_BASE
  212. //      msgtext.h:      3300 - 3499     MTXT_BASE
  213. //      apperr.h:       3500 - 3999     APPERR_BASE
  214. //      apperrfs.h:     4000 - 4299     APPERRFS_BASE
  215. //      apperr2.h:      4300 - 5299     APPERR2_BASE
  216. //      ncberr.h:       5300 - 5499     NRCERR_BASE
  217. //      alertmsg.h:     5500 - 5599     ALERT2_BASE
  218. //      lmsvc.h:        5600 - 5699     SERVICE2_BASE
  219. //      lmerrlog.h      5700 - 5799     ERRLOG2_BASE
  220. //
  221.  
  222. #define MIN_LANMAN_MESSAGE_ID  NERR_BASE
  223. #define MAX_LANMAN_MESSAGE_ID  5799
  224.  
  225. /*NOINC*/
  226. #endif // NETCONS_INCLUDED
  227. /*INC*/
  228. 
  229.