[INHERIT('sys$library:starlet', 'sys$library:pascal$lib_routines')] PROGRAM Use_Device_Scan(OUTPUT); TYPE Item_List_Cell = RECORD CASE INTEGER OF 1: ( { Normal Cell } Buffer_Length : [WORD] 0..65535; Item_Code : [WORD] 0..65535; Buffer_Addr : UNSIGNED; Return_Addr : UNSIGNED ); 2:( { Terminator } Terminator : UNSIGNED ); END; Item_List_Template(Count:INTEGER) = ARRAY [1..Count] OF Item_List_Cell; VAR Item_List : Item_List_Template(2); Device_Name : VARYING [32] OF CHAR; Devclass : [VOLATILE] INTEGER; Context : [QUAD] RECORD L1,L2:INTEGER END; Status : INTEGER; IOSB : ARRAY [1..2] OF INTEGER; BEGIN { Set up item list asking for all disks. The item list wants } { an address of a longword containing the device code to scan } { for. Make sure to use the VOLATILE attribute since the } { to $device_scan will reference this variable. } Devclass := DC$_Disk; Context := ZERO; { Scan on device class } Item_List[1].Buffer_Length := SIZE(Devclass); Item_List[1].Item_Code := DVS$_Devclass; Item_List[1].Buffer_Addr := IADDRESS(Devclass); Item_List[1].Return_Addr := 0; { Terminate the item list } Item_List[2].Terminator := 0; REPEAT Status := $device_scan( Device_Name.Body, Device_Name.Length, '*', Item_List, Context); IF ODD(Status) THEN WRITELN('Device Name: ',Device_Name) ELSE IF Status <> SS$_NOMOREDEV THEN LIB$Stop(Status); UNTIL Status = SS$_NOMOREDEV; END.