public int nabtoSubmitPostData(IntPtr session, string nabtoUrl, byte[] postBuffer, string postMimeType, out byte[] resultBuffer, out string resultMimeTypeBuffer) { IntPtr nativeResultBuffer; IntPtr resultLength; IntPtr nativeResultMimeTypeBuffer; var status = Win32NativeMethods.nabtoSubmitPostData(session, nabtoUrl, postBuffer, (IntPtr)postBuffer.Length, postMimeType, out nativeResultBuffer, out resultLength, out nativeResultMimeTypeBuffer); if (status == NABTO_OK) { resultBuffer = MoveBuffer(nativeResultBuffer, resultLength); resultMimeTypeBuffer = MoveString(nativeResultMimeTypeBuffer); } else { resultBuffer = null; resultMimeTypeBuffer = null; } return(status); }