public int nabtoGetSessionToken(IntPtr session, byte[] buffer, out int resultLength) { IntPtr nativeResultLength; var status = Win32NativeMethods.nabtoGetSessionToken(session, buffer, (IntPtr)buffer.Length, out nativeResultLength); resultLength = nativeResultLength.ToInt32(); return(status); }