UnsafeNativeMethods - why is it internal?

  • Thread starter Thread starter john doe
  • Start date Start date
J

john doe

The UnsafeNativeMethods seems to be the answer to most .NET developer's
prayers in terms of defining interfaces and functions from the Windows
API, without us having to constantly having to re-import these
functions (and often incorrect definitions floating around the web).

I can understand the idea behind making this class internal, but would
it not benefit the community more to open it up as public? Removing the
need for all those re-declared SendMessages!!
 
No, it wouldn't. There are a gazillion issues that would arise if they
did. Also, some of the definitions are tailored specifically for what they
are doing internal to the framework. Not to mention the security issues
that come along with it (for example, you can safely assert security
permissions if you know that the functions are not accessible outside of
your assembly).

Are you finding that http://www.pinvoke.net doesn't have the correct
definitions? The good thing about it is that if it is wrong, you are free
to correct it.
 
Back
Top