 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Martin Guest
|
Posted: Tue May 24, 2005 12:13 pm Post subject: How to read a sector from a drive |
|
|
Hello,
does anybody knows how to read a sector from a drive?
- sectors from data area, directory, boot sector, partition table
- all drives (USB for example Flash Cards)
- How to identify a drive (Disk, Harddisk, Flash, ...)
Thanks
Martin
|
|
| Back to top |
|
 |
Danzer Guest
|
|
| Back to top |
|
 |
Andrue Cope [TeamB] Guest
|
Posted: Wed May 25, 2005 8:58 am Post subject: Re: How to read a sector from a drive |
|
|
Martin,
| Quote: | does anybody knows how to read a sector from a drive?
|
Yes, thanks. Our engineers use my code to that 24/7(ish) :)
| Quote: | - sectors from data area, directory, boot sector, partition table
|
Yup - but you have to know how to determine which sectors are being
used to store which areas. It's also up to you to work out how to use
the information (metadata) contained in those sectors to retrieve the
actual data. Again this is something I have extensive knowledge of.
It's not rocket science and these days most of it is documented quite
well on the web. Depending on why you need it it can be challenging.
Anyone can follow structures when everything is fine and valid but
following structures when any one of them could be full of gibberish is
another matter.
| Quote: | - all drives (USB for example Flash Cards)
|
Ye..es. Sorta. Well we can do that but unfortunately whereas with Unix
you can just search dev for block devices under Windows it's a little
more..um..complicated. Or is that complex? It involves getting friendly
with the registry and the device enumeration API. Either of those can
be a serious threat to your sanity :-/
| Quote: | - How to identify a drive (Disk, Harddisk, Flash, ...)
|
That's a little more involved and requires the use of DeviceIoControl():
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/b
ase/deviceiocontrol.asp
or
http://tinyurl.com/3wlwj
Specifically IOCTL_SCSI_GET_INQUIRY_DATA
Note that since not all disks are actually SCSI disks they don't all
return a 100% correct INQUIRY block (and some don't respond at all some
of the time). It all depends how much effort the device driver puts
into making up the contents.
BTW:This is not the correct newsgroup for my response so I've set
follow-up to .nativeapi
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|