BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to read a sector from a drive

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Martin
Guest





PostPosted: Tue May 24, 2005 12:13 pm    Post subject: How to read a sector from a drive Reply with quote



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





PostPosted: Tue May 24, 2005 2:10 pm    Post subject: Re: How to read a sector from a drive Reply with quote



Martin wrote:

Quote:
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

Try

http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5765/

or

http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5765/

Google will find anything you need.


Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Wed May 25, 2005 8:58 am    Post subject: Re: How to read a sector from a drive Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.