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

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

Program TestBind;
Uses
TPCrt,
TPString, NWCommon,
Bindery;
Var
AccessLevel : Byte;
ObjectID : Byte4;
Ret : Byte;
ObjectType : Word;
ObjectName : String48;
ObjFlag, ObjSecu, ObjHasP : Byte;
ResStr : String[80];
Ind,Ind1 : Byte;
WBuf : Word;
Label
OnceMore, ThatsAll;
Begin
ClrScr;
WriteLn('(C) 1991. CellSoft&Hard. by Boulyguin O. Russia. Moscow. (095)-284-3631.');
WriteLn('Bindery Objects Scanning.');
WriteLn;
Ret := GetBinderyAccessLevel(AccessLevel,ObjectID);
Case Ret Of
$00 : WriteLn('Bindery access successful');
else WriteLn('Bindery access error, return=',HexB(Ret),'h');
End;
WriteLn('Access level =',BinaryB(AccessLevel),'b, ObjectID=',
HexB(ObjectID[1]),HexB(ObjectID[2]),
HexB(ObjectID[3]),HexB(ObjectID[4]),'h.');

WriteLn;
WriteLn('Press any key to continue ...');
Repeat Until KeyPressed;
WBuf := ReadKeyWord;
WriteLn;
For Ind := 1 To 4 Do ObjectID[Ind] := $FF;

Ind1 := 1;
Repeat
ObjectType := Wild;
ObjectName := '*';
If (Ind1 Mod 12) = 0 Then Begin
WriteLn('Press any key to continue ...');
Repeat Until KeyPressed;
WBuf := ReadKeyWord;
End;
Inc(Ind1);
Ret := ScanBinderyObject (ObjectID, ObjectType, ObjectName,
ObjFlag, ObjSecu, ObjHasP);
Case Ret Of
Successful : ResStr := 'Successful';
ServerOutOfMemory : ResStr := 'Server Out of Memory';
InvalidName : ResStr := 'Invalid Name';
NoSuchObject : ResStr := 'No Such Object';
ServerBinderyLocked : ResStr := 'Server Bindery locked';
BinderyFailure : ResStr := 'Bindery Failure';
End;
If (Ret <> Successful) And (Ret <> NoSuchObject) Then
Write('Search in Bindery is not successful: ',ResStr,'.')
Else If (Ret <> NoSuchObject) Then Begin
Dec(ObjectName[0]);
Write('Object "',ObjectName,'" with ID =',
HexB(ObjectID[1]),HexB(ObjectID[2]),
HexB(ObjectID[3]),HexB(ObjectID[4]),
' has type ="');
Case ObjectType Of
Unknown : ResStr := 'Unknown';
User : ResStr := 'User';
UserGroup : ResStr := 'UserGroup';
PrintQueue : ResStr := 'PrintQueue';
FileServer : ResStr := 'FileServer';
JobServer : ResStr := 'JobServer';
Gateway : ResStr := 'Gateway';
PrintServer : ResStr := 'PrintServer';
ArchiveQueue : ResStr := 'ArchiveQueue';
ArchiveServer : ResStr := 'ArchiveServer';
JobQueue : ResStr := 'JobQueue';
Administration : ResStr := 'Administration';
RemoteBridgeServer : ResStr := 'RemoteBridgeServer';
AdvertisingPrinterServer : ResStr := 'AdvertisingPrinterServer';
End;
WriteLn(ResStr,'".');
Case ObjFlag Of
$00 : ResStr := 'STATIC ';
$FF : ResStr := 'DINAMIC';
End;
Write('Is ',ResStr,', ');
Case (ObjSecu and $0F) Of
$00 : ResStr := ' Anyone';
$01 : ResStr := 'anyone Logged';
$02 : ResStr := 'anyone Object';
$03 : ResStr := ' Supervisor';
$04 : ResStr := 'NetWare only';
End;
Write(ResStr,' can read, ');
Case (ObjSecu and $F0) Shr 4 Of
$00 : ResStr := ' Anyone';
$01 : ResStr := 'anyone Logged';
$02 : ResStr := 'anyone Object';
$03 : ResStr := ' Supervisor';
$04 : ResStr := 'NetWare only';
End;
WriteLn(ResStr,' can write to the object. ');
Case ObjHasP Of
$00 : ResStr := 'Has no properties.';
$FF : ResStr := 'Has properties:';
End;
{
WriteLn(ResStr);
}
End;
Until Ret = NoSuchObject;
End.