public int nabtoFetchUrl(IntPtr session, string nabtoUrl, out byte[] resultBuffer, out string mimeTypeBuffer) { IntPtr nativeResultBuffer; IntPtr resultLength; IntPtr nativeMimeTypeBuffer; var status = Win32NativeMethods.nabtoFetchUrl(session, nabtoUrl, out nativeResultBuffer, out resultLength, out nativeMimeTypeBuffer); if (status == NABTO_OK) { resultBuffer = MoveBuffer(nativeResultBuffer, resultLength); mimeTypeBuffer = MoveString(nativeMimeTypeBuffer); } else { resultBuffer = null; mimeTypeBuffer = null; } return(status); }