Category : Network Files
Archive   : TSTBIND.ZIP
Filename : BINDERY.PAS

 
Output of file : BINDERY.PAS contained in archive : TSTBIND.ZIP

{
ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͸
³ ³
³ NW Bindery low-level interface. ³
³ (C) Copyright 1991 by Boulyguin Oleg ³
³ CellSoft&Hard Group, Moscow, USSR. ³
³ All rihgts reserved. ³
³ Tel. (095)-371-0737 (home), (095)-143-8037 (office) ³
³ Comments from NetWare System Calls. (C) 1989 Novell,Inc.³
³ ³
ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ;
}
Unit Bindery;
Interface
Uses
{
Borland Turbo Pascal 5.50 (6.0) and
Turbo Professional 5.09 (5.11) are used
}
Dos,TPDos,TPCrt,TPInline,TPString,
NWCommon
;

Const
Successful = $00;
ServerOutOfMemory = $96;
InvalidName = $EF;
InvalidBindarySecurity = $F1;
NoSuchProperty = $FB;
NoSuchObject = $FC;
ServerBinderyLocked = $FE;
BinderyFailure = $FF;

Unknown {: Word} = $00;
User {: Word} = $01;
UserGroup {: Word} = $02;
PrintQueue {: Word} = $03;
FileServer {: Word} = $04;
JobServer {: Word} = $05;
Gateway {: Word} = $06;
PrintServer {: Word} = $07;
ArchiveQueue {: Word} = $08;
ArchiveServer {: Word} = $09;
JobQueue {: Word} = $0A;
Administration {: Word} = $0B;
RemoteBridgeServer {: Word} = $24; { I`ve never seen this
value on the remote bridge server }
_RemoteBridgeServer {: Word} = $26; { ussually }
AdvertisingPrinterServer {: Word} = $47;
Wild {: Word} = $FFFF;

Function CloseBindery : Byte;

Function OpenBindery : Byte;

Function GetBinderyAccessLevel ( Var AccessLevel : Byte;
Var ObjectID : Byte4) : Byte;

Function ScanBinderyObject ( Var ObjectID : Byte4;
Var ObjectType : Word;
Var ObjectName : String48;
Var ObjFlag, ObjSecu, ObjHasP : Byte) : Byte;
{ Input : ObjectID = Last Object ID (To begin Scan set $FFFFFFFF,
than take it from previos Output);
ObjectType = particular or all (Wild) object type;
ObjectName = (*) and (?) can be used;
Output: ObjectID,ObjectType,ObjectName,ObjFlag,ObjSecurity,
ObjhasProperties.
}

Implementation

Function CloseBindery : Byte;
Begin
With NovRegs Do Begin
ReqBufLength := 3-2;
RepBufLength := 0;
RequestBuffer[2] := $44;
DS := Seg(RequestBuffer); SI := Ofs(RequestBuffer);
ES := Seg(ReplyBuffer); DI := Ofs(ReplyBuffer);
AH := $E3;
MsDos (NovRegs);
If RepBufLength <> 0 Then
WriteLn ('Close bindery error, Reply=',HexW(RepBufLength),'h');
CloseBindery := AL;
End;
End;

Function OpenBindery : Byte;
Begin
With NovRegs Do Begin
ReqBufLength := 3-2;
RepBufLength := 0;
RequestBuffer[2] := $45;
DS := Seg(RequestBuffer); SI := Ofs(RequestBuffer);
ES := Seg(ReplyBuffer); DI := Ofs(ReplyBuffer);
AH := $E3;
MsDos (NovRegs);
If RepBufLength <> 0 Then
WriteLn ('Open bindery error, Reply=',HexW(RepBufLength),'h');
OpenBindery := AL;
End;
End;

Function GetBinderyAccessLevel (Var AccessLevel : Byte;
Var ObjectID : Byte4) : Byte;
Begin
With NovRegs Do Begin
ReqBufLength := 3-2;
RepBufLength := 7-2;
RequestBuffer[2] := $46;
DS := Seg(RequestBuffer); SI := Ofs(RequestBuffer);
ES := Seg(ReplyBuffer); DI := Ofs(ReplyBuffer);
AH := $E3;
MsDos (NovRegs);
GetBinderyAccessLevel := AL;
AccessLevel := Byte(Ptr(ES,DI+2)^);
Move(Ptr(ES,DI+3)^,ObjectID,4);
End;
End;

Function ScanBinderyObject ( Var ObjectID : Byte4;
Var ObjectType : Word;
Var ObjectName : String48;
Var ObjFlag, ObjSecu, ObjHasP : Byte) : Byte;
Var
Ind : Byte;
Begin
With NovRegs Do Begin
Move(ObjectID,RequestBuffer[3],4);
Move(ObjectType,RequestBuffer[7],2);
Move(ObjectName,RequestBuffer[9],Byte(ObjectName[0])+1);
ReqBufLength := 10+Byte(ObjectName[0])-2;
RepBufLength := 59-2;
RequestBuffer[2] := $37;
DS := Seg(RequestBuffer); SI := Ofs(RequestBuffer);
ES := Seg(ReplyBuffer); DI := Ofs(ReplyBuffer);
AH := $E3;
MsDos (NovRegs);
Move(ReplyBuffer[2],ObjectID,4);
Move(ReplyBuffer[6],ObjectType,2);
ObjectType := Swap(ObjectType);
Move(ReplyBuffer[8],ObjectName[1],48);
Ind := 1;
Repeat Inc(Ind);
Until ObjectName[Ind] = #0;
ObjectName[0] := Char(Ind);
ObjFlag := ReplyBuffer[8+48];
ObjSecu := ReplyBuffer[8+1+48];
ObjHasP := ReplyBuffer[8+2+48];
ScanBinderyObject := AL;
End;
End;

End.