终端服务器会话中的隔离命名管道

发布于 2024-09-08 22:37:10 字数 538 浏览 5 评论 0原文

如果我的应用程序启动,我首先检查是否已经存在该应用程序的实例,如果是,我将焦点放在正在运行的实例上并终止新创建的进程。我使用通过 WCF 注册的命名管道来实现此目的。到目前为止效果很好。

现在我的应用程序也将在终端服务器环境中使用。命名管道是系统范围内的吗?因此我必须更改启动逻辑,不将焦点放在其他用户的实例上(这肯定不会起作用,但会破坏我的应用程序),或者终端服务器(2003R2)是否隔离 WCF 绑定每个 TS 会话?

我还无法访问生产环境,这就是我发布这个问题的原因。也许有人可以给我这个问题的答案?

更新

通过另一篇文章我所做的有关应用程序启动的内容,我了解到有一种更方便的方法来使用互斥体来管理单个应用程序启动,该方法可以在系统范围内或在终端会话的基础上使用。

然而,无论如何,这个问题是开放的,也许具有良好 WCF 知识的人可以回答它。这会很有趣。

If my application starts, I check first if there is already an instance of the app and if yes, I give focus to the running instance and terminate the newly created process. I make this with a named pipe that is registered through WCF. That works fine so far.

Now my app will also be used in a terminal server environment. Is it right that named pipes are system wide, so that I must change the startup logic to not give focus to instances of other users (what certainly not will work but break my application) or does Terminal Server (2003R2) isolate WCF-Bindings for each TS-session?

I cannot access the productive environment yet, that’s why I post this question. Maybe someone can give me an answer to this question?

Update

Through another post I did concerning the app startup, I learned that there is a more convenient way to manage the single application startup using a Mutex, which can be used system wide or on a terminal session basis.

The question however is open anyhow and perhaps someone that has good WCF –knowledge can answer it. It would be interesting.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

热鲨 2024-09-15 22:37:10

命名管道是系统范围内的。没有像其他内核对象类型那样的“全局”或“本地”前缀。

这是因为命名管道被用作网络资源的一部分,例如myComputer\pipename。获得“全局”和“本地”前缀的对象(事件、信号量、互斥体、计时器、文件映射和作业)的范围仅限于该计算机,并且不能被其他计算机访问。

Named pipes are system-wide. There is no "Global" or "Local" prefix like there is for other kernel object types.

This is because named pipes are used as part of a network resource, e.g., myComputer\pipename. The objects that get "Global" and "Local" prefixes (events, semaphores, mutexes, timers, file mappings, and jobs) are scoped to the computer and cannot be accessed by another computer.

情魔剑神 2024-09-15 22:37:10

本文介绍如何将命名管道限制为终端服务器的单个会话:
https://msdn.microsoft .com/en-us/library/windows/desktop/aa365600(v=vs.85).aspx

要防止远程用户或不同终端服务会话上的用户访问命名管道,请使用登录 SID管道的 DACL。登录 SID 也用于运行登录;它是用于保护每个会话对象命名空间的 SID。有关详细信息,请参阅在 C++ 中获取登录 SID。
https://msdn.microsoft .com/en-us/library/windows/desktop/aa446670(v=vs.85).aspx

This article explains how to restrict named pipes to a single session of terminal server:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365600(v=vs.85).aspx

To prevent remote users or users on a different terminal services session from accessing a named pipe, use the logon SID on the DACL for the pipe. The logon SID is used in run-as logons as well; it is the SID used to protect the per-session object namespace. For more information, see Getting the Logon SID in C++.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa446670(v=vs.85).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文