TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Thomas Langenkamp
from: Vitus Jensen
date: 1994-07-21 22:35:18
subject: boot-sector

Thomas Langenkamp wrote in a message to All:

 TL> I want to read the boot-sector of my hard-disk (may be fat
 TL> or hpfs) but I always get an error 'invalid-pa

How do you try to read it? I wrote a hex editor which also handles this,
here is how I open a device:

rc = DosOpen("C:", &h, &action,
      0, 0,
      OPEN_ACTION_FAIL_IF_NEW|OPEN_ACTION_OPEN_IF_EXISTS,
      OPEN_FLAGS_DASD||OPEN_SHARE_DENYWRITE|OPEN_ACCESS_READONLY, 
      NULL );

You can now use 'DosSetFilePtr()' and 'DosRead()' to read various parts of
logical drive 'C:'.

OBS: You may even use OPEN_ACCESS_READWRITE to change something. If you do
so I would recommend to call DosDevIOCtl(category 8, function 0) 'Lock
Drive' prior. So nobody else is able to change the contents of the disk
simultaneously. This 'Lock Drive' will return 108 = ERROR_DRIVE_LOCKED on
boot drives (or at least if HPFS).



Tschuesz,
           Vitus

--- timEd/2 1.00


* Origin: Seems to be a Point of BetaBox Walheim (2:2474/100.20)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 413 430
SEEN-BY: 711/807 808 809 934 942 712/353 623 713/888 800/1
@PATH: 2474/100 0 2476/2 2480/76 24/24 396/1 3615/50 229/2
@PATH: 12/2442 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.