jwanb30.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. {******************************************************************************}
  2. { }
  3. { Portable Netbios 3.0 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: Nb30.h, released June 2000. The original Pascal }
  9. { code is: JwaN30.pas, released December 2000. 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: JwaNb30.pas,v 1.10 2005/09/06 16:36:50 marquardt Exp $
  43. {$IFNDEF JWA_INCLUDEMODE}
  44. unit JwaNb30;
  45. {$WEAKPACKAGEUNIT}
  46. {$I jediapilib.inc}
  47. interface
  48. uses
  49. JwaWinType;
  50. {$ENDIF !JWA_INCLUDEMODE}
  51. {$IFDEF JWA_INTERFACESECTION}
  52. {$HPPEMIT ''}
  53. {$HPPEMIT '#include "Nb30.h"'}
  54. {$HPPEMIT ''}
  55. (****************************************************************
  56. * *
  57. * Data structure templates *
  58. * *
  59. ****************************************************************)
  60. const
  61. NCBNAMSZ = 16; // absolute length of a net name
  62. {$EXTERNALSYM NCBNAMSZ}
  63. MAX_LANA = 254; // lana's in range 0 to MAX_LANA inclusive
  64. {$EXTERNALSYM MAX_LANA}
  65. //
  66. // Network Control Block
  67. //
  68. type
  69. PNCB = ^NCB;
  70. TNcbPost = procedure(P: PNCB); stdcall;
  71. _NCB = record
  72. ncb_command: UCHAR; // command code
  73. ncb_retcode: UCHAR; // return code
  74. ncb_lsn: UCHAR; // local session number
  75. ncb_num: UCHAR; // number of our network name
  76. ncb_buffer: PChar; // address of message buffer
  77. ncb_length: Word; // size of message buffer
  78. ncb_callname: array [0..NCBNAMSZ - 1] of Char; // blank-padded name of remote
  79. ncb_name: array [0..NCBNAMSZ - 1] of Char; // our blank-padded netname
  80. ncb_rto: UCHAR; // rcv timeout/retry count
  81. ncb_sto: UCHAR; // send timeout/sys timeout
  82. ncb_post: TNcbPost; // POST routine address
  83. ncb_lana_num: UCHAR; // lana (adapter) number
  84. ncb_cmd_cplt: UCHAR; // 0xff => commmand pending
  85. {$IFDEF _WIN64}
  86. ncb_reserve: array [0..17] of Char; // reserved, used by BIOS
  87. {$ELSE}
  88. ncb_reserve: array [0..9] of Char; // reserved, used by BIOS
  89. {$ENDIF _WIN64}
  90. ncb_event: HANDLE; // HANDLE to Win32 event which
  91. // will be set to the signalled
  92. // state when an ASYNCH command
  93. // completes
  94. end;
  95. {$EXTERNALSYM _NCB}
  96. NCB = _NCB;
  97. {$EXTERNALSYM NCB}
  98. TNcb = NCB;
  99. //
  100. // Structure returned to the NCB command NCBASTAT is ADAPTER_STATUS followed
  101. // by an array of NAME_BUFFER structures.
  102. //
  103. _ADAPTER_STATUS = record
  104. adapter_address: array [0..5] of UCHAR;
  105. rev_major: UCHAR;
  106. reserved0: UCHAR;
  107. adapter_type: UCHAR;
  108. rev_minor: UCHAR;
  109. duration: WORD;
  110. frmr_recv: WORD;
  111. frmr_xmit: WORD;
  112. iframe_recv_err: WORD;
  113. xmit_aborts: WORD;
  114. xmit_success: DWORD;
  115. recv_success: DWORD;
  116. iframe_xmit_err: WORD;
  117. recv_buff_unavail: WORD;
  118. t1_timeouts: WORD;
  119. ti_timeouts: WORD;
  120. reserved1: DWORD;
  121. free_ncbs: WORD;
  122. max_cfg_ncbs: WORD;
  123. max_ncbs: WORD;
  124. xmit_buf_unavail: WORD;
  125. max_dgram_size: WORD;
  126. pending_sess: WORD;
  127. max_cfg_sess: WORD;
  128. max_sess: WORD;
  129. max_sess_pkt_size: WORD;
  130. name_count: WORD;
  131. end;
  132. {$EXTERNALSYM _ADAPTER_STATUS}
  133. ADAPTER_STATUS = _ADAPTER_STATUS;
  134. {$EXTERNALSYM ADAPTER_STATUS}
  135. PADAPTER_STATUS = ^ADAPTER_STATUS;
  136. {$EXTERNALSYM PADAPTER_STATUS}
  137. TAdapterStatus = ADAPTER_STATUS;
  138. PAdapterStatus = PADAPTER_STATUS;
  139. _NAME_BUFFER = record
  140. name: array [0..NCBNAMSZ - 1] of Char;
  141. name_num: UCHAR;
  142. name_flags: UCHAR;
  143. end;
  144. {$EXTERNALSYM _NAME_BUFFER}
  145. NAME_BUFFER = _NAME_BUFFER;
  146. {$EXTERNALSYM NAME_BUFFER}
  147. PNAME_BUFFER = ^NAME_BUFFER;
  148. {$EXTERNALSYM PNAME_BUFFER}
  149. TNameBuffer = NAME_BUFFER;
  150. PNameBuffer = PNAME_BUFFER;
  151. // values for name_flags bits.
  152. const
  153. NAME_FLAGS_MASK = $87;
  154. {$EXTERNALSYM NAME_FLAGS_MASK}
  155. GROUP_NAME = $80;
  156. {$EXTERNALSYM GROUP_NAME}
  157. UNIQUE_NAME = $00;
  158. {$EXTERNALSYM UNIQUE_NAME}
  159. REGISTERING = $00;
  160. {$EXTERNALSYM REGISTERING}
  161. REGISTERED = $04;
  162. {$EXTERNALSYM REGISTERED}
  163. DEREGISTERED = $05;
  164. {$EXTERNALSYM DEREGISTERED}
  165. DUPLICATE = $06;
  166. {$EXTERNALSYM DUPLICATE}
  167. DUPLICATE_DEREG = $07;
  168. {$EXTERNALSYM DUPLICATE_DEREG}
  169. //
  170. // Structure returned to the NCB command NCBSSTAT is SESSION_HEADER followed
  171. // by an array of SESSION_BUFFER structures. If the NCB_NAME starts with an
  172. // asterisk then an array of these structures is returned containing the
  173. // status for all names.
  174. //
  175. type
  176. _SESSION_HEADER = record
  177. sess_name: UCHAR;
  178. num_sess: UCHAR;
  179. rcv_dg_outstanding: UCHAR;
  180. rcv_any_outstanding: UCHAR;
  181. end;
  182. {$EXTERNALSYM _SESSION_HEADER}
  183. SESSION_HEADER = _SESSION_HEADER;
  184. {$EXTERNALSYM SESSION_HEADER}
  185. PSESSION_HEADER = ^SESSION_HEADER;
  186. {$EXTERNALSYM PSESSION_HEADER}
  187. TSessionHeader = SESSION_HEADER;
  188. PSessionHeader = PSESSION_HEADER;
  189. _SESSION_BUFFER = record
  190. lsn: UCHAR;
  191. state: UCHAR;
  192. local_name: array [0..NCBNAMSZ - 1] of UCHAR;
  193. remote_name: array [0..NCBNAMSZ - 1] of UCHAR;
  194. rcvs_outstanding: UCHAR;
  195. sends_outstanding: UCHAR;
  196. end;
  197. {$EXTERNALSYM _SESSION_BUFFER}
  198. SESSION_BUFFER = _SESSION_BUFFER;
  199. {$EXTERNALSYM SESSION_BUFFER}
  200. PSESSION_BUFFER = ^SESSION_BUFFER;
  201. {$EXTERNALSYM PSESSION_BUFFER}
  202. TSessionBuffer = SESSION_BUFFER;
  203. PSessionBuffer = PSESSION_BUFFER;
  204. // Values for state
  205. const
  206. LISTEN_OUTSTANDING = $01;
  207. {$EXTERNALSYM LISTEN_OUTSTANDING}
  208. CALL_PENDING = $02;
  209. {$EXTERNALSYM CALL_PENDING}
  210. SESSION_ESTABLISHED = $03;
  211. {$EXTERNALSYM SESSION_ESTABLISHED}
  212. HANGUP_PENDING = $04;
  213. {$EXTERNALSYM HANGUP_PENDING}
  214. HANGUP_COMPLETE = $05;
  215. {$EXTERNALSYM HANGUP_COMPLETE}
  216. SESSION_ABORTED = $06;
  217. {$EXTERNALSYM SESSION_ABORTED}
  218. //
  219. // Structure returned to the NCB command NCBENUM.
  220. //
  221. // On a system containing lana's 0, 2 and 3, a structure with
  222. // length =3, lana[0]=0, lana[1]=2 and lana[2]=3 will be returned.
  223. //
  224. type
  225. _LANA_ENUM = record
  226. length: UCHAR; // Number of valid entries in lana[]
  227. lana: array [0..MAX_LANA] of UCHAR;
  228. end;
  229. {$EXTERNALSYM _LANA_ENUM}
  230. LANA_ENUM = _LANA_ENUM;
  231. {$EXTERNALSYM LANA_ENUM}
  232. PLANA_ENUM = ^LANA_ENUM;
  233. {$EXTERNALSYM PLANA_ENUM}
  234. TLanaEnum = LANA_ENUM;
  235. PLanaEnum = PLANA_ENUM;
  236. //
  237. // Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed
  238. // by an array of FIND_NAME_BUFFER structures.
  239. //
  240. type
  241. _FIND_NAME_HEADER = record
  242. node_count: WORD;
  243. reserved: UCHAR;
  244. unique_group: UCHAR;
  245. end;
  246. {$EXTERNALSYM _FIND_NAME_HEADER}
  247. FIND_NAME_HEADER = _FIND_NAME_HEADER;
  248. {$EXTERNALSYM FIND_NAME_HEADER}
  249. PFIND_NAME_HEADER = ^FIND_NAME_HEADER;
  250. {$EXTERNALSYM PFIND_NAME_HEADER}
  251. TFindNameHeader = FIND_NAME_HEADER;
  252. PFindNameHeader = PFIND_NAME_HEADER;
  253. _FIND_NAME_BUFFER = record
  254. length: UCHAR;
  255. access_control: UCHAR;
  256. frame_control: UCHAR;
  257. destination_addr: array [0..5] of UCHAR;
  258. source_addr: array [0..5] of UCHAR;
  259. routing_info: array [0..17] of UCHAR;
  260. end;
  261. {$EXTERNALSYM _FIND_NAME_BUFFER}
  262. FIND_NAME_BUFFER = _FIND_NAME_BUFFER;
  263. {$EXTERNALSYM FIND_NAME_BUFFER}
  264. PFIND_NAME_BUFFER = ^FIND_NAME_BUFFER;
  265. {$EXTERNALSYM PFIND_NAME_BUFFER}
  266. TFindNameBuffer = FIND_NAME_BUFFER;
  267. PFindNameBuffer = PFIND_NAME_BUFFER;
  268. //
  269. // Structure provided with NCBACTION. The purpose of NCBACTION is to provide
  270. // transport specific extensions to netbios.
  271. //
  272. _ACTION_HEADER = record
  273. transport_id: ULONG;
  274. action_code: USHORT;
  275. reserved: USHORT;
  276. end;
  277. {$EXTERNALSYM _ACTION_HEADER}
  278. ACTION_HEADER = _ACTION_HEADER;
  279. {$EXTERNALSYM ACTION_HEADER}
  280. PACTION_HEADER = ^ACTION_HEADER;
  281. {$EXTERNALSYM PACTION_HEADER}
  282. TActionHeader = ACTION_HEADER;
  283. PActionHeader = PACTION_HEADER;
  284. // Values for transport_id
  285. const
  286. ALL_TRANSPORTS = 'M'#0#0#0;
  287. {$EXTERNALSYM ALL_TRANSPORTS}
  288. MS_NBF = 'MNBF';
  289. {$EXTERNALSYM MS_NBF}
  290. (****************************************************************
  291. * *
  292. * Special values and constants *
  293. * *
  294. ****************************************************************)
  295. //
  296. // NCB Command codes
  297. //
  298. const
  299. NCBCALL = $10; // NCB CALL
  300. {$EXTERNALSYM NCBCALL}
  301. NCBLISTEN = $11; // NCB LISTEN
  302. {$EXTERNALSYM NCBLISTEN}
  303. NCBHANGUP = $12; // NCB HANG UP
  304. {$EXTERNALSYM NCBHANGUP}
  305. NCBSEND = $14; // NCB SEND
  306. {$EXTERNALSYM NCBSEND}
  307. NCBRECV = $15; // NCB RECEIVE
  308. {$EXTERNALSYM NCBRECV}
  309. NCBRECVANY = $16; // NCB RECEIVE ANY
  310. {$EXTERNALSYM NCBRECVANY}
  311. NCBCHAINSEND = $17; // NCB CHAIN SEND
  312. {$EXTERNALSYM NCBCHAINSEND}
  313. NCBDGSEND = $20; // NCB SEND DATAGRAM
  314. {$EXTERNALSYM NCBDGSEND}
  315. NCBDGRECV = $21; // NCB RECEIVE DATAGRAM
  316. {$EXTERNALSYM NCBDGRECV}
  317. NCBDGSENDBC = $22; // NCB SEND BROADCAST DATAGRAM
  318. {$EXTERNALSYM NCBDGSENDBC}
  319. NCBDGRECVBC = $23; // NCB RECEIVE BROADCAST DATAGRAM
  320. {$EXTERNALSYM NCBDGRECVBC}
  321. NCBADDNAME = $30; // NCB ADD NAME
  322. {$EXTERNALSYM NCBADDNAME}
  323. NCBDELNAME = $31; // NCB DELETE NAME
  324. {$EXTERNALSYM NCBDELNAME}
  325. NCBRESET = $32; // NCB RESET
  326. {$EXTERNALSYM NCBRESET}
  327. NCBASTAT = $33; // NCB ADAPTER STATUS
  328. {$EXTERNALSYM NCBASTAT}
  329. NCBSSTAT = $34; // NCB SESSION STATUS
  330. {$EXTERNALSYM NCBSSTAT}
  331. NCBCANCEL = $35; // NCB CANCEL
  332. {$EXTERNALSYM NCBCANCEL}
  333. NCBADDGRNAME = $36; // NCB ADD GROUP NAME
  334. {$EXTERNALSYM NCBADDGRNAME}
  335. NCBENUM = $37; // NCB ENUMERATE LANA NUMBERS
  336. {$EXTERNALSYM NCBENUM}
  337. NCBUNLINK = $70; // NCB UNLINK
  338. {$EXTERNALSYM NCBUNLINK}
  339. NCBSENDNA = $71; // NCB SEND NO ACK
  340. {$EXTERNALSYM NCBSENDNA}
  341. NCBCHAINSENDNA = $72; // NCB CHAIN SEND NO ACK
  342. {$EXTERNALSYM NCBCHAINSENDNA}
  343. NCBLANSTALERT = $73; // NCB LAN STATUS ALERT
  344. {$EXTERNALSYM NCBLANSTALERT}
  345. NCBACTION = $77; // NCB ACTION
  346. {$EXTERNALSYM NCBACTION}
  347. NCBFINDNAME = $78; // NCB FIND NAME
  348. {$EXTERNALSYM NCBFINDNAME}
  349. NCBTRACE = $79; // NCB TRACE
  350. {$EXTERNALSYM NCBTRACE}
  351. ASYNCH = $80; // high bit set == asynchronous
  352. {$EXTERNALSYM ASYNCH}
  353. //
  354. // NCB Return codes
  355. //
  356. NRC_GOODRET = $00; // good return also returned when ASYNCH request accepted
  357. {$EXTERNALSYM NRC_GOODRET}
  358. NRC_BUFLEN = $01; // illegal buffer length
  359. {$EXTERNALSYM NRC_BUFLEN}
  360. NRC_ILLCMD = $03; // illegal command
  361. {$EXTERNALSYM NRC_ILLCMD}
  362. NRC_CMDTMO = $05; // command timed out
  363. {$EXTERNALSYM NRC_CMDTMO}
  364. NRC_INCOMP = $06; // message incomplete, issue another command
  365. {$EXTERNALSYM NRC_INCOMP}
  366. NRC_BADDR = $07; // illegal buffer address
  367. {$EXTERNALSYM NRC_BADDR}
  368. NRC_SNUMOUT = $08; // session number out of range
  369. {$EXTERNALSYM NRC_SNUMOUT}
  370. NRC_NORES = $09; // no resource available
  371. {$EXTERNALSYM NRC_NORES}
  372. NRC_SCLOSED = $0a; // session closed
  373. {$EXTERNALSYM NRC_SCLOSED}
  374. NRC_CMDCAN = $0b; // command cancelled
  375. {$EXTERNALSYM NRC_CMDCAN}
  376. NRC_DUPNAME = $0d; // duplicate name
  377. {$EXTERNALSYM NRC_DUPNAME}
  378. NRC_NAMTFUL = $0e; // name table full
  379. {$EXTERNALSYM NRC_NAMTFUL}
  380. NRC_ACTSES = $0f; // no deletions, name has active sessions
  381. {$EXTERNALSYM NRC_ACTSES}
  382. NRC_LOCTFUL = $11; // local session table full
  383. {$EXTERNALSYM NRC_LOCTFUL}
  384. NRC_REMTFUL = $12; // remote session table full
  385. {$EXTERNALSYM NRC_REMTFUL}
  386. NRC_ILLNN = $13; // illegal name number
  387. {$EXTERNALSYM NRC_ILLNN}
  388. NRC_NOCALL = $14; // no callname
  389. {$EXTERNALSYM NRC_NOCALL}
  390. NRC_NOWILD = $15; // cannot put * in NCB_NAME
  391. {$EXTERNALSYM NRC_NOWILD}
  392. NRC_INUSE = $16; // name in use on remote adapter
  393. {$EXTERNALSYM NRC_INUSE}
  394. NRC_NAMERR = $17; // name deleted
  395. {$EXTERNALSYM NRC_NAMERR}
  396. NRC_SABORT = $18; // session ended abnormally
  397. {$EXTERNALSYM NRC_SABORT}
  398. NRC_NAMCONF = $19; // name conflict detected
  399. {$EXTERNALSYM NRC_NAMCONF}
  400. NRC_IFBUSY = $21; // interface busy, IRET before retrying
  401. {$EXTERNALSYM NRC_IFBUSY}
  402. NRC_TOOMANY = $22; // too many commands outstanding, retry later
  403. {$EXTERNALSYM NRC_TOOMANY}
  404. NRC_BRIDGE = $23; // ncb_lana_num field invalid
  405. {$EXTERNALSYM NRC_BRIDGE}
  406. NRC_CANOCCR = $24; // command completed while cancel occurring
  407. {$EXTERNALSYM NRC_CANOCCR}
  408. NRC_CANCEL = $26; // command not valid to cancel
  409. {$EXTERNALSYM NRC_CANCEL}
  410. NRC_DUPENV = $30; // name defined by anther local process
  411. {$EXTERNALSYM NRC_DUPENV}
  412. NRC_ENVNOTDEF = $34; // environment undefined. RESET required
  413. {$EXTERNALSYM NRC_ENVNOTDEF}
  414. NRC_OSRESNOTAV = $35; // required OS resources exhausted
  415. {$EXTERNALSYM NRC_OSRESNOTAV}
  416. NRC_MAXAPPS = $36; // max number of applications exceeded
  417. {$EXTERNALSYM NRC_MAXAPPS}
  418. NRC_NOSAPS = $37; // no saps available for netbios
  419. {$EXTERNALSYM NRC_NOSAPS}
  420. NRC_NORESOURCES = $38; // requested resources are not available
  421. {$EXTERNALSYM NRC_NORESOURCES}
  422. NRC_INVADDRESS = $39; // invalid ncb address or length > segment
  423. {$EXTERNALSYM NRC_INVADDRESS}
  424. NRC_INVDDID = $3B; // invalid NCB DDID
  425. {$EXTERNALSYM NRC_INVDDID}
  426. NRC_LOCKFAIL = $3C; // lock of user area failed
  427. {$EXTERNALSYM NRC_LOCKFAIL}
  428. NRC_OPENERR = $3f; // NETBIOS not loaded
  429. {$EXTERNALSYM NRC_OPENERR}
  430. NRC_SYSTEM = $40; // system error
  431. {$EXTERNALSYM NRC_SYSTEM}
  432. NRC_PENDING = $ff; // asynchronous command is not yet finished
  433. {$EXTERNALSYM NRC_PENDING}
  434. (****************************************************************
  435. * *
  436. * main user entry point for NetBIOS 3.0 *
  437. * *
  438. * Usage: result = Netbios( pncb ); *
  439. ****************************************************************)
  440. function Netbios(pncb: PNCB): UCHAR; stdcall;
  441. {$EXTERNALSYM Netbios}
  442. (****************************************************************
  443. * *
  444. * Prefix for callback routines *
  445. * *
  446. * Usage in a declaration: NCB_POST MyPostRoutine( PNCB pncb ); *
  447. ****************************************************************)
  448. // #define NCB_POST void CALLBACK
  449. {$ENDIF JWA_INTERFACESECTION}
  450. {$IFNDEF JWA_INCLUDEMODE}
  451. implementation
  452. uses
  453. JwaWinDLLNames;
  454. {$ENDIF !JWA_INCLUDEMODE}
  455. {$IFDEF JWA_IMPLEMENTATIONSECTION}
  456. {$IFDEF DYNAMIC_LINK}
  457. var
  458. _Netbios: Pointer;
  459. function Netbios;
  460. begin
  461. GetProcedureAddress(_Netbios, netapi32, 'Netbios');
  462. asm
  463. MOV ESP, EBP
  464. POP EBP
  465. JMP [_Netbios]
  466. end;
  467. end;
  468. {$ELSE}
  469. function Netbios; external netapi32 name 'Netbios';
  470. {$ENDIF DYNAMIC_LINK}
  471. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  472. {$IFNDEF JWA_INCLUDEMODE}
  473. end.
  474. {$ENDIF !JWA_INCLUDEMODE}