Solved

Win95 in MS-DOS mode and IOCTL functions

Posted on 1997-04-15
2
231 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now