ioctl12.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DSK_LOCKDRIVE (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSDEVIOCTL
 
USHORT DosDevIOCtl(0L, pbCommand, 0x0000, 0x0008, hDevice)
PBYTE pbCommand;    /* pointer to variable with command */
HFILE hDevice;      /* device handle                    */
 
The DSK_LOCKDRIVE function locks a disk drive, preventing file I/O by
another process on the volume in the disk drive. This function succeeds if
there is only one file handle open on the volume in the disk drive because
the desired result is to exclude all other I/O to the volume.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
pbCommand  Points to the variable that contains a reserved value. The value
           must be zero.
 
hDevice    Identifies the disk drive that receives the device-control
           function. The handle must have been created previously by using
           the DosOpen function.
 
Return Value
 
The return value is zero if the function is successful or an error value if
an error occurs.
 
See Also
 
DosOpen, DSK_UNLOCKDRIVE
 
                                      ♦