home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / NOVELL2.ZIP / NOVELL2.PAS
Encoding:
Pascal/Delphi Source File  |  1986-11-18  |  2.1 KB  |  84 lines

  1. program logged;
  2. (*
  3.        This program works with most current versions of novell netware
  4.        software.  It is designed to log a user on to the NETWORK using
  5.        msdos interrupts.
  6.        Written by:  Kip McClanahan
  7.                    9501 Bart Hollow Dr.
  8.                    Austin Tx, 78750
  9.        Feel free to ask any questions about the program.
  10.  
  11. *)
  12.  
  13.  
  14. type result = record case integer of
  15.                 1:(ax,bx,cx,dx,bp,si,di,ds,es,flags:integer);
  16.                 2:(al,ah,bl,bh,cl,ch,dl,dh:byte);
  17.               end;
  18.  
  19. var regs:result;
  20.     req:array [0..255] of byte;      {request packet}
  21.     rep:array [0..255] of byte;    {reply packet}
  22.     n,x,r,y,y1:integer;
  23.     name,pw:string [30];
  24.     ch:char;
  25.  
  26. begin
  27.   clrscr;
  28.   for r:=1 to 30 do name[r]:=' ';
  29.   write ('Enter user name:');
  30.   readln (name);
  31.   write ('enter pw:');
  32.   read (kbd,pw);
  33.   writeln;
  34.   y:=length(name);
  35.   y1:=length(pw);
  36.  
  37.   for r:=0 to 255 do rep[r]:=$00;
  38.   for r:=0 to 255 do req[r]:=$00;
  39.   regs.ds:=seg(req);            {req. buffer`s segment addr}
  40.   regs.si:=ofs(req);            {offset addr.}
  41.  
  42.   regs.es:=seg(rep);            {same as above for reply buffer}
  43.   regs.di:=ofs(rep);
  44.  
  45.   req[1]:=$00;        {high byte for length word}
  46.   req[2]:=0;       {command number}
  47.   req[3]:=y;     {name length}
  48.   x:=3;
  49.   for r:=1 to y do begin
  50.     x:=x+1;                      {put name into buffer}
  51.     n:=ord(copy(name,r,1));
  52.     req[x]:=n;
  53.     end;
  54.  x:=x+1;
  55.  req[x]:=y1;
  56.  for r:=1 to y1 do begin
  57.    x:=x+1;                           {...now the password}
  58.    n:=ord(copy(pw,r,1));
  59.    req[x]:=n;
  60.    end;
  61.   req[0]:=x;     {packet length}     {low byte for length word in buffer}
  62.  
  63.   rep[0]:=$ff;                       {reply buffer length}
  64.   rep[1]:=$00;
  65.  
  66.   regs.ah:=$e3;                      {netware function call}
  67.   MSDOS(regs);
  68.   IF REGS.AL <>0 THEN WRITELN ('ERROR - UNSUCCESSFUL LOGIN')
  69.    else begin
  70.      writeln ('Welcome to THE Network, ',name);
  71.      writeln ('Remember, you`re still in the login directory.');
  72.    end;
  73. end.
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.