FullTrust用于调用流程成员 [英] FullTrust for calling Process members

查看:68
本文介绍了FullTrust用于调用流程成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我必须从一个进程调用Handle并且需要FullTrust

否则它会发生异常。

目前我只使用这个代码并发生异常。

[PermissionSet(SecurityAction.LinkDemand,Name =" FullTrust")]

PermissionState.Unrestricted如何实施?

jeff

解决方案

Jeffrey,


你能更具体一点吗?在确定授予应用程序的权限时,有很多事情需要确定。你的

应用程序是一个ASP.NET应用程序,还是一个Windows窗体应用程序?


另外,你提到的代码是一个属性,没有什么真正的

本身执行。无论该属性应用于什么,都要求来电者完全信任(这不是你想要的)。


你想做什么? ?

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" Jeffrey" < JE ************* @ gmx.at>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...

你好,

我必须从一个进程调用Handle并且需要FullTrust
否则它会发生异常。

目前我只使用此代码和异常发生。
[PermissionSet(SecurityAction.LinkDemand,Name =" FullTrust")]

PermissionState.Unrestricted如何实现?

jeff



这就是我所猜测的,当前进程无权使用该进程

句柄,这有与CAS无关,它是Windows安全的东西。

普通用户(甚至是管理员)没有无限制的权限,所以这是非常正常的应用程序无法调用OpenProcess(...)。


你想要实现什么?


Willy。

杰弗里 < JE ************* @ gmx.at>在消息中写道

news:11 ********************* @ g14g2000cwa.googlegro ups.com ...



它是一个Windows应用程序。
句柄是来自System.Diagnostics.Process类的句柄。
例外是一个
System.ComponentModel .Win32Exception:Zugriff verweigert
在System.Diagnostics.ProcessManager.OpenProcess(Int3 2 processId,
Int32 access,Boolean throwIfExited)
在System.Diagnostics.Process.GetProcessHandle(Int32 access,Boolean <在System.Diagnostics.Process.Terocess.and处理系统中,System.Diagnostics.Process.OpenProcessHandle()上的System.Diagnostics.Process.GetProcessHandle(Int32访问)

br />
jeff



内联。

Willy。

" Jeffrey" ; < JE ************* @ gmx.at>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...

你好,

我必须从一个进程调用Handle并且需要FullTrust
否则它会发生异常。

什么例外?用call the Handle是什么意思,如果你的意思是

使用Process句柄,那么你的异常与CAS无关。一个

pocess句柄是一个内核对象,受ACL保护。

目前我只使用这个代码并发生异常。
[PermissionSet(SecurityAction.LinkDemand,Name =" FullTrust")]

PermissionState.Unrestricted如何实现?

jeff



hello,

I have to call the Handle from a process and FullTrust is needed
otherwise it happens an exception.
currently i am using only this code and the exception occurs.
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
how is PermissionState.Unrestricted to implement?
jeff

解决方案

Jeffrey,

Can you be a little more specific? There are a lot of things that go
into determining the permissions that an application is granted. Is your
app an ASP.NET app, or a windows forms app?

Also, the code you mentioned is an attribute, there is nothing really
executed per-se. Whatever that attribute is applied to is demanding full
trust from the caller (which isn''t what you want).

What are you trying to do?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jeffrey" <je*************@gmx.at> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

hello,

I have to call the Handle from a process and FullTrust is needed
otherwise it happens an exception.
currently i am using only this code and the exception occurs.
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
how is PermissionState.Unrestricted to implement?
jeff



That''s what I guessed, the current process has no rights to use the process
handle, this has nothing to do with CAS, it''s a windows security thing.
Regular users (even administrators) have no unlimited privileges, so it''s
quite normal the your application cannot call OpenProcess(...).

What are you trying to achieve?

Willy.
"Jeffrey" <je*************@gmx.at> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...



it is a windows app.
the handle is a Handle from the System.Diagnostics.Process class.
the exception is a
System.ComponentModel.Win32Exception: Zugriff verweigert
at System.Diagnostics.ProcessManager.OpenProcess(Int3 2 processId,
Int32 access, Boolean throwIfExited)
at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean
throwIfExited)
at System.Diagnostics.Process.GetProcessHandle(Int32 access)
at System.Diagnostics.Process.OpenProcessHandle()
at System.Diagnostics.Process.get_Handle()
jeff



Inline.
Willy.
"Jeffrey" <je*************@gmx.at> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...

hello,

I have to call the Handle from a process and FullTrust is needed
otherwise it happens an exception.
What exception? What do you mean exactly with "call the Handle", if you mean
use the Process handle, then your exception has nothing to do with CAS. A
pocess handle is a kernel object and is protected by an ACL.


currently i am using only this code and the exception occurs.
[PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")]
how is PermissionState.Unrestricted to implement?
jeff



这篇关于FullTrust用于调用流程成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆