我有一个命名管道和正常工作虽然我使用它运行在我的系统快速访问被拒绝,同时从另一个系统
客户端尝试使用下面的代码来打开文件在客户端访问:
LPTSTR lpszPipename = TEXT("\\\\smyServerName\\pipe\\iPipe01");
hPipe = CreateFile(
lpszPipename, // pipe name
GENERIC_READ | // read and write access
GENERIC_WRITE,
0, // no sharing
NULL, // default security attributes
OPEN_EXISTING, // opens existing pipe
0, // default attributes
NULL);
if (hPipe != INVALID_HANDLE_VALUE)
break;
// Exit if an error other than ERROR_PIPE_BUSY occurs.
if (GetLastError() != ERROR_PIPE_BUSY)
{
_tprintf(TEXT("Could not open pipe. GLE=%d\n"), GetLastError());
return -1;
}
在创建命名管道我用
lpszPipename = TEXT("\\\\.\\pipe\\iPipe01");
而不是myServerName
我用.(Dot)
。当我从另一个系统运行客户端时,我得到GLE 5(拒绝访问)。
为用户帐户提供服务器上的所需访问权限。在serverfault.com上询问更多问题 – 2010-09-08 11:45:16