home *** CD-ROM | disk | FTP | other *** search
- {
- Test program for NETBIND - Dumps all visible objects in the Bindery
-
- by Richard S. Sadowsky
-
- Please address questions and comments about this unit to ALL in section 6 of
- the PCVENB forum on Compuserve.
- }
-
- program TestBind;
-
- uses
- Dos,
- OpCrt,
- OpDos,
- OpString,
- NetWare,
- NetBind,
- NetQue;
-
- procedure DisplayObject(ObjType : Word; ObjName : ObjNameStr;
- ObjID : LongInt; ObjFlag : Byte;
- ObjSec : Byte; HasProp : Boolean);
-
- begin
- WriteLn('Object Type = ',HexW(ObjType));
- WriteLn('Object Name = ',ObjName);
- WriteLn('Object ID = ',HexL(ObjID));
- WriteLn('Object Flag = ',HexB(ObjFlag));
- WriteLn('Object Security = ',HexB(ObjSec));
- WriteLn('Has Properties = ',HasProp);
- end;
-
- procedure DisplayProperty(PropName : PropertyStr;
- PropFlags,PropSec : Byte;
- HasValue : Boolean);
- begin
- Write('Property: ',PropName);
- Write(' flags: ',HexB(PropFlags));
- WriteLn(' security: ',HexB(PropSec),' HasValue: ',HasValue);
- end;
-
- var
- ObjectID,
- Sequence : LongInt;
- ObjectType : Word;
- ObjectName : ObjNameStr;
- PropName : PropertyStr;
- Result : Byte;
- ObjectFlag,
- ObjectSecurity,
- PropFlag,
- PropSec : Byte;
-
- HasProperties,
- HasValue,
- Done : Boolean;
-
- begin
- Assign(Output,'');
- Rewrite(Output);
-
- ObjectID := -1;
- repeat
- ObjectType := bindWild;
- ObjectName := '*';
- Result := ScanObject(ObjectType,ObjectName,ObjectID,ObjectFlag,
- ObjectSecurity,HasProperties);
- Done := (Result <> 0);
- if not Done then begin
- DisplayObject(ObjectType,ObjectName,ObjectID,ObjectFlag,
- ObjectSecurity,HasProperties);
- Sequence := -1;
- while HasProperties do begin
- PropName := '*';
- Result := ScanProperty(ObjectType,ObjectName,Sequence,PropName,
- PropFlag,PropSec,HasValue,HasProperties);
- if Result = 0 then
- DisplayProperty(PropName,PropFlag,PropSec,HasValue);
- end;
- if HandleIsConsole(TextRec(Output).Handle) then
- Done := ReadKey in [^C,^[];
- WriteLn;
- end;
- until Done;
- end.