|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Safe / Unsafe Native MethodsI am currently moving my API declarations into relevant classes for Safe and Unsafe methods. My understanding is that unsafe methods are ones that require elevated security priviledges in order to perform their function. Is there a reference available as to what methods are safe and which unsafe? For example I cam currently looking at the method SHGetFileInfo, I presume this is unsafe as you would need to have priviledges in order to view the information on specific files. Any advice on this would be greatly appreciated. Also, one other quick thing. Presumable <DllImport()> can be used for *all* API declarations? I am making them all declared in a consistent way and thought I'd best check that I'm not going to run into any weird problems. Cheers again and thanks in advance for any help! Nick. > I am currently moving my API declarations into relevant classes for Safe Do you use the SuppressUnmanagedCodeSecurity attribute? If not, it>and Unsafe methods. My understanding is that unsafe methods are ones that >require elevated security priviledges in order to perform their function. >Is there a reference available as to what methods are safe and which unsafe? > > For example I cam currently looking at the method SHGetFileInfo, I >presume this is unsafe as you would need to have priviledges in order to >view the information on specific files. Any advice on this would be greatly >appreciated. doesn't really matter if you consider a function safe or unsafe, any calling code will need permission to call unmanaged code (which basically means it needs full trust). > Also, one other quick thing. Presumable <DllImport()> can be used for Yes>*all* API declarations? Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. Hi Mattias,
> Do you use the SuppressUnmanagedCodeSecurity attribute? If not, it Yup.> doesn't really matter if you consider a function safe or unsafe, any > calling code will need permission to call unmanaged code (which > basically means it needs full trust). > Yes Okay cool, I guess its just a matter of trial and error to see if the attribute causes any issues than. Thanks for your help, much appreciated. Nick.
How to disable the numericupdown event firing?
Mailmerge Automation Problems VB Form: Controlbox = False byte array size for read or write of filestream Basic Database Questions How do I embed a text file in my exe? Optional X as Boolean = ??? to detect missing argument? mutiple tables in dataset and the dataadapter fill statement problem with code for dataset with mutilple tables Using VSS and VS.NET 2003 |
|||||||||||||||||||||||