我正在尝试为 Internet Explorer 11 (Windows 8.1) 编写 BHO。我的 BHO 实现了 AppContainer 沙箱,但我似乎无法创建命名管道,CreateNamedPipe失败并显示该消息: Access is denied.
这是我用来创建命名管道的代码(我在俄罗斯网站上找到的,最后一条评论:
LPCWSTR LOW_INTEGRITY_SDDL_SACL_W = L"S:(ML;;NW;;;LW)D:(A;;0x120083;;;WD)(A;;0x120083;;;AC)";
PSECURITY_DESCRIPTOR pSD = NULL;
ConvertStringSecurityDescriptorToSecurityDescriptorW (
LOW_INTEGRITY_SDDL_SACL_W,
SDDL_REVISION_1,
&pSD,
无效的 );
如果 ( pSD != NULL)
{
SECURITY_ATTRIBUTES 安全属性;
SecurityAttributes.nLength = sizeof(SECURITY_ATTRIBUTES);
SecurityAttributes.bInheritHandle = TRUE;
SecurityAttributes.lpSecurityDescriptor = pSD;
处理 hPipe = CreateNamedPipe(
L"\\\\.\\pipe\\testpipe",
PIPE_ACCESS_DUPLEX,
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
1、
4096,
4096,
1000,
&安全属性);
}
不幸的是,它不起作用。GetLastError() Access is denied像往常一样返回它。