📄 jwanb30.pas
字号:
TLanaEnum = LANA_ENUM;
PLanaEnum = PLANA_ENUM;
//
// Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed
// by an array of FIND_NAME_BUFFER structures.
//
type
_FIND_NAME_HEADER = record
node_count: WORD;
reserved: UCHAR;
unique_group: UCHAR;
end;
{$EXTERNALSYM _FIND_NAME_HEADER}
FIND_NAME_HEADER = _FIND_NAME_HEADER;
{$EXTERNALSYM FIND_NAME_HEADER}
PFIND_NAME_HEADER = ^FIND_NAME_HEADER;
{$EXTERNALSYM PFIND_NAME_HEADER}
TFindNameHeader = FIND_NAME_HEADER;
PFindNameHeader = PFIND_NAME_HEADER;
_FIND_NAME_BUFFER = record
length: UCHAR;
access_control: UCHAR;
frame_control: UCHAR;
destination_addr: array [0..5] of UCHAR;
source_addr: array [0..5] of UCHAR;
routing_info: array [0..17] of UCHAR;
end;
{$EXTERNALSYM _FIND_NAME_BUFFER}
FIND_NAME_BUFFER = _FIND_NAME_BUFFER;
{$EXTERNALSYM FIND_NAME_BUFFER}
PFIND_NAME_BUFFER = ^FIND_NAME_BUFFER;
{$EXTERNALSYM PFIND_NAME_BUFFER}
TFindNameBuffer = FIND_NAME_BUFFER;
PFindNameBuffer = PFIND_NAME_BUFFER;
//
// Structure provided with NCBACTION. The purpose of NCBACTION is to provide
// transport specific extensions to netbios.
//
_ACTION_HEADER = record
transport_id: ULONG;
action_code: USHORT;
reserved: USHORT;
end;
{$EXTERNALSYM _ACTION_HEADER}
ACTION_HEADER = _ACTION_HEADER;
{$EXTERNALSYM ACTION_HEADER}
PACTION_HEADER = ^ACTION_HEADER;
{$EXTERNALSYM PACTION_HEADER}
TActionHeader = ACTION_HEADER;
PActionHeader = PACTION_HEADER;
// Values for transport_id
const
ALL_TRANSPORTS = 'M'#0#0#0;
{$EXTERNALSYM ALL_TRANSPORTS}
MS_NBF = 'MNBF';
{$EXTERNALSYM MS_NBF}
(****************************************************************
* *
* Special values and constants *
* *
****************************************************************)
//
// NCB Command codes
//
const
NCBCALL = $10; // NCB CALL
{$EXTERNALSYM NCBCALL}
NCBLISTEN = $11; // NCB LISTEN
{$EXTERNALSYM NCBLISTEN}
NCBHANGUP = $12; // NCB HANG UP
{$EXTERNALSYM NCBHANGUP}
NCBSEND = $14; // NCB SEND
{$EXTERNALSYM NCBSEND}
NCBRECV = $15; // NCB RECEIVE
{$EXTERNALSYM NCBRECV}
NCBRECVANY = $16; // NCB RECEIVE ANY
{$EXTERNALSYM NCBRECVANY}
NCBCHAINSEND = $17; // NCB CHAIN SEND
{$EXTERNALSYM NCBCHAINSEND}
NCBDGSEND = $20; // NCB SEND DATAGRAM
{$EXTERNALSYM NCBDGSEND}
NCBDGRECV = $21; // NCB RECEIVE DATAGRAM
{$EXTERNALSYM NCBDGRECV}
NCBDGSENDBC = $22; // NCB SEND BROADCAST DATAGRAM
{$EXTERNALSYM NCBDGSENDBC}
NCBDGRECVBC = $23; // NCB RECEIVE BROADCAST DATAGRAM
{$EXTERNALSYM NCBDGRECVBC}
NCBADDNAME = $30; // NCB ADD NAME
{$EXTERNALSYM NCBADDNAME}
NCBDELNAME = $31; // NCB DELETE NAME
{$EXTERNALSYM NCBDELNAME}
NCBRESET = $32; // NCB RESET
{$EXTERNALSYM NCBRESET}
NCBASTAT = $33; // NCB ADAPTER STATUS
{$EXTERNALSYM NCBASTAT}
NCBSSTAT = $34; // NCB SESSION STATUS
{$EXTERNALSYM NCBSSTAT}
NCBCANCEL = $35; // NCB CANCEL
{$EXTERNALSYM NCBCANCEL}
NCBADDGRNAME = $36; // NCB ADD GROUP NAME
{$EXTERNALSYM NCBADDGRNAME}
NCBENUM = $37; // NCB ENUMERATE LANA NUMBERS
{$EXTERNALSYM NCBENUM}
NCBUNLINK = $70; // NCB UNLINK
{$EXTERNALSYM NCBUNLINK}
NCBSENDNA = $71; // NCB SEND NO ACK
{$EXTERNALSYM NCBSENDNA}
NCBCHAINSENDNA = $72; // NCB CHAIN SEND NO ACK
{$EXTERNALSYM NCBCHAINSENDNA}
NCBLANSTALERT = $73; // NCB LAN STATUS ALERT
{$EXTERNALSYM NCBLANSTALERT}
NCBACTION = $77; // NCB ACTION
{$EXTERNALSYM NCBACTION}
NCBFINDNAME = $78; // NCB FIND NAME
{$EXTERNALSYM NCBFINDNAME}
NCBTRACE = $79; // NCB TRACE
{$EXTERNALSYM NCBTRACE}
ASYNCH = $80; // high bit set == asynchronous
{$EXTERNALSYM ASYNCH}
//
// NCB Return codes
//
NRC_GOODRET = $00; // good return also returned when ASYNCH request accepted
{$EXTERNALSYM NRC_GOODRET}
NRC_BUFLEN = $01; // illegal buffer length
{$EXTERNALSYM NRC_BUFLEN}
NRC_ILLCMD = $03; // illegal command
{$EXTERNALSYM NRC_ILLCMD}
NRC_CMDTMO = $05; // command timed out
{$EXTERNALSYM NRC_CMDTMO}
NRC_INCOMP = $06; // message incomplete, issue another command
{$EXTERNALSYM NRC_INCOMP}
NRC_BADDR = $07; // illegal buffer address
{$EXTERNALSYM NRC_BADDR}
NRC_SNUMOUT = $08; // session number out of range
{$EXTERNALSYM NRC_SNUMOUT}
NRC_NORES = $09; // no resource available
{$EXTERNALSYM NRC_NORES}
NRC_SCLOSED = $0a; // session closed
{$EXTERNALSYM NRC_SCLOSED}
NRC_CMDCAN = $0b; // command cancelled
{$EXTERNALSYM NRC_CMDCAN}
NRC_DUPNAME = $0d; // duplicate name
{$EXTERNALSYM NRC_DUPNAME}
NRC_NAMTFUL = $0e; // name table full
{$EXTERNALSYM NRC_NAMTFUL}
NRC_ACTSES = $0f; // no deletions, name has active sessions
{$EXTERNALSYM NRC_ACTSES}
NRC_LOCTFUL = $11; // local session table full
{$EXTERNALSYM NRC_LOCTFUL}
NRC_REMTFUL = $12; // remote session table full
{$EXTERNALSYM NRC_REMTFUL}
NRC_ILLNN = $13; // illegal name number
{$EXTERNALSYM NRC_ILLNN}
NRC_NOCALL = $14; // no callname
{$EXTERNALSYM NRC_NOCALL}
NRC_NOWILD = $15; // cannot put * in NCB_NAME
{$EXTERNALSYM NRC_NOWILD}
NRC_INUSE = $16; // name in use on remote adapter
{$EXTERNALSYM NRC_INUSE}
NRC_NAMERR = $17; // name deleted
{$EXTERNALSYM NRC_NAMERR}
NRC_SABORT = $18; // session ended abnormally
{$EXTERNALSYM NRC_SABORT}
NRC_NAMCONF = $19; // name conflict detected
{$EXTERNALSYM NRC_NAMCONF}
NRC_IFBUSY = $21; // interface busy, IRET before retrying
{$EXTERNALSYM NRC_IFBUSY}
NRC_TOOMANY = $22; // too many commands outstanding, retry later
{$EXTERNALSYM NRC_TOOMANY}
NRC_BRIDGE = $23; // ncb_lana_num field invalid
{$EXTERNALSYM NRC_BRIDGE}
NRC_CANOCCR = $24; // command completed while cancel occurring
{$EXTERNALSYM NRC_CANOCCR}
NRC_CANCEL = $26; // command not valid to cancel
{$EXTERNALSYM NRC_CANCEL}
NRC_DUPENV = $30; // name defined by anther local process
{$EXTERNALSYM NRC_DUPENV}
NRC_ENVNOTDEF = $34; // environment undefined. RESET required
{$EXTERNALSYM NRC_ENVNOTDEF}
NRC_OSRESNOTAV = $35; // required OS resources exhausted
{$EXTERNALSYM NRC_OSRESNOTAV}
NRC_MAXAPPS = $36; // max number of applications exceeded
{$EXTERNALSYM NRC_MAXAPPS}
NRC_NOSAPS = $37; // no saps available for netbios
{$EXTERNALSYM NRC_NOSAPS}
NRC_NORESOURCES = $38; // requested resources are not available
{$EXTERNALSYM NRC_NORESOURCES}
NRC_INVADDRESS = $39; // invalid ncb address or length > segment
{$EXTERNALSYM NRC_INVADDRESS}
NRC_INVDDID = $3B; // invalid NCB DDID
{$EXTERNALSYM NRC_INVDDID}
NRC_LOCKFAIL = $3C; // lock of user area failed
{$EXTERNALSYM NRC_LOCKFAIL}
NRC_OPENERR = $3f; // NETBIOS not loaded
{$EXTERNALSYM NRC_OPENERR}
NRC_SYSTEM = $40; // system error
{$EXTERNALSYM NRC_SYSTEM}
NRC_PENDING = $ff; // asynchronous command is not yet finished
{$EXTERNALSYM NRC_PENDING}
(****************************************************************
* *
* main user entry point for NetBIOS 3.0 *
* *
* Usage: result = Netbios( pncb ); *
****************************************************************)
function Netbios(pncb: PNCB): UCHAR; stdcall;
{$EXTERNALSYM Netbios}
(****************************************************************
* *
* Prefix for callback routines *
* *
* Usage in a declaration: NCB_POST MyPostRoutine( PNCB pncb ); *
****************************************************************)
// #define NCB_POST void CALLBACK
implementation
{$IFDEF DYNAMIC_LINK}
var
_Netbios: Pointer;
function Netbios;
begin
GetProcedureAddress(_Netbios, 'netapi32.dll', 'Netbios');
asm
mov esp, ebp
pop ebp
jmp [_Netbios]
end;
end;
{$ELSE}
function Netbios; external 'netapi32.dll' name 'Netbios';
{$ENDIF DYNAMIC_LINK}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -