home *** CD-ROM | disk | FTP | other *** search
- From: tp923021@jarrah.canberra.edu.au (ben elliston)
- Sender: gateway@f262.n620.z3.fidonet.org
- Path: sparky!uunet!munnari.oz.au!manuel.anu.edu.au!sserve!f262.n620.z3!gateway
- Newsgroups: comp.sys.novell
- Subject: Novell API code
- Message-ID: <727749029.AA00270@f262.n620.z3.fidonet.org>
- Date: Sat, 23 Jan 1993 00:07:00
- Lines: 85
-
- For those people asking about login info, etc., I dug up some Pascal code (easily modifyable to C or assembler) which will return some useful info:
-
- {
- Functions:
- NovellLogicalID Returns logical id (or station number)
- NovellPhysicalID Returns physical network address
- NovellLogonName Returns logon name (or ?????)
- }
-
- unit NovAPI;
-
- interface
-
- uses dos;
-
- function NovellLogicalID : byte;
- inline($B4/$DC/ {MOV AH,DC}
- $CD/$21); {INT 21}
-
- function NovellPhysicalID : word;
- inline($B4/$EE/ {MOV AH,EE}
- $CD/$21); {INT 21}
-
- function NovellLogonName : string;
-
- implementation
-
- function NovellLogonName : string;
- var
- i : integer;
- tmp : string;
- r : Registers;
- RequestPacket : record
- PacketLength : word;
- LogFunction : byte;
- Connection : byte;
- end;
- ReplyPacket : record
- ReturnLength : word;
- UniqueID : longint;
- ReturnType : word;
- ObjectName : array[1..48] of char;
- LogTime : array[1..8] of byte;
- end;
- begin
- RequestPacket.PacketLength:=2;
- RequestPacket.LogFunction:=22;
- RequestPacket.Connection:=NovellLogicalID;
- ReplyPacket.ReturnLength:=64;
- with r do begin
- DS:=seg(RequestPacket);
- SI:=ofs(RequestPacket);
- ES:=seg(ReplyPacket);
- DI:=ofs(ReplyPacket);
- AH:=$E3;
- end;
- MsDOS(r);
- tmp:='?????';
- if r.AL=0 then begin
- i:=1;
- while (ReplyPacket.ObjectName[i]<>#0) and (i<48) do inc(i);
- move(ReplyPacket.ObjectName[1],tmp[1],i);
- tmp[0]:=char(i);
- end;
- NovellLogonName:=tmp;
- end;
-
- end.
-
- Then a test program which uses this unit ..
-
- program NovellTest;
-
- uses dos,novapi;
-
- begin
- writeln('Network Information');
- writeln('Logical id = ',NovellLogicalID);
- writeln('Physical id = ',NovellPhysicalID);
- writeln('Login name = ',NovellLogonName);
-
- end.
-
- Cheers, Ben
-
-