Link to home
Start Free TrialLog in
Avatar of Richard_Thompson
Richard_Thompson

asked on

Peforming direct operations on floppy disks using DeviceIoControl() and the DIOC struct.

I am writing a disk copier using MS C++ V. 4 for Windows '95.  There are 5 main tasks which I need to know how to do.  These are...

* Reading a specified track from a floppy disk.
* Writing a specified track to a floppy disk.
* Formating a specified track on a floppy disk.
* Determining whether a floppy disk is in the drive.
* Determining whether a floppy disk in a drive is write-protected or not.

To answer this question, could you please provide me with example C++ source code which will do ALL 5 of the above.

The code MUST be capable of the following...

* Be Windows '95 compatible.  I'm mainly interested in Windows '95, but if you also have any NT code as well, that would be great.

* Must be capable of detecting errors.  e.g. If the program writes to a corrupt track or the disk is write-protected, the code must detect that the operation has failed.

* THIS IS VERY IMPORTANT - The user must have the option of whether or not to allow for verification of operations such as (but not limiting to) disk writes etc.

I assume each of these tasks can be done by opening the system VXD, filling up a DIOC structure, then calling DeviceIoControl().  There is a good example in the MS KB (q163/9/20.asp) and in the C++ docs which explains how to use this technique to query a floppy disk device which I found very useful.  However, it doesn't explain how to do the 5 operations above.  There are no listings of the control codes to use for floppy disk devices or the structs needed (as far as I am aware) - that is why I need your help!  Thanks.
Avatar of TAMC
TAMC

5 questions for 50 points, are you out of your mind.
ASKER CERTIFIED SOLUTION
Avatar of alexo
alexo
Flag of Antarctica image

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
>> 5 questions for 50 points, are you out of your mind.
TAMC, why does the amount of point matter to you?  They are virtual, you know...