Solved

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

Posted on 1998-06-17
3
309 Views
Last Modified: 2013-12-03
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.
0
Comment
Question by:Richard_Thompson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Expert Comment

by:TAMC
ID: 1408077
5 questions for 50 points, are you out of your mind.
0
 
LVL 11

Accepted Solution

by:
alexo earned 50 total points
ID: 1408078
There are some examples by Raymon Chen from MS at:
  http://www.dejanews.com/getdoc.xp?AN=207816158
  http://www.dejanews.com/getdoc.xp?AN=211688212

What you want to do can ve done with either INT 13h (BIOS disk access) or INT 21h Func 44h (IOCTL).  You'll need a DOS reference.  I suggest Ralf Brown's interrupt list at:
  http://ctyme.com/rbrown.htm
  http://www.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/files.html

Or:
     <ftp://ftp.simtel.net/pub/simtelnet/msdos/info/helppc21.zip>
     <ftp://garbo.uwasa.fi/pc/programming/helppc21.zip>

0
 
LVL 11

Expert Comment

by:alexo
ID: 1408079
>> 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...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question