创建具有安全权限的名为pipe的窗口

时间:2011-12-22 08:42:40

标签: java kernel32

我想从java进程创建一个命名管道,并为来自不同安全组的用户提供完全权限,以连接到管道并使用它。

我创建管道的方式是:

INSTANCE = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);

pipe = INSTANCE.CreateNamedPipeA( 
        fullPipeName,             // pipe name 
        Kernel32.PIPE_ACCESS_DUPLEX,       // read/write access 
        Kernel32.PIPE_TYPE_MESSAGE |       // message type pipe 
        Kernel32.PIPE_READMODE_MESSAGE |   // message-read mode 
        Kernel32.PIPE_WAIT,                // blocking mode 
        Kernel32.PIPE_UNLIMITED_INSTANCES, // max. instances  
        BUFSIZE,                  // output buffer size 
        BUFSIZE,                  // input buffer size 
        0,                        // client time-out 
        Pointer.NULL);

我知道CreateNamedPipeA方法的最后一个参数是为了安全,但我不知道应该如何使用它。

0 个答案:

没有答案