home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / lmcons.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  7.5 KB  |  262 lines

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