M
Michel Walsh
Hi,
What is the "declaration" (class) I need to assert the permission that
my code can run unmanaged code.
I have:
================
[System.Runtime.InteropServices.DllImport("KERNEL32")]
private static extern bool QueryPerformanceCounter( ref long
lpPerformanceCount);
[System.Runtime.InteropServices.DllImport("KERNEL32")]
private static extern bool QueryPerformanceFrequency( ref long
lpFrequency);
====================
and before calling QueryPerformanceCounter, 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
CodeAccessPermission perm = new SecurityAction??? ; // <<< HERE
perm.Assert();
dummy=QueryPerformanceFrequency( ref frequency);
dummy=QueryPerformanceCounter(ref fpsStartingCounter);
perm.RevertAssert();
....
==============
Thanks in advance,
Vanderghast, Access MVP
What is the "declaration" (class) I need to assert the permission that
my code can run unmanaged code.
I have:
================
[System.Runtime.InteropServices.DllImport("KERNEL32")]
private static extern bool QueryPerformanceCounter( ref long
lpPerformanceCount);
[System.Runtime.InteropServices.DllImport("KERNEL32")]
private static extern bool QueryPerformanceFrequency( ref long
lpFrequency);
====================
and before calling QueryPerformanceCounter, 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
CodeAccessPermission perm = new SecurityAction??? ; // <<< HERE
perm.Assert();
dummy=QueryPerformanceFrequency( ref frequency);
dummy=QueryPerformanceCounter(ref fpsStartingCounter);
perm.RevertAssert();
....
==============
Thanks in advance,
Vanderghast, Access MVP