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: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com