如何创建可以在UWP/AppContainer应用中打开的私有命名空间?

问题描述 投票:0回答:0

我从完全信任的应用程序创建命名空间,如下所示:

string boundaryName = Guid.NewGuid().ToString();
using var boundary = new BoundaryDescriptor(boundaryName,
                                            // tried None aka 0 too
                                            CreateFlags.AddAppContainerSID);
// calls AddSIDToBoundaryDescriptor
boundary.Add(WellKnownSidType.WorldSid);
// calls AddIntegrityLabelToBoundaryDescriptor
boundary.Add(WellKnownSidType.WinLowLabelSid);

Debug.WriteLine($"boundary: {boundaryName}");

string name = Guid.NewGuid().ToString();
// uses default security
using var ns = new PrivateNamespace(boundary, name, destroyOnClose: true);

然后我将边界名称和命名空间名称复制到沙盒 UWP 应用程序,并调用

using var boundary = new BoundaryDescriptor(boundaryName,
                                            CreateFlags.AddAppContainerSID);
using var ns = PrivateNamespace.Open(boundary, name);

Open
调用失败,我得到错误 3
ERROR_PATH_NOT_FOUND
.

我需要做什么才能让沙盒应用程序打开我的命名空间?

我什至需要传递边界名称吗?

winapi appcontainer windows-principal
© www.soinside.com 2019 - 2024. All rights reserved.