public int Authenticate(ref IntPtr phwnd, ref IntPtr pszUsername, ref IntPtr pszPassword) { string username, password; if (Browser.Authenticate(out username, out password)) { IntPtr sUser = Marshal.StringToCoTaskMemAuto(username); IntPtr sPassword = Marshal.StringToCoTaskMemAuto(password); pszUsername = sUser; pszPassword = sPassword; return(Win32.S_OK); } else { return(Win32.E_ACCESSDENIED); } }