🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6278

Re: How to read Bootsector, FAT, and so on

#6278
From: Martin
Date: Wed, 01 Jun 2005 05:52
38 lines
2479 bytes
Thank you for this information.
Martin


Eudy Silva schrieb:
> My understanding is that if you call CreateFile with \\.\U:
> you'll get a handle to the partition U: (a logical drive),
> like you're doing, and youl'll be limited to sectors inside
> of that partition.
> 
> If you want to access the physyical drive (that means the
> whole drive - Master Boot Record, etc) you have to call
> CreateFile with \\.\PHYSICALDRIVEx, as stated in Builder's
> WinSDK Online help:
> 
> ------------------------------------------------------------------
> The lpFileName string should be \\.\x: to open a floppy drive x or
> a partition x on a hard disk. For example:
> String    Meaning
> \\.\A:    Obtains a handle to drive A on the user's computer.
> \\.\C:    Obtains a handle to drive C on the user's computer.
> 
> The lpFileName string should be of the form \\.\PHYSICALDRIVEx to
> open the hard disk x. Hard disk numbers start at zero. For example:
> 
> String    Meaning
> \\.\PHYSICALDRIVE2  Obtains a handle to the third physical drive
>                     on the user's computer.
> ------------------------------------------------------------------
> 
> I believe you must find a way of discovering which physical drive
> your pen drive (or similar) is. Sorry, that's AFAIK, for now.
> Search also for "Direct Drive Access Under Win32"  in Builder's
> WinSDK Online help.
> 
> Regards
> 
> Eudy
Technical Details
Message-ID: <429d4cf1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <429c0001$1@newsgroups.borland.com> <429c8bb1$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ee3f5b64d08a5e0b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 01 Jun 2005 07:52:11 +0200
From: Martin <sorry@no.spam>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7.3) Gecko/20040910
X-Accept-Language: en-us, en, de, de-at, de-li, de-lu, de-ch
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to read Bootsector, FAT, and so on
References: <429c0001$1@newsgroups.borland.com> <429c8bb1$1@newsgroups.borland.com>
In-Reply-To: <429c8bb1$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 217.7.27.50
Message-ID: <429d4cf1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1117605105 217.7.27.50 (31 May 2005 22:51:45 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail