Welcome, Guest. Please login or register.

Author Topic: Identifying device type possible ?  (Read 3827 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Identifying device type possible ?
« on: June 24, 2011, 12:50:59 AM »
I want to identify sana drivers from a requester. In my case the reason is that I'm presenting the user with a requester to choose the sana device he wants to use with my program. I found out that if one navigates through the directory tree (on the requester) and chooses serial.device it actually opens with a sana io structure! Maybe there are other non sana devices that will open, haven't tried. But I think the problem is clear, opening a device with another device's io structure might cause problems, maybe the system could even crash.
Looking at a device struct it seems that there is no way to identify the device type or is there ?
Any thoughts on this ?
Maybe I shouldn't even care, it's just that I realized this problem might occur...
« Last Edit: June 24, 2011, 12:54:35 AM by Jose »
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Identifying device type possible ?
« Reply #1 on: June 24, 2011, 07:04:22 PM »
Ok, just for the record, I wrote a more precise error display routine, identifying what's going on, and fiddled with it with a few more devices. My findings are that the behavior is different from device to device. Some won't open at all with my sana io request, others will open but report error when I send an io request, others report an error outside the defined sana errors (atapi.device IIRC), and one (serial.device) even accepted the request and started waiting (would probably get error if I had something connected to the serial port though).
Bottom line, they're interpreting the io request as if it were they're own and sometimes values are accepted.
« Last Edit: June 24, 2011, 07:06:40 PM by Jose »
\\"We made Amiga, they {bleep}ed it up\\"