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 11 4713
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
using GetForegroundWindow delivers a handle from the window which has
currently the focus. with the (GetForegroundWindow)handle and the
handle from the diagnostics.process class i try to get some proberties
from the diagnostics.process class.
is there a possibility to get the handle from diagnostics.process
without exception?
(acl never heared before)
jeff
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
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
Note that handle obained with GetForegroundWindow is a window handle not a
process handle, not sure how you get at the Process from this handle.
Please show some code.
Willy.
"Jeffrey" <je*************@gmx.at> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com... using GetForegroundWindow delivers a handle from the window which has currently the focus. with the (GetForegroundWindow)handle and the handle from the diagnostics.process class i try to get some proberties from the diagnostics.process class.
is there a possibility to get the handle from diagnostics.process without exception? (acl never heared before)
jeff
using GetForegroundWindow delivers a handle from the window which has
currently the focus. with the (GetForegroundWindow)handle and the
handle from the diagnostics.process class i try to get some proberties
from the diagnostics.process class.
is there a possibility to get the handle from diagnostics.process
without exception?
(acl never heared before)
jeff
Note that handle obained with GetForegroundWindow is a window handle not a
process handle, not sure how you get at the Process from this handle.
Please show some code.
Willy.
"Jeffrey" <je*************@gmx.at> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com... using GetForegroundWindow delivers a handle from the window which has currently the focus. with the (GetForegroundWindow)handle and the handle from the diagnostics.process class i try to get some proberties from the diagnostics.process class.
is there a possibility to get the handle from diagnostics.process without exception? (acl never heared before)
jeff
possibly there are different handles. my fault
possibly there are different handles. my fault This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eric Lilja |
last post by:
Hello, I have a std::vector storing pointers to an abstract base class
OptionBase. OptionBase is not templated but I am deriving a template class
called Option from OptionBase. The class Option has...
|
by: Jeffrey |
last post by:
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.
|
by: Bucky Pollard |
last post by:
I have a web service that needs to create a batch file and call it (since
there are no APIs for the functionality I am looking for). I am using the
Process and ProcessStartInfo objects. When I try...
|
by: Tony Wong |
last post by:
I am trying to implement the Singleton Pattern for a assembly (class) which
control a common resource on my computer. I need the Singleton behavior
within a single process which contain multiple...
|
by: Geler |
last post by:
A theoretical question: Sorry if its a beginner question.
Here is a quote from the MSDN explaning the C/C++ calling convention.. It
demonstrates that the calling function is responsible to clean...
|
by: yoramkr |
last post by:
Hey
I have an application C#.Net2005 (that acts as a menu to other application) that is located in my office LocalIntranet and needs to execute other applications that are located in my office...
|
by: =?Utf-8?B?Um9nZXI=?= |
last post by:
Hello,
My question is about assigning FullTrust to all the programs installed on a
network shared folder called \\myserver\programfiles, for all the pcs on a
network domain:
I'm working on an...
|
by: flopbucket |
last post by:
Hi,
Say I have a baseclass B that has many derived classes, let's say
C..Z, for example:
class B
{
};
class C : public B {};
|
by: mosfet |
last post by:
Hi,
Let's say I have two classes A and B with B inheriting from A
with one non virtual method :
class A
{
public:
|
by: Terry Carroll |
last post by:
I am trying to do something with a very large tarfile from within
Python, and am running into memory constraints. The tarfile in
question is a 4-gigabyte datafile from freedb.org,...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |