CreateFileMapping return ERROR_ACCESS_DENIED in Terminal Server environment

E

EagleChen

Hello,

I tried to use CreateFileMapping() in Terminal Server environment, and I can
do it successfully
with Administrator login, but will get ERROR_ACCESS_DENIED using a normal
user.
Does anyone know how to set the authority to normal user? or any hints ?
Thanks in advance, and the following is my code:

Eagle


InitializeSecurityDescriptor(&SecurityDescriptor,
SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorSacl(&SecurityDescriptor, false, NULL, true);
SetSecurityDescriptorDacl(&SecurityDescriptor, true, NULL, false);
SetSecurityDescriptorOwner(&SecurityDescriptor, NULL, false);
SetSecurityDescriptorGroup(&SecurityDescriptor, NULL, false);
//
SecurityAttribute.bInheritHandle = true;
SecurityAttribute.lpSecurityDescriptor=&SecurityDescriptor;
SecurityAttribute.nLength=sizeof(SecurityAttribute);
//
hMapObject = CreateFileMapping(
INVALID_HANDLE_VALUE,
&SecurityAttribute,
PAGE_READWRITE,
0,
1024, // size: low 32-bits
"Global\\ixgclientsharedmemory");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top