title: Passing byte[] as IntPtr by PInvoke to memset
body: <p>I need to pass a byte array to memset, which due to P/Invoke clunkiness takes IntPtr. Tested by hand, it works, but I am seeking theoretical confirmation. Is this method correct?</p>
  
  <pre><code>[DllImport("msvcrt.dll", EntryPoint = "memset", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
  public static extern IntPtr MemSet(IntPtr dest, int c, int count);
  
  static unsafe void ZeroMemset (byte[] data)
  {
      fixed (byte* bytes = data) {
          MemSet ((IntPtr)bytes, 0, data.Length);
      }
  }
  </code></pre>