Does anybody know how to read and write sectors on
the HD directly (under win9x)?Under Dos, it was easy, but now....
Thanx
BeLiAL
This topic came up a couple of weeks ago.
There was much learnéd discussion, but
no solution :D But I haven't given up.
hello belial,
for direct disk access under Win9x you have to do:
1. Get a handle to VWIN32.VXD with
invoke CreateFile,fname,...
mov handle,eax
fname db "\\.\vwin32",0
2. Use this handle as parameter for DeviceIoControl:
invoke DeviceIoControl,handle,VWIN32_DIOC_DOS_INT25,...
Or, if you want to make access with Int 13h, use VWIN32_DIOC_DOS_INT13 instead.
But CreateFile will open a disk device only
in NT, not 9x, am I wrong? My Win98 box has
no file vwin32.*.
VWIN32 is only available under Win9x/WinME.
But I have learned in the meantime, that read/write access to HDs via INT 13 and INT 25/26 is not supported through DeviceIoControl. Instead, a Win32 app should do:
1. call a Win16-Dll through thunks.
2. in the Win16-Dll, do Int13 processing with DPMI-Call 0x300 (simulate real mode int).
This seems a bit complicated. Sorry.
the following link gives some information about DeviceIoControl:
http://msdn.microsoft.com/library/psdk/win95/devio_2b1v.htm
japheth
So far, so goood...
But does perhaps anybody here has coded a procedure which reads one sector on c: .I really need an example...
Thanx
BeLiAL
This shows a partial solution, with no use
of DLL's or DPMI:
www.hammick.com/hcs/DISKIO.TXT
The method can read or write absolute sectors
of a volume (C:, A:, CD-ROM, etc.) but cannot
read the MBR of a hard disk, nor read any non-
Microsoft partition.
There is an example in the message board. Do a search for "HD MBR READING".