From: Andrew Falanga on
Hi,

I'm using the CreateFileMapping( ) function to do the obvious and
everything works as expected on my XP development machine. However,
when I copied the binaries to a Vista machine CreateFileMapping( )
fails and GetLastError( ) returns error 5. I looked on MSDN and see
that system error 5 (0x5) is ERROR_ACCESS_DENIED.

Now, I'm calling this to create a shared memory space in the system
paging file. As far as I know, the user running the process on Vista
has administrator rights but to be honest I'm not fully sure of that.
I can't seem to find any place to make sure that this user is the
Administrator (or equivalent). I'm not able to login as the
Administrator user (not even prompted to, all I can do is click on the
Jedi user I created at install time). To be honest, with exception to
some useful changes to Windows Exploder, I'm not at all impressed with
Vista, but that's another conversation altogether.

If it's not because of the user id, what else causes access rights
violations when attempting to use the system paging file with
CreateFileMapping( )?

Andy
From: Eugene Mayevski on
Hello!
You wrote on Fri, 1 Feb 2008 11:09:37 -0800 (PST):

AF> If it's not because of the user id, what else causes access rights
AF> violations when attempting to use the system paging file with
AF> CreateFileMapping( )?

Try adding a session prefix to the mapping name. This is described in MSDN
in the topic for CreateFileMapping.

With best regards,
Eugene Mayevski

From: Andrew Falanga on
On Feb 1, 12:11 pm, "Eugene Mayevski" <mayev...(a)eldos.com> wrote:
> Hello!
> You wrote on Fri, 1 Feb 2008 11:09:37 -0800 (PST):
>
> AF> If it's not because of the user id, what else causes access rights
> AF> violations when attempting to use the system paging file with
> AF> CreateFileMapping( )?
>
> Try adding a session prefix to the mapping name. This is described in MSDN
> in the topic for CreateFileMapping.
>
> With best regards,
> Eugene Mayevski

Thank you. After reading that section on MSDN I noticed I was using a
session prefix. However, Vista seems to be unhappy with the prefix of
Global\. I changed to Local\ and the program worked from start to
finish that time.

Thanks again,
Andy