Setting named pipe security in a Domain

寵の児 提交于 2019-12-01 12:47:14
chris_d

You need to use the ctor for NamedPipeServerStream which allows you to specify the desired access rights on the pipe handle:

public NamedPipeServerStream(
    string pipeName,
    PipeDirection direction,
    int maxNumberOfServerInstances,
    PipeTransmissionMode transmissionMode,
    PipeOptions options,
    int inBufferSize,
    int outBufferSize,
    PipeSecurity pipeSecurity,
    HandleInheritability inheritability,
    PipeAccessRights additionalAccessRights
)

When you call it, you need to ask for PipeAccessRights.ChangePermissions in the last argument. Then SetAccessControl should succeed.

See my blog http://blogs.charteris.com/blogs/chrisdi/archive/2009/12/04/exploring-the-wcf-named-pipe-binding-part-4.aspx for an example.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!