comp.lang.ada
 help / color / mirror / Atom feed
* Reading raw disks (Windows)
@ 2002-04-27 15:16 Larry Hazel
  2002-04-29  1:11 ` Steve Doiel
  0 siblings, 1 reply; 7+ messages in thread
From: Larry Hazel @ 2002-04-27 15:16 UTC (permalink / raw)


Is there any way to open a raw disk for reading under Windows?  I tried opening
"Z:" with sequential_io, but got 

raised ADA.IO_EXCEPTIONS.USE_ERROR : s-fileio.adb:833

Using GNAT 3.14p.  By the way, shouldn't that be Ada.IO_EXCEPTIONS.USE_ERROR? 
We chide everyone else about proper capitalization of Ada.

Larry



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading raw disks (Windows)
  2002-04-27 15:16 Reading raw disks (Windows) Larry Hazel
@ 2002-04-29  1:11 ` Steve Doiel
  2002-04-29  2:06   ` Larry Hazel
  0 siblings, 1 reply; 7+ messages in thread
From: Steve Doiel @ 2002-04-29  1:11 UTC (permalink / raw)


I haven't tried it, but after looking at the Win32 documentation it appears
you may have better luck with:
  \\.\Z:
at least on NT/W2K

SteveD

"Larry Hazel" <lhhazel@otelco.net> wrote in message
news:3CCAC0DB.32090922@otelco.net...
> Is there any way to open a raw disk for reading under Windows?  I tried
opening
> "Z:" with sequential_io, but got
>
> raised ADA.IO_EXCEPTIONS.USE_ERROR : s-fileio.adb:833
>
> Using GNAT 3.14p.  By the way, shouldn't that be
Ada.IO_EXCEPTIONS.USE_ERROR?
> We chide everyone else about proper capitalization of Ada.
>
> Larry





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading raw disks (Windows)
  2002-04-29  1:11 ` Steve Doiel
@ 2002-04-29  2:06   ` Larry Hazel
  2002-04-29 13:18     ` chris.danx
  2002-04-29 15:12     ` Frank J. Lhota
  0 siblings, 2 replies; 7+ messages in thread
From: Larry Hazel @ 2002-04-29  2:06 UTC (permalink / raw)


Steve Doiel wrote:
> 
> I haven't tried it, but after looking at the Win32 documentation it appears
> you may have better luck with:
>   \\.\Z:
> at least on NT/W2K

On Windows 98 SE I get a NAME_ERROR.  Maybe it's not possible.

Larry
> 
> SteveD
> 
> "Larry Hazel" <lhhazel@otelco.net> wrote in message
> news:3CCAC0DB.32090922@otelco.net...
> > Is there any way to open a raw disk for reading under Windows?  I tried
> opening
> > "Z:" with sequential_io, but got
> >
> > raised ADA.IO_EXCEPTIONS.USE_ERROR : s-fileio.adb:833
> >
> > Using GNAT 3.14p.  By the way, shouldn't that be
> Ada.IO_EXCEPTIONS.USE_ERROR?
> > We chide everyone else about proper capitalization of Ada.
> >
> > Larry


-- 
Larry Hazel
480 West Point Loop
Somerville, AL 35670-5533



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading raw disks (Windows)
@ 2002-04-29 12:13 Mike Brenner
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Brenner @ 2002-04-29 12:13 UTC (permalink / raw)


>> Is there any way to open a raw disk for reading under Windows? 

For FAT formatted disks, you might be able to use the old Alsys DOS Ada Compiler whose runtime library allows you to read and write the sectors of a disk as if the entire disk were a single random access file (which it is).

To do it on the more modern window formats probably requires a Ring 0 Device Driver to do it for you using the Game SDK or its replacement, and then have Ada use the C Interface to call that device driver.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading raw disks (Windows)
  2002-04-29  2:06   ` Larry Hazel
@ 2002-04-29 13:18     ` chris.danx
  2002-04-29 15:12     ` Frank J. Lhota
  1 sibling, 0 replies; 7+ messages in thread
From: chris.danx @ 2002-04-29 13:18 UTC (permalink / raw)



"Larry Hazel" <lhhazel@otelco.net> wrote in message
news:3CCCAAB7.1AA28434@otelco.net...
> Steve Doiel wrote:
> >
> > I haven't tried it, but after looking at the Win32 documentation it
appears
> > you may have better luck with:
> >   \\.\Z:
> > at least on NT/W2K
>
> On Windows 98 SE I get a NAME_ERROR.  Maybe it's not possible.


That should work for winnt but for 9x you might want to have a look at the
int 13h emulation or wrapper functions provided on 9x (it doesn't work on
winnt), can't remember what it's called but it's in the knowlege base
somewhere!!!


regards,
Chris





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading raw disks (Windows)
  2002-04-29  2:06   ` Larry Hazel
  2002-04-29 13:18     ` chris.danx
@ 2002-04-29 15:12     ` Frank J. Lhota
  2002-04-29 15:28       ` Darren New
  1 sibling, 1 reply; 7+ messages in thread
From: Frank J. Lhota @ 2002-04-29 15:12 UTC (permalink / raw)


It's possible, but you're in an area where MS failed miserably in the area
of portability. Under WinNT/2000/XP, you can get a handle to the raw disk by
calling CreateFile() with a file name of the form

    \\.\PHYSICALDRIVEx

where x is the physical disk number (disk numbers start at 0). To get a
handle to the raw data for a disk partition, use

    \\.\Z:

where Z is the drive letter for the partition.

Can we get a handle to this data in Win 95/Win 98? Yes, but a different (and
officially undocumented) naming convention is used. I've got to go through a
stack of old issues of Dr. Dobbs Journal to find the Win 95 way of doing
this.








^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Reading raw disks (Windows)
  2002-04-29 15:12     ` Frank J. Lhota
@ 2002-04-29 15:28       ` Darren New
  0 siblings, 0 replies; 7+ messages in thread
From: Darren New @ 2002-04-29 15:28 UTC (permalink / raw)


"Frank J. Lhota" wrote:
> It's possible, but you're in an area where MS failed miserably in the area
> of portability. 

I think the likelyhood that you're going to write a program that does
raw disk-IO to partitions that is portable between single-user Win95
systems and multi-user WinNT systems is pretty low. They don't even
support the same sets of file systems and disk layouts. That you need
different routines to access the raw sectors is probably way down on
your list of portability problems.

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
   The 90/10 rule of toothpaste: the last 10% of 
         the tube lasts as long as the first 90%.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-04-29 15:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-27 15:16 Reading raw disks (Windows) Larry Hazel
2002-04-29  1:11 ` Steve Doiel
2002-04-29  2:06   ` Larry Hazel
2002-04-29 13:18     ` chris.danx
2002-04-29 15:12     ` Frank J. Lhota
2002-04-29 15:28       ` Darren New
  -- strict thread matches above, loose matches on Subject: below --
2002-04-29 12:13 Mike Brenner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox