Solved

Win95 in MS-DOS mode and IOCTL functions

Posted on 1997-04-15
2
238 Views
Last Modified: 2013-12-03
Hello,

I want to lock logical volume (int 21h, func 440Dh, Minor Code 4Ah) because my program does absolute writes to the disk. I am using a FAT32 drive and OEM Service Release 2. It seems that the IOCTL functions (int 21h, 440Dh) return 1
(function invalid) in MS-DOS mode, but work in Windows mode. So how does one lock a drive in software in MS-DOS mode ?  

Am I missing something in Config.Sys or Autoexec.bat?

( COMMAND.COM handles it when you type "LOCK"  at command prompt, so it can be done!)

Thanks in advance,
Riaz
0
Comment
Question by:RAT
2 Comments
 

Accepted Solution

by:
brien earned 50 total points
ID: 1334605
Riaz,

The reason you need to lock a volume to do absolute writes is because Windows is a multitasking environment and other disk activity may interfere with yours if it occurs simultaneously.

Locking the disk gives you exclusive access to it while you hold the lock.

In MSDOS mode your program is the only one running, so there is no need to lock the volume.  The IOCTL fails because it is not implemented in MSDOS mode.

0
 

Author Comment

by:RAT
ID: 1334606
Brien, my problem was that the lock level I was setting was 1,
when it should have been 0. Thanks for answering.

For that, 50 points!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Fox Pro commands 15 54
Which Microsoft MSDN Package Is The One I need? 3 51
String manipulation in Visual Basic 7 84
Where did System.Data.Objects go? 2 61
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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