Hi, An easy way or DOS function that show me status of DEVICES (ONLY READ, R/W,...)?
That piece of code shows me all devices, but I can't find the mode to show if such devices are R/W or ONLY_READ.
dn = (struct DeviceNode *)IDOS->LockDosList(flags); while( (dn = (struct DeviceNode *)IDOS->NextDosEntry( (struct DosList *)dn, flags)) ) { if(dn->dn_Port != NULL) { // if( !strcmp((char *)BADDR(dn->dn_Name)+1, "RAM") ) // Skip RAM Disk // continue; IDOS->Printf("%s\n",(char *)BADDR(dn->dn_Name)+1 );
TIA
IDOS->Info() should be able to tell you.
@Thomas
THX just used GetDiskInfo (as sdk tells is better to use it instead of Info() ) well it seems to works :-) but find something "strange..
..if I protect my main volume SDH0 CD0 also gets portected ¿:-P
SHELL/CLI output:
#a.out (normal)
Flushed/Inhibitted SDH0
Flushed/Inhibitted CD0
Flushed/Inhibitted SDH1
Flushed/Inhibitted SDH2
Flushed/Inhibitted SDH3
Flushed/Inhibitted SDH5
Flushed/Inhibitted SDH7
Flushed/Inhibitted SDH8
Flushed/Inhibitted ENV
Flushed/Inhibitted TEXTCLIP
#a.out (using RAWBInfo or Lock cmd and locking/protecting only SDH0)
Flushed/Inhibitted SDH1
Flushed/Inhibitted SDH2
Flushed/Inhibitted SDH3
Flushed/Inhibitted SDH5
Flushed/Inhibitted SDH7
Flushed/Inhibitted SDH8
Flushed/Inhibitted ENV
Flushed/Inhibitted TEXTCLIP
¿any idea? Not a big problem, just curiosity :-)
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
You don't check 'result'. Probably GetDiskInfo for CD0 fails, because there is no disk in the drive. You just repeat the output from the previous call (which was SDH0).
result - (zero or non-zero)
The result will be zero for failure, or non-zero for
success, the non-zero success value represents the
number of tags passed to this function as parameters.
result as SDK says, only shows/has number of tags passed:
..
#lock sdh0: on
LOCK: Unidad "sdh0:" bloqueada.
#a.out
SDH0=80 [res=2]
SDH0 is locked/protected
CD0=80 [res=2]
CD0 is locked/protected
SDH1=82 [res=2]
Flushed/Inhibitted SDH1
SDH2=82 [res=2]
Flushed/Inhibitted SDH2
..
Inserting a DVD/CD on CD0 drive (and unlocking SDH0):
#a.out
SDH0=82 [res=2]
Flushed/Inhibitted SDH0
CD0=80 [res=2]
CD0 is locked/protected
SDH1=82 [res=2]
Flushed/Inhibitted SDH1
..
So maybe I should check for ID_NO_DISK_PRESENT too and skip such devices?
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
Changed from using
to use
But my problem now is how from VOLUME (Workbench) obtain/get DEVICE (DH0) (and then the msg port to the handler process.) any function that performs such "search"?
TIA
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
Found how-to :-) using (after AllocDosObjectTags):
I can obtain the Handler Port (dp->dvp_Port)
THX to SFSobject.c by Martin Steigerwald.
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P