Hi,
What is the "declaratio n" (class) I need to assert the permission that
my code can run unmanaged code.
I have:
=============== =
[System.Runtime. InteropServices .DllImport("KER NEL32")]
private static extern bool QueryPerformanc eCounter( ref long
lpPerformanceCo unt);
[System.Runtime. InteropServices .DllImport("KER NEL32")]
private static extern bool QueryPerformanc eFrequency( ref long
lpFrequency);
=============== =====
and before calling QueryPerformanc eCounter, I want to Assert() the
permission, but I completely miss the syntax, having not even a real clue
about the class to use (for illustration, SecurityAction, but probably
something else):
=============== =
static Timings()
{
// Initialize the frequency
CodeAccessPermi ssion perm = new SecurityAction? ?? ; // <<< HERE
perm.Assert();
dummy=QueryPerf ormanceFrequenc y( ref frequency);
dummy=QueryPerf ormanceCounter( ref fpsStartingCoun ter);
perm.RevertAsse rt();
....
==============
Thanks in advance,
Vanderghast, Access MVP
What is the "declaratio n" (class) I need to assert the permission that
my code can run unmanaged code.
I have:
=============== =
[System.Runtime. InteropServices .DllImport("KER NEL32")]
private static extern bool QueryPerformanc eCounter( ref long
lpPerformanceCo unt);
[System.Runtime. InteropServices .DllImport("KER NEL32")]
private static extern bool QueryPerformanc eFrequency( ref long
lpFrequency);
=============== =====
and before calling QueryPerformanc eCounter, I want to Assert() the
permission, but I completely miss the syntax, having not even a real clue
about the class to use (for illustration, SecurityAction, but probably
something else):
=============== =
static Timings()
{
// Initialize the frequency
CodeAccessPermi ssion perm = new SecurityAction? ?? ; // <<< HERE
perm.Assert();
dummy=QueryPerf ormanceFrequenc y( ref frequency);
dummy=QueryPerf ormanceCounter( ref fpsStartingCoun ter);
perm.RevertAsse rt();
....
==============
Thanks in advance,
Vanderghast, Access MVP
Comment