• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Win95 in MS-DOS mode and IOCTL functions

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
RAT
Asked:
RAT
1 Solution
 
brienCommented:
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
 
RATAuthor Commented:
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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now