I was browsing through some of the code that came with "Managed DirectX 9 Kick Start : Graphics and Game Programming" by Tom Miller, and I came across these lines of code:
<System.Security.SuppressUnmanagedCodeSecurity()> Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByRef PerformanceFrequency As Long) As Boolean
<System.Security.SuppressUnmanagedCodeSecurity()> Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByRef PerformanceCount As Long) As Boolean
<System.Security.SuppressUnmanagedCodeSecurity()> Public Declare Function timeGetTime Lib "winmm.dll" () As Integer
Does anyone know why he supresses unmanaged code security? When I use an API I usually just type:
Declare Auto Function . . . . .
What's better/different about his way?
I thought his comments were hilarious! Rather like a school boy being made to write lines after he was bad!