xCoder
May 7th, 2011, 02:39
Hello, I want to program software protection and can't find any suitable info about raw physical disk reading/writing in Win98 SE. I found something like this:
... but it works only for reading logical disks. I need writing to physical device. Can someone provide info or links? Sorry for bad english.
Code:
DeviceIoControl(hDev, VWIN32_DIOC_DOS_INT25, ®, sizeof(reg), ®, sizeof(reg), &cb, 0);
DeviceIoControl(hDev, VWIN32_DIOC_DOS_INT26, ®, sizeof(reg), ®, sizeof(reg), &cb, 0);
DeviceIoControl(hDev, VWIN32_DIOC_DOS_DRIVEINFO, ®, sizeof(reg), ®, sizeof(reg), &cb, 0);
... but it works only for reading logical disks. I need writing to physical device. Can someone provide info or links? Sorry for bad english.

In general you would do read/write by means of io ports and all needed commands you can find at http://www.t10.org/ (SCSI) and http://www.t13.org/ (ATA). Also you will need PCI specification which is not free(http://www.pcisig.com) but google can help to find some version, to see what ports you have to use, and if it's SCSI or IDE bus, and what set of commands to send