user2705346
user2705346

Reputation: 39

Global namespace CreateFileMapping and SeCreateGlobalPrivilege

I am using a shared memory map for inter-process communications. This map needs to be visible between sessions, so I am attempting to create it in the global namespace. I know that the running users needs SeCreateGlobalPrivilege in order for this to work.

I have edited the local security policy (I'm not on a domain) to give my user to the "Create Global Objects" privilege, but when I run the application this privilege is not in the access token. If I run as administrator I do get the privilege.

What am I missing? Why don't I get this privilege?

Upvotes: 2

Views: 4076

Answers (2)

James Gibb
James Gibb

Reputation: 1

If you're logged in as an adminitrator, UAC will filter the privilege unless you Run As Admin.

If you're logged in as an ordinary user you'll have the privilege all the time (if you've granted it from Local Security Policy)

Upvotes: 0

Remy Lebeau
Remy Lebeau

Reputation: 596001

Try using OpenThreadToken() and AdjustTokenPrivileges() to enable the privilege for the calling thread before calling CreateFileMapping().

Enabling and Disabling Privileges in C++

Upvotes: 2

Related Questions