Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

259 lines
7.2 KiB

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