title: Can we replace all "int" parameter & return types with "IntPtr" in the DllImport method signature?
body: <p>In my program, I have some <code>DllImport</code>s since I want to call some native APIs. <code>int</code> type is used for the method parameters &amp; returns types. It was working quite well until I ran my application on new Windows 2012 R2 Server (64 bit). The problem is fixed when I changed one of the <code>ref</code> parameter's type from <code>int</code> to <code>IntPtr</code>. </p>
  
  <p>I know that <code>IntPtr</code> is used to represent a pointer or a handle.
  However, MSDN also says that <code>IntPtr</code> is "designed to be an integer" whose size is platform-specific. So if <code>IntPtr</code> is capable of handling the platform specific size of the integer, is it OK to replace all <code>int</code> parameters &amp; return types with <code>IntPtr</code>?</p>
  
  <p>I am using C# .NET 4.0.</p>