home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / BTF521-3.ZIP / NETWARE.LZH / TESTBIND.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-05-03  |  2.3 KB  |  87 lines

  1. {
  2.   Test program for NETBIND - Dumps all visible objects in the Bindery
  3.  
  4.   by Richard S. Sadowsky
  5.  
  6.   Please address questions and comments about this unit to ALL in section 6 of
  7.   the PCVENB forum on Compuserve.
  8. }
  9.  
  10. program TestBind;
  11.  
  12. uses
  13.   Dos,
  14.   OpCrt,
  15.   OpDos,
  16.   OpString,
  17.   NetWare,
  18.   NetBind,
  19.   NetQue;
  20.  
  21. procedure DisplayObject(ObjType : Word; ObjName : ObjNameStr;
  22.                         ObjID : LongInt; ObjFlag : Byte;
  23.                         ObjSec : Byte; HasProp : Boolean);
  24.  
  25. begin
  26.   WriteLn('Object Type         = ',HexW(ObjType));
  27.   WriteLn('Object Name         = ',ObjName);
  28.   WriteLn('Object ID           = ',HexL(ObjID));
  29.   WriteLn('Object Flag         = ',HexB(ObjFlag));
  30.   WriteLn('Object Security     = ',HexB(ObjSec));
  31.   WriteLn('Has Properties      = ',HasProp);
  32. end;
  33.  
  34. procedure DisplayProperty(PropName : PropertyStr;
  35.                           PropFlags,PropSec : Byte;
  36.                           HasValue : Boolean);
  37. begin
  38.   Write('Property: ',PropName);
  39.   Write('  flags: ',HexB(PropFlags));
  40.   WriteLn('  security: ',HexB(PropSec),'  HasValue: ',HasValue);
  41. end;
  42.  
  43. var
  44.   ObjectID,
  45.   Sequence       : LongInt;
  46.   ObjectType     : Word;
  47.   ObjectName     : ObjNameStr;
  48.   PropName       : PropertyStr;
  49.   Result         : Byte;
  50.   ObjectFlag,
  51.   ObjectSecurity,
  52.   PropFlag,
  53.   PropSec        : Byte;
  54.  
  55.   HasProperties,
  56.   HasValue,
  57.   Done           : Boolean;
  58.  
  59. begin
  60.   Assign(Output,'');
  61.   Rewrite(Output);
  62.  
  63.   ObjectID := -1;
  64.   repeat
  65.     ObjectType := bindWild;
  66.     ObjectName := '*';
  67.     Result := ScanObject(ObjectType,ObjectName,ObjectID,ObjectFlag,
  68.                          ObjectSecurity,HasProperties);
  69.     Done := (Result <> 0);
  70.     if not Done then begin
  71.       DisplayObject(ObjectType,ObjectName,ObjectID,ObjectFlag,
  72.                     ObjectSecurity,HasProperties);
  73.       Sequence := -1;
  74.       while HasProperties do begin
  75.         PropName := '*';
  76.         Result := ScanProperty(ObjectType,ObjectName,Sequence,PropName,
  77.                                PropFlag,PropSec,HasValue,HasProperties);
  78.         if Result = 0 then
  79.           DisplayProperty(PropName,PropFlag,PropSec,HasValue);
  80.       end;
  81.       if HandleIsConsole(TextRec(Output).Handle) then
  82.         Done := ReadKey in [^C,^[];
  83.       WriteLn;
  84.     end;
  85.   until Done;
  86. end.
  87.