How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights


  1.    04 Jul 2007 #1
    kalpesh Guest

    How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights


    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
    ConvertStringSecurityDescriptorToSecurityDescriptor 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

      My System SpecsSystem Spec

  2.    04 Jul 2007 #2
    Andrew McLaren Guest

    Re: How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights


    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)NULL,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

      My System SpecsSystem Spec

How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights

Similar Threads
Thread Forum
How to access a registry entry wo no access rights
Hi; We have a problem where one of our customers has installed our software which is an AddIn to Microsoft Office. The registry entries that...
Vista security
Printing Access Rights
Hi there, I have a problem where I can print on my Lexmark printer as I am an admin user, but my children cannot. They are logged on as normal...
Vista print fax & scan
Printing access rights
Hi there, I have a Lexmark printer which prints fine from my login as I am the admin. Normal users get the message "cannot communicate with...
Vista security
Search / access rights ?
I do not run UAC. I run as administrator (not super admin) As part of cleaning things up and keeping track of what's where, I found that I can...
Vista General
CreateNamedPipe without Disconnect & CloseHandle
i have a serious problem with CreateNamedPipe: I am developing a virtual printer driver in VISTA, for that at one point i use NamedPipe ok.. ...
Vista General
How to CreateNamedPipe with FILE_CREATE_PIPE_INSTANCE access rights
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...
Vista security
Administrator access rights
Although I am the only administrator for my PC and all other users, including the PC account are standard users I still get the message "is it...
Vista account administration

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 13:50.
    .