jwalmcons.pas 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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.12 2007/09/05 11:58:50 dezipaitor Exp $
  43. {$IFNDEF JWA_OMIT_SECTIONS}
  44. unit JwaLmCons;
  45. {$WEAKPACKAGEUNIT}
  46. {$ENDIF JWA_OMIT_SECTIONS}
  47. {$HPPEMIT ''}
  48. {$HPPEMIT '#include "lm.h"'}
  49. {$HPPEMIT ''}
  50. {$IFNDEF JWA_OMIT_SECTIONS}
  51. {$I jediapilib.inc}
  52. interface
  53. uses
  54. JwaWinType, JwaLmErr;
  55. {$ENDIF JWA_OMIT_SECTIONS}
  56. {$IFNDEF JWA_IMPLEMENTATIONSECTION}
  57. {$IFNDEF JWA_INCLUDEMODE}
  58. const
  59. NetApi32 = 'netapi32.dll';
  60. {$ENDIF JWA_INCLUDEMODE}
  61. //
  62. // NOTE: Lengths of strings are given as the maximum lengths of the
  63. // string in characters (not bytes). This does not include space for the
  64. // terminating 0-characters. When allocating space for such an item,
  65. // use the form:
  66. //
  67. // TCHAR username[UNLEN+1];
  68. //
  69. // Definitions of the form LN20_* define those values in effect for
  70. // LanMan 2.0.
  71. //
  72. //
  73. // String Lengths for various LanMan names
  74. //
  75. const
  76. CNLEN = 15; // Computer name length
  77. {$EXTERNALSYM CNLEN}
  78. LM20_CNLEN = 15; // LM 2.0 Computer name length
  79. {$EXTERNALSYM LM20_CNLEN}
  80. DNLEN = CNLEN; // Maximum domain name length
  81. {$EXTERNALSYM DNLEN}
  82. LM20_DNLEN = LM20_CNLEN; // LM 2.0 Maximum domain name length
  83. {$EXTERNALSYM LM20_DNLEN}
  84. //#if (CNLEN != DNLEN)
  85. //#error CNLEN and DNLEN are not equal
  86. //#endif
  87. UNCLEN = CNLEN + 2; // UNC computer name length
  88. {$EXTERNALSYM UNCLEN}
  89. LM20_UNCLEN = LM20_CNLEN + 2; // LM 2.0 UNC computer name length
  90. {$EXTERNALSYM LM20_UNCLEN}
  91. NNLEN = 80; // Net name length (share name)
  92. {$EXTERNALSYM NNLEN}
  93. LM20_NNLEN = 12; // LM 2.0 Net name length
  94. {$EXTERNALSYM LM20_NNLEN}
  95. RMLEN = UNCLEN + 1 + NNLEN; // Max remote name length
  96. {$EXTERNALSYM RMLEN}
  97. LM20_RMLEN = LM20_UNCLEN + 1 + LM20_NNLEN; // LM 2.0 Max remote name length
  98. {$EXTERNALSYM LM20_RMLEN}
  99. SNLEN = 80; // Service name length
  100. {$EXTERNALSYM SNLEN}
  101. LM20_SNLEN = 15; // LM 2.0 Service name length
  102. {$EXTERNALSYM LM20_SNLEN}
  103. STXTLEN = 256; // Service text length
  104. {$EXTERNALSYM STXTLEN}
  105. LM20_STXTLEN = 63; // LM 2.0 Service text length
  106. {$EXTERNALSYM LM20_STXTLEN}
  107. PATHLEN = 256; // Max. path (not including drive name)
  108. {$EXTERNALSYM PATHLEN}
  109. LM20_PATHLEN = 256; // LM 2.0 Max. path
  110. {$EXTERNALSYM LM20_PATHLEN}
  111. DEVLEN = 80; // Device name length
  112. {$EXTERNALSYM DEVLEN}
  113. LM20_DEVLEN = 8; // LM 2.0 Device name length
  114. {$EXTERNALSYM LM20_DEVLEN}
  115. EVLEN = 16; // Event name length
  116. {$EXTERNALSYM EVLEN}
  117. //
  118. // User, Group and Password lengths
  119. //
  120. UNLEN = 256; // Maximum user name length
  121. {$EXTERNALSYM UNLEN}
  122. LM20_UNLEN = 20; // LM 2.0 Maximum user name length
  123. {$EXTERNALSYM LM20_UNLEN}
  124. GNLEN = UNLEN; // Group name
  125. {$EXTERNALSYM GNLEN}
  126. LM20_GNLEN = LM20_UNLEN; // LM 2.0 Group name
  127. {$EXTERNALSYM LM20_GNLEN}
  128. PWLEN = 256; // Maximum password length
  129. {$EXTERNALSYM PWLEN}
  130. LM20_PWLEN = 14; // LM 2.0 Maximum password length
  131. {$EXTERNALSYM LM20_PWLEN}
  132. SHPWLEN = 8; // Share password length (bytes)
  133. {$EXTERNALSYM SHPWLEN}
  134. CLTYPE_LEN = 12; // Length of client type string
  135. {$EXTERNALSYM CLTYPE_LEN}
  136. MAXCOMMENTSZ = 256; // Multipurpose comment length
  137. {$EXTERNALSYM MAXCOMMENTSZ}
  138. LM20_MAXCOMMENTSZ = 48; // LM 2.0 Multipurpose comment length
  139. {$EXTERNALSYM LM20_MAXCOMMENTSZ}
  140. QNLEN = NNLEN; // Queue name maximum length
  141. {$EXTERNALSYM QNLEN}
  142. LM20_QNLEN = LM20_NNLEN; // LM 2.0 Queue name maximum length
  143. {$EXTERNALSYM LM20_QNLEN}
  144. //#if (QNLEN != NNLEN)
  145. //# error QNLEN and NNLEN are not equal
  146. //#endif
  147. //
  148. // The ALERTSZ and MAXDEVENTRIES defines have not yet been NT'ized.
  149. // Whoever ports these components should change these values appropriately.
  150. //
  151. ALERTSZ = 128; // size of alert string in server
  152. {$EXTERNALSYM ALERTSZ}
  153. MAXDEVENTRIES = SizeOf(Integer)*8; // Max number of device entries
  154. {$EXTERNALSYM MAXDEVENTRIES}
  155. //
  156. // We use int bitmap to represent
  157. //
  158. NETBIOS_NAME_LEN = 16; // NetBIOS net name (bytes)
  159. {$EXTERNALSYM NETBIOS_NAME_LEN}
  160. //
  161. // Value to be used with APIs which have a "preferred maximum length"
  162. // parameter. This value indicates that the API should just allocate
  163. // "as much as it takes."
  164. //
  165. MAX_PREFERRED_LENGTH = DWORD(-1);
  166. {$EXTERNALSYM MAX_PREFERRED_LENGTH}
  167. //
  168. // Constants used with encryption
  169. //
  170. CRYPT_KEY_LEN = 7;
  171. {$EXTERNALSYM CRYPT_KEY_LEN}
  172. CRYPT_TXT_LEN = 8;
  173. {$EXTERNALSYM CRYPT_TXT_LEN}
  174. ENCRYPTED_PWLEN = 16;
  175. {$EXTERNALSYM ENCRYPTED_PWLEN}
  176. SESSION_PWLEN = 24;
  177. {$EXTERNALSYM SESSION_PWLEN}
  178. SESSION_CRYPT_KLEN = 21;
  179. {$EXTERNALSYM SESSION_CRYPT_KLEN}
  180. //
  181. // Value to be used with SetInfo calls to allow setting of all
  182. // settable parameters (parmnum zero option)
  183. //
  184. PARMNUM_ALL = 0;
  185. {$EXTERNALSYM PARMNUM_ALL}
  186. PARM_ERROR_UNKNOWN = DWORD(-1);
  187. {$EXTERNALSYM PARM_ERROR_UNKNOWN}
  188. PARM_ERROR_NONE = 0;
  189. {$EXTERNALSYM PARM_ERROR_NONE}
  190. PARMNUM_BASE_INFOLEVEL = 1000;
  191. {$EXTERNALSYM PARMNUM_BASE_INFOLEVEL}
  192. //
  193. // Only the UNICODE version of the LM APIs are available on NT.
  194. // Non-UNICODE version on other platforms
  195. //
  196. //#if defined( _WIN32_WINNT ) || defined( WINNT ) || defined( FORCE_UNICODE )
  197. {$IFDEF WINNT4_UP}
  198. {$DEFINE LM_USE_UNICODE}
  199. {$ENDIF WINNT4_UP}
  200. {$IFDEF LM_FORCE_UNICODE}
  201. {$DEFINE LM_USE_UNICODE}
  202. {$ENDIF LM_FORCE_UNICODE}
  203. {$IFDEF LM_USE_UNICODE}
  204. type
  205. LMSTR = LPWSTR;
  206. {$EXTERNALSYM LMSTR}
  207. LMCSTR = LPCWSTR;
  208. {$EXTERNALSYM LMCSTR}
  209. PLMSTR = ^LMSTR;
  210. {$NODEFINE PLMSTR}
  211. const
  212. MESSAGE_FILENAME = WideString('NETMSG');
  213. {$EXTERNALSYM MESSAGE_FILENAME}
  214. OS2MSG_FILENAME = WideString('BASE');
  215. {$EXTERNALSYM OS2MSG_FILENAME}
  216. HELP_MSG_FILENAME = WideString('NETH');
  217. {$EXTERNALSYM HELP_MSG_FILENAME}
  218. // ** INTERNAL_ONLY **
  219. // The backup message file named here is a duplicate of net.msg. It
  220. // is not shipped with the product, but is used at buildtime to
  221. // msgbind certain messages to netapi.dll and some of the services.
  222. // This allows for OEMs to modify the message text in net.msg and
  223. // have those changes show up. Only in case there is an error in
  224. // retrieving the messages from net.msg do we then get the bound
  225. // messages out of bak.msg (really out of the message segment).
  226. BACKUP_MSG_FILENAME = WideString('BAK.MSG');
  227. {$EXTERNALSYM BACKUP_MSG_FILENAME}
  228. // ** END_INTERNAL **
  229. {$ELSE}
  230. type
  231. LMSTR = LPSTR;
  232. {$EXTERNALSYM LMSTR}
  233. LMCSTR = LPCSTR;
  234. {$EXTERNALSYM LMCSTR}
  235. const
  236. MESSAGE_FILENAME = AnsiString('NETMSG');
  237. {$EXTERNALSYM MESSAGE_FILENAME}
  238. OS2MSG_FILENAME = AnsiString('BASE');
  239. {$EXTERNALSYM OS2MSG_FILENAME}
  240. HELP_MSG_FILENAME = AnsiString('NETH');
  241. {$EXTERNALSYM HELP_MSG_FILENAME}
  242. // ** INTERNAL_ONLY **
  243. // The backup message file named here is a duplicate of net.msg. It
  244. // is not shipped with the product, but is used at buildtime to
  245. // msgbind certain messages to netapi.dll and some of the services.
  246. // This allows for OEMs to modify the message text in net.msg and
  247. // have those changes show up. Only in case there is an error in
  248. // retrieving the messages from net.msg do we then get the bound
  249. // messages out of bak.msg (really out of the message segment).
  250. BACKUP_MSG_FILENAME = LMSTR('BAK.MSG');
  251. {$EXTERNALSYM BACKUP_MSG_FILENAME}
  252. // ** END_INTERNAL **
  253. {$ENDIF LM_USE_UNICODE}
  254. {$UNDEF LM_USE_UNICODE}
  255. //
  256. // Message File Names
  257. //
  258. //
  259. // Keywords used in Function Prototypes
  260. //
  261. type
  262. NET_API_STATUS = DWORD;
  263. {$EXTERNALSYM NET_API_STATUS}
  264. TNetApiStatus = NET_API_STATUS;
  265. //
  266. // The platform ID indicates the levels to use for platform-specific
  267. // information.
  268. //
  269. const
  270. PLATFORM_ID_DOS = 300;
  271. {$EXTERNALSYM PLATFORM_ID_DOS}
  272. PLATFORM_ID_OS2 = 400;
  273. {$EXTERNALSYM PLATFORM_ID_OS2}
  274. PLATFORM_ID_NT = 500;
  275. {$EXTERNALSYM PLATFORM_ID_NT}
  276. PLATFORM_ID_OSF = 600;
  277. {$EXTERNALSYM PLATFORM_ID_OSF}
  278. PLATFORM_ID_VMS = 700;
  279. {$EXTERNALSYM PLATFORM_ID_VMS}
  280. //
  281. // There message numbers assigned to different LANMAN components
  282. // are as defined below.
  283. //
  284. // lmerr.h: 2100 - 2999 NERR_BASE
  285. // alertmsg.h: 3000 - 3049 ALERT_BASE
  286. // lmsvc.h: 3050 - 3099 SERVICE_BASE
  287. // lmerrlog.h: 3100 - 3299 ERRLOG_BASE
  288. // msgtext.h: 3300 - 3499 MTXT_BASE
  289. // apperr.h: 3500 - 3999 APPERR_BASE
  290. // apperrfs.h: 4000 - 4299 APPERRFS_BASE
  291. // apperr2.h: 4300 - 5299 APPERR2_BASE
  292. // ncberr.h: 5300 - 5499 NRCERR_BASE
  293. // alertmsg.h: 5500 - 5599 ALERT2_BASE
  294. // lmsvc.h: 5600 - 5699 SERVICE2_BASE
  295. // lmerrlog.h 5700 - 5899 ERRLOG2_BASE
  296. //
  297. MIN_LANMAN_MESSAGE_ID = NERR_BASE;
  298. {$EXTERNALSYM MIN_LANMAN_MESSAGE_ID}
  299. MAX_LANMAN_MESSAGE_ID = 5899;
  300. {$EXTERNALSYM MAX_LANMAN_MESSAGE_ID}
  301. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  302. {$IFNDEF JWA_OMIT_SECTIONS}
  303. implementation
  304. //uses ...
  305. {$ENDIF JWA_OMIT_SECTIONS}
  306. {$IFNDEF JWA_INTERFACESECTION}
  307. //your implementation here
  308. {$ENDIF JWA_INTERFACESECTION}
  309. {$IFNDEF JWA_OMIT_SECTIONS}
  310. end.
  311. {$ENDIF JWA_OMIT_SECTIONS}