Does anybody know how to read and write sectors on the HD directly (under win9x)?Under Dos, it was easy, but now.... Thanx BeLiAL
Posted on 2001-06-17 07:53:00 by 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.
Posted on 2001-06-17 23:19:00 by Larry Hammick
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.
Posted on 2001-06-18 05:25:00 by japheth
But CreateFile will open a disk device only in NT, not 9x, am I wrong? My Win98 box has no file vwin32.*.
Posted on 2001-06-18 15:55:00 by Larry Hammick
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: japheth
Posted on 2001-06-19 03:18:00 by 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
Posted on 2001-06-19 05:54:00 by belial
This shows a partial solution, with no use of DLL's or DPMI: 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.
Posted on 2001-06-20 08:37:00 by Larry Hammick
There is an example in the message board. Do a search for "HD MBR READING".
Posted on 2001-06-20 10:49:00 by karim