lpFrequency); lpFrequency); lpFrequency); ==================== 在调用QueryPerformanceCounter之前,我想要Assert( )权限,但我完全错过了语法,甚至没有真正的线索关于要使用的类(例如,SecurityAction,但可能还有其他的东西): ================ 静态计时() { / /初始化频率 CodeAccessPermission perm = new SecurityAction ??? ; //<<<这里 perm.Assert(); dummy = QueryPerformanceFrequency(引用频率); dummy = QueryPerformanceCounter(ref fpsStartingCounter); perm.RevertAssert(); ... ============== 提前致谢, Vanderghast,Access MVP 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 这篇关于断言执行非托管代码的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 07:51