![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Frederico and all, this works perfectly on XP! Haven't tested on other
platforms yet.
- Roger
-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf Of
Federico de Ceballos
Sent: Tuesday, August 17, 2004 8:05 AM
To: sftalk_at_forth.com
Subject: [sftalk] Re: Mac address
Roger, Richard,
> I get a catch = 35 on the BIOS-RESET... Win XP, 2 different machines.
> I get the same WinXP SP1
It appears (Microsoft Knowledge Base - 118623) that you cannot assume that
the LANA number is 0.
Try this new version. (It assumes you have only one network adapter.)
LIBRARY NETAPI32.DLL FUNCTION: Netbios ( ncb -- res )
64 BUFFER: NCB \ CVARIABLE command 0
\ CVARIABLE retcode 1
\ CVARIABLE lsn 2
\ CVARIABLE num 3
\ VARIABLE buffer 4
\ HVARIABLE length 8
\ 16 BUFFER: callname 10
\ 16 BUFFER: name 26
\ CVARIABLE rto 42
\ CVARIABLE sto 43
\ VARIABLE post 44
\ CVARIABLE lana_num 48
\ CVARIABLE cmd_cplt 49
\ 10 BUFFER: reserve 50
\ VARIABLE event 60
: CMD! ( command ) NCB 64 ERASE NCB C! ;
: BUF! ( addr len ) NCB 8 + H! NCB 4+ ! ;
: CNAME! S" * " NCB 10 + SWAP CMOVE ;
: LANA! ( n ) NCB 48 + C! ;
: BIOS NCB Netbios THROW ;
: @LANA ( -- n ) NCBENUM CMD! PAD 255 BUF! BIOS PAD 1+ C@ ;
: RESET ( n ) NCBRESET CMD! LANA! BIOS ;
: ADDRESS ( n -- mac ) NCBASTAT CMD! LANA! PAD 90 BUF! CNAME! BIOS
PAD ;
: @MAC ( -- mac ) @LANA DUP RESET ADDRESS ;
: .MAC ( mac ) 5 0 DO COUNT 1 .R ." -" LOOP C@ . ;
HEX @MAC .MAC DECIMAL
Regards,
Federico de Ceballos
****************************************************************************
**********************
The contents of this email and any attachments are confidential.
They are intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or
the
sender immediately and do not disclose the contents to anyone or make
copies.
** eSafe scanned this email for viruses, vandals and malicious content. **
****************************************************************************
**********************
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Tue Aug 17 2004 - 05:09:49 PDT
This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:13 PST