Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Why SuppressUnmanagedCodeSecurity?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Lachlan87
Moderator

USA
160 Posts

Posted - Sep 14 2004 :  4:40:50 PM  Show Profile  Reply with Quote
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:

' We won't use this maliciously
    <System.Security.SuppressUnmanagedCodeSecurity()> Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByRef PerformanceFrequency As Long) As Boolean
    ' We won't use this maliciously  
    <System.Security.SuppressUnmanagedCodeSecurity()> Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByRef PerformanceCount As Long) As Boolean
    ' We won't use this maliciously  
    <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!

Eric Coleman
Gladiator

USA
811 Posts

Posted - Sep 14 2004 :  5:28:11 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
I'm not sure, but from what I've read it gives a performance boost. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/seccodeguide.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenetchapt05.asp

Go to Top of Page

Lachlan87
Moderator

USA
160 Posts

Posted - Sep 14 2004 :  6:21:20 PM  Show Profile  Reply with Quote
Interesting links Eric! Thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.