View Full Version : Scsi Bus Scan functionality- some testing help wanted
Eagle
02-08-2006, 01:36 PM
Some time ago I created functionality to scan the systems Scsi Bus settings,
verify valid CDRom devices, get the assign drive letters, Device Name and the
actual Scsi bus port settings- ready for use with Burning Programs.
I added functionality to detect and filter out 'virtual drives'.
I would very much appreciate some testers for this,
refinement suggestions etc. USB drives testing would be great.
Many thanks in advance
Martin.
Daniel TM
02-08-2006, 02:05 PM
Congradulations! It worked perfectly on my PC. :yes
Eagle
02-08-2006, 03:33 PM
Good..keep it com'in folks when ya got the time...
filtering virtual drives - detection reliablity ...
Corey
02-08-2006, 03:46 PM
Seems to work here, it added only my burner drive to the list. :yes
Intrigued
02-08-2006, 04:03 PM
The project listed only my burner, but then I only have one drive installed on this laptop.
:yes
bobbie
02-08-2006, 05:07 PM
Found mine no problem see screenshot.
Eagle
02-09-2006, 03:24 AM
Hexellent..anyone with virtual drives..were these detected and Not populated in Combo box ? tks
Thanks for the testing so far folks :cool
Corey
02-09-2006, 04:33 AM
I just added a virtual drive (Alcohol 120, no reboot) and it didn't detect it. I'm not sure if that info is of any value but I figured I'd let you know. :yes
Eagle
02-09-2006, 04:45 AM
Yep, was the 'device' fully available to system before a reboot ?
(or did it 'make it' into the combobox ? ) tks for that
Corey
02-09-2006, 05:23 AM
Yes, you can use it without reboot. I'm not sure about "fully", there may be a difference between running before/after a reboot. I'll check later and let you know. :yes
Eagle
02-09-2006, 05:31 AM
TKS ..somethings up with the code..Not detecting latest daemons tools V4
either..the target hex values for virtual drives is correct..somethings up with
the bus port enumeration or similar in my code.. I'll get back when she's work'n (again) :)
That'll teach me to 'fix' what aint broke.
Eagle
02-09-2006, 07:40 AM
Failure to Identify 'Virtual CDR' devices fixed:
for retesting below v1.05 , tks
Eagle
02-09-2006, 02:56 PM
for those still interested ... :)
revamped device cycle enumeration: now in keeping with
valid system cdrom device number allocation.
Tightened device matching during Bus-scan cycle:
now matches device 'number' with Device target.
V1.1 .this finalises testing uploads, unless you find a bug.
tks again for your time.
Brett
02-09-2006, 03:48 PM
On my system I have a CD-RW/DVD reader combo (Dell installed) and a DVD-RW/CD-RW combo drive. Your app picks up the DVD-RW, but not the CD-RW. Attached are screenshots showing your app and what Nero detects for my system.
Eagle
02-09-2006, 04:01 PM
OK thks Brett, I think I know whats going on...boolean returns
may be exiting the cycling of devices.. I'll wack another CDR in my
test machine..
wack this in after code line 47:
Dialog.Message(nDevEnum, strDevname);
see if cycling properly.
more to do... (this app was work'n for mutliple valid devices - untill I decided to revamp it ) !
Eagle
02-09-2006, 08:03 PM
V1.2 .. should be solid now :yes
Additionally covers if a drive is added to system and not re-enumerated by The Os,
this is usually done upon Os Reboot - as drive numbering is re-assigned.
Corey
02-09-2006, 08:38 PM
Hmmm, still doesn't seem to detect the Alcohol 120% virtual drive...
Intrigued
02-09-2006, 08:45 PM
This updated version seems broken, as it does not see my CD burner now (it did in the first version).
:rolleyes
Eagle
02-09-2006, 09:02 PM
now this is getting wierd... I'll install Alcohol here and check its ID string.
The virtual drive detection is worthwhile spending the time on as Apps
like Nero dont appear to filter these out.
I'll revise the original work code and see if there are a few Os specific influences.
(basic enumeration is the same though)
I'm testing on W2k, XP and 2K3 on 3 different machines..seemed to be ok.
bit of a chore this one ;) we'll nail it. Tks
Corey
02-09-2006, 09:14 PM
FWIW I'm on XP. My machine has only one physical CD/DVD drive. (which was displayed properly in both this as well as the older version) :yes
Eagle
02-09-2006, 09:32 PM
OK..virtual drive filtering is 'silent' ..just not included in the Combobox.
if a virtual device is showing in the combo drop down, then yes it is failing to filter it out.
Corey
02-09-2006, 09:35 PM
Virtual drive doesn't show, just the physical. :yes
Eagle
02-09-2006, 09:41 PM
That's good news ... :yes tks
Eagle
02-10-2006, 01:21 AM
Intrigued ..try this minor tweak, see if sorts it...
Eagle
02-11-2006, 11:30 AM
Is anyone having any 'device detection' issues,
cdrom drive-s are not listed in the combobox ?
I would appreciate feedback if so,
tks.
Intrigued
02-11-2006, 12:16 PM
BTW, I thought I had posted a reply, d'oh.
This updated version is still not showing my CD-R/RW burner, as the original project file did.
Eagle
02-13-2006, 09:05 AM
Yet another version: v1.3
added workaround for a Valid Device not being Detected-Populated.
(covers the scenario if a valid device not in the CdRom 'Service List').
btw: Nero of course Does filter out Virtual devices(apart from its own)
Intrigued
02-13-2006, 06:23 PM
With and without a CD-ROM in the device, the AMS app. did not see the burner.
Eagle
02-14-2006, 11:27 PM
still work'n on this one, your system seems like a good test for
concept-reliablity for this type of functionality Intrigued :yes
things are simpler if the actual bus scan -port coms function is not performed,
as is not needed by most commercial Burn proggies to call a device via commands,
only the device name or the Os allocated Device letter matching is required.
So far the only way I can replicate your screencap (not showing anything)
if is the device 'freindly name' is not being detected properly.
If no devices detected(for any reason) the combobox should be
populated only with the: " - No Valid Devices were found -".
Was working at some point for your device, so would like to nail this one
Challenge at present is latest coding format appears to be working on tests at this end.
Query Intrigued: is your device a USB device ?
If desired I'll post a version that displays debug dialogs throughout the functions
to see where it could be falling over-broken.
tks for your time-patience.
Eagle,
Works great on all my boxes...good job!
Dez
Intrigued
02-15-2006, 12:51 PM
Eagle, ya, it did work originally. The burner is internal to this "non-name" laptop. If you want to throw some custom debugging information/dialogs in and have me try such I can.
Eagle
02-15-2006, 01:45 PM
OK version v1.4: made changes to function returns
added functionality to cover correct 'bus port com string' allocation
if devices with same 'friendlyname' or model are cycled.
two build versions: no debug and with debug(code line dialogs)
thks DEZ ! and thanks once again I-MAN !
dfahey
02-15-2006, 02:48 PM
Eagle, i have your script and they all work on my Sony T170 laptop with a built in DVDRW. I am interested in your script as I need a script that will determine all of the users physically attached media device (i.e. hard drives, usb drives). Will your script (with tweaking) work with all ide devices as well?
Drew
Eagle
02-15-2006, 03:01 PM
Hi Drew..that's good to know v1.4 is behaving itself, so far :yes
you can do the same stuff for all device types you wish to target
(can also be handy for hardware ID - encrytpion stuff too)
you may need to watch out for 'device id' name: hex to ascii conversion
as the current string.format function does not handle 'all' possible hex values
properly, so far its proving ok for the standard OS enumeration entries when
used only for that purpose..
The way it works currently is set the device type you wish to enumerate via the Drives.Enumerate action
then you target that device's enumerator string to convert, that gives you the IDE,Scsi,Usb path
in the registry to go from there.
Have a look at the similar main subkeys in your registry eg: below shows all current hard-disk entries
(sata drives are also enumerated as below)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\P CIIDE\IDEChannel]
also have a look into STORAGE
hth
dfahey
02-15-2006, 03:12 PM
Eagle, great! thanks for the pointers I am looking into it now. Great script by the way.
Drew
Eagle
02-15-2006, 03:20 PM
Cool, Non 'Storage device class' devices such as USB printers,modems etc
are Not enumerated in DOSDEVICES Key, so these have separate subkeys
in the USB main key, would need to manually cycle those subkeys instead...
dfahey
02-15-2006, 03:27 PM
In your script you look at:
local MntDev_SvcEnum = "SYSTEM\\CurrentControlSet\\Services\\Cdrom\\Enum\\";
local MntDev_Enum = "SYSTEM\\CurrentControlSet\\Enum\\";
and compare the numbers later on. So I would need to do the same but which service would I compare to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\PCIIde\Enum
Does that make sense?
Drew
Eagle
02-15-2006, 03:46 PM
That seems correct to me, the 'Service keys' for devices are the current
valid enumerated devices by the Os , the other Main Key can also have
devices that have been removed. The OS does not remove the invalid
keys, so the Service\Enum is the place to start for current Valid Devices.
hth ..explore currentcontrolset001 and 002 these can have entries in NT OS's
which can reveal wehter there is security on a device-login user access etc.
can't remember off hand exactly where they live..well worth a full explore
of all possible device class entries. As we know this is all pure registry
proccessing, so is only as good as the Os registry health, if you are into
actual prgramming the IO_CNTRL type programming I believe is where its
done via the OS kernel32.dll and others. I don't have those skills at present :)
dfahey
02-15-2006, 03:56 PM
I am with you on programming skillz ;) . Long ago were the days I did much programming. Now it is just scripting. I am going over the code and that is the right REG key but for some reason it is not decoding right. I can seem to get the code to work right. Of course I have only just begun to mess with it:lol You would happen to have the code lying around that looks for device types 2 and 3 would ya:D ???
All I want to do is scan a system and tell me what are the current device (which that is easy) however what I need is to tell me the device number. For instance if you have one hard drive but it is partitioned into 3 logical partitions you would have (C:\, D:\, E:\ and F:\ (one extra for the CD)). What is that deivce number? The first IDE hard drive will be 0 but what if I plug in a usb key/hard drive, etc I would like to know what that physical device number is. You code appears to do just that albiet for cdrom devices.
Thanks for the help.
Drew
Eagle
02-15-2006, 04:06 PM
yep just cycle with the resulting drive.enumerate table
..anything in that table should be assigned a drive letter
and targetted in the DOSDEVICES Main Key as the functions in the code do.
Simple as getting the device letter from the table function(as it does now)
no need to do the scanbus thing if not needed.
There is a key in the registry which reveals the system partition information,
again can't remember off hand. Depends how deep into it you need to go
for your purposes, experiment, you'll acheive what you want for your App.
dfahey
02-15-2006, 04:11 PM
Answered my own question. Thanks
Intrigued
02-15-2006, 06:48 PM
It works good for me now Eagle.
:yes
Corey
02-15-2006, 07:48 PM
It works good for me now Eagle.
Nice job, I like the way you stuck to it and got-r-done. Tenacious programmers rule. :D
Eagle
02-15-2006, 09:44 PM
Thks for your Help too Corey
grab that thing by the 'talons', honour all aspects involved with it.
Bit of a saga (just another chunk of Lua is all) glad its proving a worthwhile
concept.
(for hard-disk 'devicename' enumeration as it turns out, things are a little different).
can be done, however wrote the code for CDR devices-purposes specifically.
if someone would like to revamp the hex conversion function to cater for
all hex value types, that would be much appreciated :yes
Many thanks to those that spent the time testing the basic functionality :cool
Intrigued
02-16-2006, 11:46 AM
For sure... Eagle-is-a-soaring now!
:D
Eagle
02-28-2006, 10:58 AM
here's an improved HextoASCII function
gets around any possible endless loop issues and
allows for some 'hex type' -char filtering.
(still limited by the string.format func though)
--SHEXtoAscii
function HEXCYCLE(strHex)
local strHexConv = "";
if strHex then
local dat = String.Replace(strHex, " ", "", false);
--local vchars = "[%w%p%s]";
local vchars = "."; --all types
local pat = string.rep(vchars, 2);
for w in string.gfind(dat, pat) do
strHexConv = String.Concat(strHexConv, string.format("%c", tonumber(w, 16)..""));
end
end
return strHexConv;
end
--EHEXtoAscii
give it a test drive if ya want...
Intrigued
02-28-2006, 05:58 PM
Hardy Ho'!
HEX'cellent my friend! The Eagle has soared!
;)
Daniel TM
03-01-2006, 02:12 PM
I tested BusScan_V1.4_Debug_TestProject and it populates my drive in the combobox without any problems but as soon as I open the application it gives me many dialogs with detailed information about my drive (I only have a DVD Burner) and once all dialogs are displayed I get a bunch of dialogs giving me detailed information on my virtual drive (only the DVD Burner is populated in the combobox).
Eagle
03-02-2006, 03:26 AM
tks for the feedback Daniel TM, yes for the debug version only:
I could have included an additional dialog to confirm a virtual device
was detected and was Not to be added to the combobox.
I left that dialog out for virtual drives...;)
Main point of the debug dialogs was to detect if 'real physical device'
detection routines were failing and at which stage in the functions..
(as in I-Man's device detection issue..which was resolved in v1.4)
the revamped hextoascii function (above), I found, is a bit quicker too
(an exercise for me to utilise a bit more 'real lua' coding)
Eagle
03-11-2006, 03:50 PM
Version 1.5 ...
added: CDR device 'Firmware version' string to display if desired
mod:changed HextoAscii function to the revamped code format
fix: covers if 'bus identifier' string not present for a scsi bus port
Corey
03-11-2006, 03:57 PM
I have to give you top marks for sticktoitiveness Eagle. :yes
Eagle
03-11-2006, 04:04 PM
yeah, a tweak here a fix there and so it goes... :)
Corey
03-11-2006, 04:05 PM
Next thing you kow it's a full blown conga line. :D
Eagle
03-11-2006, 04:07 PM
ayyee Caaaaaaarrrrrrruuuuuuuuummmmmmmbbbbbbaaaaa :lol
sasuky
05-22-2006, 10:26 AM
hi for all...
i try to use CDRom device scan to check if the "_SourceDrive" virtual or not and Exit application if it virtual can u help me Please...
thank you.
Hi Eagle,
This is a great utility! This is such great timing! I have been working on a menu front-end system for our customers (support tool) and I was looking to try and get the device names for the CD/DVD drives. See the attached screenshot.
We are set to release our menu sometime this week, and if you like and with your permission, I can test it with our hundreds of customers who will be using our application.
I am ok if you don't want to give this out, or have it used elsewhere. :yes
Eagle
05-23-2006, 06:36 AM
Yes Tek, by all means use,modify it any way you see fit, royalty free :lol
all the best with your Software too,
feedback if issues with device detection would be hexellent, thks. :yes
Haha ok great. I will incorporate the code from your latest version and report back any problem. Thanks again for creating this!
Eagle
05-23-2006, 11:23 AM
Sasuky, try this..only tested with Daemon tools v4.x virtual drives present.
import the attached project, and publish to Iso format, mount the Iso, hth a little.
sasuky
05-23-2006, 01:05 PM
Dear Eagle i tested on Alcohol 120% virtual drive and virtual CD but did not work!!!!
sasuky
05-24-2006, 05:25 AM
Dear Eagle i downloaded Daemon tools yasterday v 4,03 HE and tested your example aslo did not work....!!!!!
Eagle
05-24-2006, 07:28 AM
Ok, this version validates Physical drives(filters out virtual CDR drives) to a 'validated CDR devs table.
if the _SourceDrive is not one that is in the created 'validated CDR device' table,.
then will exit the APP.
So by its nature, use this version only if you wish to
verify is running from CD\DVD Media on a 'real' CDR Device..
Eagle
05-24-2006, 08:23 AM
..so 'virtual_devicev1.1.apz' will not accept any 'run from' location other
than a validated CDR Device, just to be clear.
So if you build to hard-disk option and run it, will exit.
Build to Iso and mount in virtual drive, should now exit reliably.
Burn to test Media, to check will continue to run :yes
sasuky
05-24-2006, 09:10 AM
Woooooooow
Eagle YOU ARE THE MAN.....
it,s work perfectly.
thank you.
sasuky
06-13-2006, 02:17 PM
Dear Eagle can you please convert your function code to delphi.
Please....
Eagle
06-16-2006, 08:43 PM
I have no experience in Delphi programming ... there is bound to be some
delphi snippets for scsi scan functionality on good 'ol google ;)
goukilord10
10-28-2007, 12:46 PM
burned to a cd-rw using widows and put it in my primary DVD-RW drive (E)
its fine but when i put it in my CD+-RW drive (F) it exited telling its a virtual drive while it real one...
goukilord10
10-28-2007, 02:16 PM
(where the edit button go :huh)
ok i tested all the above releases of you project and none detected my second F drive.
in the debug BusScan 1.4 Debug app i get this for the F drive
Dialog Title : 92 Device Value Found 'freindlyName'
Message : Device not found in CdRom 'Service List'
usernameCasper
11-03-2007, 12:28 PM
Very nice work Eagle,
BusScan V.1.4 worked for me, I installed a virtual drive for this testing purpose.
It detected my real device and not the virtual one.
Keep up the good work :yes
Kind regards,
Casper
Eagle
11-06-2007, 09:27 AM
I may have another look - revamp of the code
(it is probably 'over-coded' as it is ;)
I would not rely on the existing versions to capture all virtual devices.
(some are now using a 'removable device' method to register with the Os)
and appears not all real cdrom devices are always being detected in all systems,
I would put that down to a bit of buggy code.
no promises, I'll post another version if I can manage it sometime.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.