Link to home
Start Free TrialLog in
Avatar of tier
tier

asked on

Once again: Read hard disk sectors

I have been told that direct access to hard disk sectors is not possible with delphi2 (32 bit)(It would be possible through VXDs). Is it possible with Delphi1 (16 bit) by using the int 13h and running the application in Windows 95?
Avatar of sperling
sperling

Still, it is possible, but you cannot write to the logical or physical disk where Windows 95 is installed. That's what you need a VxD for...

Regards,

Erik.
ASKER CERTIFIED SOLUTION
Avatar of OAM
OAM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In 32-bit code, you can do *some* DOS/BIOS interrupts using CreateFile on '\\.\VWIN32' and then doing DeviceIOControl to have it execute the ints for you. Int 13h is not supported using these methods.

In 16-bit code, you can do a few more ints, most of the int 13 functionality is supported. However, here you cannot use the VWIN32 VxD. You need to use DPMI to perform the ints, and the volume locking functions to obtain a lock of the correct level for the volume you wish to read/write. In some cases, the lock must be obtained in a two-step operation, where you first gain a intermediate level lock on a volume, and using this lock gets a exclusive lock.


Interesting indeed,
Yes, as I said before you need to use INT 32h (DPMI).  The questions
is how to call Int 13h exactly using int31h or are there any procedures/documentations ???