Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights

Reply
Thread Tools Display Modes

How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights

 
 
kalpesh
Guest
Posts: n/a

 
      07-04-2007
i want to create a named pipe with FILE_CREATE_PIPE_INSTANCE access
rights.
for that i have to create one security discriptor but i dont which
type of secirity discriptor i use to cerate namaed pipe with
FILE_CREATE_PIPE_INSTANCE rights.

while creating security discriptor i dont want to use
ConvertStringSecurityDescriptorToSecurityDescripto r funciton because
i am going to build this code in DDK and DDK not support this
function.

so give me suggestion about security discriptor for
FILE_CREATE_PIPE_INSTANCE access rights..

Thanks in advance..
Kalpesh

 
Reply With Quote
 
 
 
 
Andrew McLaren
Guest
Posts: n/a

 
      07-04-2007
Hi Kalpesh,

Can you just call InitializeSecurityDescriptor() to create the descriptor?
Here's a code sample from T Kabilan, which I found on Google (there would be
hundreds more) ...

SECURITY_ATTRIBUTES m_pSecAttrib;
SECURITY_DESCRIPTOR* m_pSecDesc;

m_pSecDesc = (SECURITY_DESCRIPTOR*)LocalAlloc(LPTR,
SECURITY_DESCRIPTOR_MIN_LENGTH);

InitializeSecurityDescriptor(m_pSecDesc,
SECURITY_DESCRIPTOR_REVISION);

SetSecurityDescriptorDacl(m_pSecDesc,TRUE,(PACL)NU LL,FALSE))

m_pSecAttrib.nLength = sizeof(SECURITY_ATTRIBUTES);
m_pSecAttrib.bInheritHandle = TRUE;
m_pSecAttrib.lpSecurityDescriptor = m_pSecDesc;

::CreateNamedPipe(PIPE_NAME,
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
32768,
32768,
NMPWAIT_USE_DEFAULT_WAIT,
&m_pSecAttrib);

What you'd need to add to this sample is an AddAccessAllowedAce(), between
InitializeSecurityDescriptor() and SetSecurityDescriptorDacl(), which you'd
use to add the FILE_CREATE_PIPE_INSTANCE ACE. I'd write the code for you,
but ... that costs $200p/h :-) Warning, though - I've never tried this from
the DDK.

Hope this helps a bit,
Andrew

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search / access rights ? Kris Windows Vista General Discussion 1 04-05-2008 07:42 PM
Vista = Access Rights HELL grz01@spray.se Windows Vista General Discussion 1 12-15-2007 11:07 PM
Calendars, different users, and access rights Tablespider Windows Vista Administration 2 09-25-2007 12:08 PM
How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights kalpesh Windows Vista Security 3 07-05-2007 04:35 PM
Administrator access rights BarryD Windows Vista Administration 1 06-02-2007 02:17 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59