RE: Lock/dismount volume from service account: differs be- tween 2k and XP ?

This is probably because of built-in terminal services. If your drive is
local to current session (i.e. for current logged in user), it isn’t visible
to local system using different session. Run WinObj and examine Sessions | 0

  • 4 | DosDevices subfolders to verify it. Map a network drive to an unique
    drive letter and find subfolder where it is. If there is also your drive, it
    is local. Note DefineDosDevice() creates local drives.

To solve problem, you can make drive global (create in Global?? folder –
note Mount Manager creates drives there) or dismount drive in proper
session. There shouldn’t be a problem with privileges if user is able to
mount drive, he should be able also to lock and dismount (I haven’t verified
it).

Best regards,

Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]


From: xxxxx@zeelandnet.nl[SMTP:xxxxx@zeelandnet.nl]
Reply To: xxxxx@lists.osr.com
Sent: Wednesday, February 20, 2002 11:36 AM
To: xxxxx@lists.osr.com
Subject: [ntdev] Lock/dismount volume from service account: differs
between 2k and XP ?

Hi,

I have an application that mounts and dismounts virtual disk volumes (the
virtual disks are actually mounted to host files on a physical disk). I
have experienced a problem however with locking the volume prior to
dismounting. For locking and dismounting, I use code similar to the sample

in http://support.microsoft.com/default.aspx?scid=kb;EN-US;q165721.

In order to make sure that the application has the privileges to open the
volume using CreateFile(“\.\X:”, …), I moved the lock-and-dismount
code
into a system service, which runs in the LocalSystem account.

This works perfectly for Windows 2K, however it doesn’t work for Windows
XP. The strange thing is that in Windows XP, the CreateFile returns
“cannot
find the file specified”, rather than “access denied”, what I would have
expected.

Now, if I run the lock-and-dismount code in a normal application, under a
normal user account (with -local- admin privileges), the code works fine,
both for Windows 2k and XP.

Does anybody know what could cause this ?


Bartjan.


You are currently subscribed to ntdev as: michal.vodicka@st.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com