Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This has been the MOST helpful forum that I have been a part of and I want to say thank you. The tips, tricks and helpful advice that you all contribute to have been lifesavers in many instances..."

Geography

Where in the world do Tek-Tips members come from?
xwb (Programmer)
19 Dec 09 3:57
I have a client process that uses shared memory created by a service.  The problem is that the service is created as "Local User" so the clients are unable to access the shared memory.  Even with adding a "Global\" prefix, I can't access the memory.  I'm creating the shared memory as

CODE

      mHandle = CreateFileMapping (
         (HANDLE) 0xFFFFFFFF,           // Use system buffering
         (LPSECURITY_ATTRIBUTES) 0,
         PAGE_READWRITE,                // Protection
         0,                             // filesize high dword
         mFileSize,                      // filesize low dword
         name);                         // Name
What it boils down to is I have to fill in the LPSECURITY_ATTRIBUTES for the "Everyone" user.  I've been playing with all sorts of combinations for the last 3 hours and getting nowhere.  This is the basic framework I'm using

CODE

      SECURITY_DESCRIPTOR* sd = new SECURITY_DESCRIPTOR();
      InitializeSecurityDescriptor (sd, SECURITY_DESCRIPTOR_REVISION);
      // Have tried all sorts of permutations on the contents of sd

      SECURITY_ATTRIBUTES* sa = new SECURITY_ATTRIBUTES;
      sa->nLength = sizeof (*sa);
      sa->bInheritHandle = FALSE;
      sa->lpSecurityDescriptor = sd;
      std::string name = "Global\\";
      name += (in_name == 0? SMBaseName: in_name);
      mHandle = CreateFileMapping (
         (HANDLE) 0xFFFFFFFF,           // Use system buffering
         sa,
         PAGE_READWRITE,           // Protection
         0,                             // filesize high dword
         mFileSize,                     // filesize low dword
         name.c_str());                 // Name
Any simple examples on what to put into sd to represent the "Everyone" user would be great.
xwb (Programmer)
26 Dec 09 5:36

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close