🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15388

Re: Locking drives for exclusive access under Win32

#15388
From: Remy Lebeau (TeamB)
Date: Tue, 08 Jul 2003 18:44
24 lines
1942 bytes
"Russell Hind" <rhind@mac.com> wrote in message
news:3f0aed58$1@newsgroups.borland.com...
> These look like they are only for Win9x.

I do know that DeviceIoControl() is available under WinNT/2K/XP as well, and
I do know that it is possible to use it to lock and unlock a specific device
volume via the FSCTL_LOCK_VOLUME and FSCTL_UNLOCK_VOLUME commands:

    FSCTL_LOCK_VOLUME

http://msdn.microsoft.com/library/en-us/fileio/base/fsctl_lock_volume.asp

    FSCTL_LOCK_VOLUME

http://msdn.microsoft.com/library/en-us/fileio/base/fsctl_unlock_volume.asp

However, such commands only work under NT/2K/XP since they require a handle
to the volume directly, which is not supported under win9x/Me.  So, worse
case scenerio, you'll probably have to do an OS version detection first, and
then use FSCTL_LOCK_VOLUME for NT/2K/XP and Int 21h for Win9x/Me.


Gambit
Technical Details
Message-ID: <3f0b0fce$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <VA.00001dd5.06dcc046@email.address.sorry> <3f0aec5a$1@newsgroups.borland.com> <3f0aed58$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,469af434a4899493
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-08 11:40:29 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <VA.00001dd5.06dcc046@email.address.sorry> <3f0aec5a$1@newsgroups.borland.com> <3f0aed58$1@newsgroups.borland.com>
Subject: Re: Locking drives for exclusive access under Win32
Date: Tue, 8 Jul 2003 11:44:00 -0700
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3f0b0fce$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1057689550 207.175.226.26 (8 Jul 2003 11:39:10 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail