jwalmcons.pas 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. {******************************************************************************}
  2. { }
  3. { Lan Manager Constants API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: lmcons.h, released November 2001. The original Pascal }
  9. { code is: LmCons.pas, released Februari 2002. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaLmCons.pas,v 1.10 2005/09/07 09:54:54 marquardt Exp $
  43. {$IFNDEF JWA_INCLUDEMODE}
  44. unit JwaLmCons;
  45. {$WEAKPACKAGEUNIT}
  46. {$I jediapilib.inc}
  47. interface
  48. uses
  49. JwaWindows, JwaLmErr;
  50. {$ENDIF !JWA_INCLUDEMODE}
  51. {$IFDEF JWA_INTERFACESECTION}
  52. {$HPPEMIT ''}
  53. {$HPPEMIT '#include "lm.h"'}
  54. {$HPPEMIT ''}
  55. //
  56. // NOTE: Lengths of strings are given as the maximum lengths of the
  57. // string in characters (not bytes). This does not include space for the
  58. // terminating 0-characters. When allocating space for such an item,
  59. // use the form:
  60. //
  61. // TCHAR username[UNLEN+1];
  62. //
  63. // Definitions of the form LN20_* define those values in effect for
  64. // LanMan 2.0.
  65. //
  66. //
  67. // String Lengths for various LanMan names
  68. //
  69. const
  70. CNLEN = 15; // Computer name length
  71. {$EXTERNALSYM CNLEN}
  72. LM20_CNLEN = 15; // LM 2.0 Computer name length
  73. {$EXTERNALSYM LM20_CNLEN}
  74. DNLEN = CNLEN; // Maximum domain name length
  75. {$EXTERNALSYM DNLEN}
  76. LM20_DNLEN = LM20_CNLEN; // LM 2.0 Maximum domain name length
  77. {$EXTERNALSYM LM20_DNLEN}
  78. //#if (CNLEN != DNLEN)
  79. //#error CNLEN and DNLEN are not equal
  80. //#endif
  81. UNCLEN = CNLEN + 2; // UNC computer name length
  82. {$EXTERNALSYM UNCLEN}
  83. LM20_UNCLEN = LM20_CNLEN + 2; // LM 2.0 UNC computer name length
  84. {$EXTERNALSYM LM20_UNCLEN}
  85. NNLEN = 80; // Net name length (share name)
  86. {$EXTERNALSYM NNLEN}
  87. LM20_NNLEN = 12; // LM 2.0 Net name length
  88. {$EXTERNALSYM LM20_NNLEN}
  89. RMLEN = UNCLEN + 1 + NNLEN; // Max remote name length
  90. {$EXTERNALSYM RMLEN}
  91. LM20_RMLEN = LM20_UNCLEN + 1 + LM20_NNLEN; // LM 2.0 Max remote name length
  92. {$EXTERNALSYM LM20_RMLEN}
  93. SNLEN = 80; // Service name length
  94. {$EXTERNALSYM SNLEN}
  95. LM20_SNLEN = 15; // LM 2.0 Service name length
  96. {$EXTERNALSYM LM20_SNLEN}
  97. STXTLEN = 256; // Service text length
  98. {$EXTERNALSYM STXTLEN}
  99. LM20_STXTLEN = 63; // LM 2.0 Service text length
  100. {$EXTERNALSYM LM20_STXTLEN}
  101. PATHLEN = 256; // Max. path (not including drive name)
  102. {$EXTERNALSYM PATHLEN}
  103. LM20_PATHLEN = 256; // LM 2.0 Max. path
  104. {$EXTERNALSYM LM20_PATHLEN}
  105. DEVLEN = 80; // Device name length
  106. {$EXTERNALSYM DEVLEN}
  107. LM20_DEVLEN = 8; // LM 2.0 Device name length
  108. {$EXTERNALSYM LM20_DEVLEN}
  109. EVLEN = 16; // Event name length
  110. {$EXTERNALSYM EVLEN}
  111. //
  112. // User, Group and Password lengths
  113. //
  114. UNLEN = 256; // Maximum user name length
  115. {$EXTERNALSYM UNLEN}
  116. LM20_UNLEN = 20; // LM 2.0 Maximum user name length
  117. {$EXTERNALSYM LM20_UNLEN}
  118. GNLEN = UNLEN; // Group name
  119. {$EXTERNALSYM GNLEN}
  120. LM20_GNLEN = LM20_UNLEN; // LM 2.0 Group name
  121. {$EXTERNALSYM LM20_GNLEN}
  122. PWLEN = 256; // Maximum password length
  123. {$EXTERNALSYM PWLEN}
  124. LM20_PWLEN = 14; // LM 2.0 Maximum password length
  125. {$EXTERNALSYM LM20_PWLEN}
  126. SHPWLEN = 8; // Share password length (bytes)
  127. {$EXTERNALSYM SHPWLEN}
  128. CLTYPE_LEN = 12; // Length of client type string
  129. {$EXTERNALSYM CLTYPE_LEN}
  130. MAXCOMMENTSZ = 256; // Multipurpose comment length
  131. {$EXTERNALSYM MAXCOMMENTSZ}
  132. LM20_MAXCOMMENTSZ = 48; // LM 2.0 Multipurpose comment length
  133. {$EXTERNALSYM LM20_MAXCOMMENTSZ}
  134. QNLEN = NNLEN; // Queue name maximum length
  135. {$EXTERNALSYM QNLEN}
  136. LM20_QNLEN = LM20_NNLEN; // LM 2.0 Queue name maximum length
  137. {$EXTERNALSYM LM20_QNLEN}
  138. //#if (QNLEN != NNLEN)
  139. //# error QNLEN and NNLEN are not equal
  140. //#endif
  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. ALERTSZ = 128; // size of alert string in server
  146. {$EXTERNALSYM ALERTSZ}
  147. MAXDEVENTRIES = SizeOf(Integer)*8; // Max number of device entries
  148. {$EXTERNALSYM MAXDEVENTRIES}
  149. //
  150. // We use int bitmap to represent
  151. //
  152. NETBIOS_NAME_LEN = 16; // NetBIOS net name (bytes)
  153. {$EXTERNALSYM NETBIOS_NAME_LEN}
  154. //
  155. // Value to be used with APIs which have a "preferred maximum length"
  156. // parameter. This value indicates that the API should just allocate
  157. // "as much as it takes."
  158. //
  159. MAX_PREFERRED_LENGTH = DWORD(-1);
  160. {$EXTERNALSYM MAX_PREFERRED_LENGTH}
  161. //
  162. // Constants used with encryption
  163. //
  164. CRYPT_KEY_LEN = 7;
  165. {$EXTERNALSYM CRYPT_KEY_LEN}
  166. CRYPT_TXT_LEN = 8;
  167. {$EXTERNALSYM CRYPT_TXT_LEN}
  168. ENCRYPTED_PWLEN = 16;
  169. {$EXTERNALSYM ENCRYPTED_PWLEN}
  170. SESSION_PWLEN = 24;
  171. {$EXTERNALSYM SESSION_PWLEN}
  172. SESSION_CRYPT_KLEN = 21;
  173. {$EXTERNALSYM SESSION_CRYPT_KLEN}
  174. //
  175. // Value to be used with SetInfo calls to allow setting of all
  176. // settable parameters (parmnum zero option)
  177. //
  178. PARMNUM_ALL = 0;
  179. {$EXTERNALSYM PARMNUM_ALL}
  180. PARM_ERROR_UNKNOWN = DWORD(-1);
  181. {$EXTERNALSYM PARM_ERROR_UNKNOWN}
  182. PARM_ERROR_NONE = 0;
  183. {$EXTERNALSYM PARM_ERROR_NONE}
  184. PARMNUM_BASE_INFOLEVEL = 1000;
  185. {$EXTERNALSYM PARMNUM_BASE_INFOLEVEL}
  186. //
  187. // Only the UNICODE version of the LM APIs are available on NT.
  188. // Non-UNICODE version on other platforms
  189. //
  190. //#if defined( _WIN32_WINNT ) || defined( WINNT ) || defined( FORCE_UNICODE )
  191. {$IFDEF WINNT4_UP}
  192. {$DEFINE LM_USE_UNICODE}
  193. {$ENDIF WINNT4_UP}
  194. {$IFDEF LM_FORCE_UNICODE}
  195. {$DEFINE LM_USE_UNICODE}
  196. {$ENDIF LM_FORCE_UNICODE}
  197. {$IFDEF LM_USE_UNICODE}
  198. type
  199. LMSTR = LPWSTR;
  200. {$EXTERNALSYM LMSTR}
  201. LMCSTR = LPCWSTR;
  202. {$EXTERNALSYM LMCSTR}
  203. PLMSTR = ^LMSTR;
  204. {$NODEFINE PLMSTR}
  205. const
  206. MESSAGE_FILENAME = WideString('NETMSG');
  207. {$EXTERNALSYM MESSAGE_FILENAME}
  208. OS2MSG_FILENAME = WideString('BASE');
  209. {$EXTERNALSYM OS2MSG_FILENAME}
  210. HELP_MSG_FILENAME = WideString('NETH');
  211. {$EXTERNALSYM HELP_MSG_FILENAME}
  212. // ** INTERNAL_ONLY **
  213. // The backup message file named here is a duplicate of net.msg. It
  214. // is not shipped with the product, but is used at buildtime to
  215. // msgbind certain messages to netapi.dll and some of the services.
  216. // This allows for OEMs to modify the message text in net.msg and
  217. // have those changes show up. Only in case there is an error in
  218. // retrieving the messages from net.msg do we then get the bound
  219. // messages out of bak.msg (really out of the message segment).
  220. BACKUP_MSG_FILENAME = WideString('BAK.MSG');
  221. {$EXTERNALSYM BACKUP_MSG_FILENAME}
  222. // ** END_INTERNAL **
  223. {$ELSE}
  224. type
  225. LMSTR = LPSTR;
  226. {$EXTERNALSYM LMSTR}
  227. LMCSTR = LPCSTR;
  228. {$EXTERNALSYM LMCSTR}
  229. const
  230. MESSAGE_FILENAME = AnsiString('NETMSG');
  231. {$EXTERNALSYM MESSAGE_FILENAME}
  232. OS2MSG_FILENAME = AnsiString('BASE');
  233. {$EXTERNALSYM OS2MSG_FILENAME}
  234. HELP_MSG_FILENAME = AnsiString('NETH');
  235. {$EXTERNALSYM HELP_MSG_FILENAME}
  236. // ** INTERNAL_ONLY **
  237. // The backup message file named here is a duplicate of net.msg. It
  238. // is not shipped with the product, but is used at buildtime to
  239. // msgbind certain messages to netapi.dll and some of the services.
  240. // This allows for OEMs to modify the message text in net.msg and
  241. // have those changes show up. Only in case there is an error in
  242. // retrieving the messages from net.msg do we then get the bound
  243. // messages out of bak.msg (really out of the message segment).
  244. BACKUP_MSG_FILENAME = LMSTR('BAK.MSG');
  245. {$EXTERNALSYM BACKUP_MSG_FILENAME}
  246. // ** END_INTERNAL **
  247. {$ENDIF LM_USE_UNICODE}
  248. {$UNDEF LM_USE_UNICODE}
  249. //
  250. // Message File Names
  251. //
  252. //
  253. // Keywords used in Function Prototypes
  254. //
  255. type
  256. NET_API_STATUS = DWORD;
  257. {$EXTERNALSYM NET_API_STATUS}
  258. TNetApiStatus = NET_API_STATUS;
  259. //
  260. // The platform ID indicates the levels to use for platform-specific
  261. // information.
  262. //
  263. const
  264. PLATFORM_ID_DOS = 300;
  265. {$EXTERNALSYM PLATFORM_ID_DOS}
  266. PLATFORM_ID_OS2 = 400;
  267. {$EXTERNALSYM PLATFORM_ID_OS2}
  268. PLATFORM_ID_NT = 500;
  269. {$EXTERNALSYM PLATFORM_ID_NT}
  270. PLATFORM_ID_OSF = 600;
  271. {$EXTERNALSYM PLATFORM_ID_OSF}
  272. PLATFORM_ID_VMS = 700;
  273. {$EXTERNALSYM PLATFORM_ID_VMS}
  274. //
  275. // There message numbers assigned to different LANMAN components
  276. // are as defined below.
  277. //
  278. // lmerr.h: 2100 - 2999 NERR_BASE
  279. // alertmsg.h: 3000 - 3049 ALERT_BASE
  280. // lmsvc.h: 3050 - 3099 SERVICE_BASE
  281. // lmerrlog.h: 3100 - 3299 ERRLOG_BASE
  282. // msgtext.h: 3300 - 3499 MTXT_BASE
  283. // apperr.h: 3500 - 3999 APPERR_BASE
  284. // apperrfs.h: 4000 - 4299 APPERRFS_BASE
  285. // apperr2.h: 4300 - 5299 APPERR2_BASE
  286. // ncberr.h: 5300 - 5499 NRCERR_BASE
  287. // alertmsg.h: 5500 - 5599 ALERT2_BASE
  288. // lmsvc.h: 5600 - 5699 SERVICE2_BASE
  289. // lmerrlog.h 5700 - 5899 ERRLOG2_BASE
  290. //
  291. MIN_LANMAN_MESSAGE_ID = NERR_BASE;
  292. {$EXTERNALSYM MIN_LANMAN_MESSAGE_ID}
  293. MAX_LANMAN_MESSAGE_ID = 5899;
  294. {$EXTERNALSYM MAX_LANMAN_MESSAGE_ID}
  295. {$ENDIF JWA_INTERFACESECTION}
  296. {$IFNDEF JWA_INCLUDEMODE}
  297. implementation
  298. {$ENDIF !JWA_INCLUDEMODE}
  299. {$IFDEF JWA_IMPLEMENTATIONSECTION}
  300. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  301. {$IFNDEF JWA_INCLUDEMODE}
  302. end.
  303. {$ENDIF !JWA_INCLUDEMODE}