Article View: borland.public.cppbuilder.nativeapi
Article #13943Obtaining disk geometry for \\.\A: not working (repost)
From: Andrue Cope
Date: Tue, 09 Sep 2003 15:18
Date: Tue, 09 Sep 2003 15:18
37 lines
2271 bytes
2271 bytes
Andrue Cope,
We already support SCSI devices using SPTI and I'm extending this to
include driver letters. I've earlier verified that the media is
present in A: (using IOCTL_STORAGE_CHECK_VERIFY) and now I'm trying:
DISK_GEOMETRY geom;
if( DeviceIoControl( MyFileHandle,
IOCTL_DISK_GET_DRIVE_GEOMETRY,
NULL,
0,
&geom,
sizeof( geom ),
&returned,
NULL ) )
{
...
And the result is that oh-so-helpful 'A parameter is incorrect'.
FWIW the actually logic path at this point is:
1. Attempt IOCTL_SCSI_GET_INQUIRY_DATA
2. If this succeeds use IOCTL_SCSI_GET_CAPABILITIES etc. and
enable true SCSI handling mode.
3. Attempt IOCTL_DISK_GET_DRIVE_GEOMETRY and switch to reduced SCSI
handling mode.
Steps 1 & 2 work fine for PHYSICALDRIVE, CDROM and also for drive
letters when the drive is an IDE or SCSI unit. For floppy disks (1)
fails (not too surprising really) but then so does (3).
Obviously 'MyFileHandle' is valid so what's the problem?
--
Andrue Cope
[Bicester, UK]
Technical Details
Message-ID:
<VA.00001f36.0198ce1e@email.address.sorry>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,6c621ba6a6a2a0c5,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-09 08:28:39 PST Date: Tue, 09 Sep 2003 16:18:23 +0100 Newsgroups: borland.public.cppbuilder.nativeapi Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Virtual Access by Atlantic Coast PLC, http://www.atlantic-coast.com/va Message-ID: <VA.00001f36.0198ce1e@email.address.sorry> Subject: Obtaining disk geometry for \\.\A: not working (repost) From: Andrue Cope <not.a.valid@email.address.sorry> Reply-To: not.a.valid@email.address.sorry NNTP-Posting-Host: 217.207.223.34 X-Trace: newsgroups.borland.com 1063120790 217.207.223.34 (9 Sep 2003 08:19:50 -0700) Lines: 38 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail