public static uint SspiPromptForCredential(string targetName, string packageName, out IntPtr ppAuthIdentity, ref bool saveCredentials)
        {
            CREDUI_INFO pUiInfo = new CREDUI_INFO {
                cbSize         = Marshal.SizeOf(typeof(CREDUI_INFO)),
                pszCaptionText = System.IdentityModel.SR.GetString("SspiLoginPromptHeaderMessage"),
                pszMessageText = ""
            };

            return(System.IdentityModel.NativeMethods.SspiPromptForCredentials(targetName, ref pUiInfo, 0, packageName, IntPtr.Zero, out ppAuthIdentity, ref saveCredentials, 0));
        }
 internal unsafe static extern uint SspiPromptForCredentials(
     string pszTargetName,
     ref CREDUI_INFO pUiInfo,
     uint dwAuthError,
     string pszPackage,
     IntPtr authIdentity,
     out IntPtr ppAuthIdentity,
     [MarshalAs(UnmanagedType.Bool)] ref bool pfSave,
     uint dwFlags
     );
Пример #3
0
        public static unsafe uint SspiPromptForCredential(string targetName, string packageName, out IntPtr ppAuthIdentity, ref bool saveCredentials)
        {
            CREDUI_INFO credui_Info = new CREDUI_INFO();

            credui_Info.cbSize = Marshal.SizeOf(typeof(CREDUI_INFO));

            credui_Info.pszCaptionText = SR.GetString(SR.SspiLoginPromptHeaderMessage); // Login
            credui_Info.pszMessageText = "";
            uint retCode = uint.MaxValue;

            retCode = NativeMethods.SspiPromptForCredentials(targetName, ref credui_Info, 0, packageName, IntPtr.Zero, out ppAuthIdentity, ref saveCredentials, 0);
            return(retCode);
        }
 public static uint SspiPromptForCredential(string targetName, string packageName, out IntPtr ppAuthIdentity, ref bool saveCredentials)
 {
     CREDUI_INFO pUiInfo = new CREDUI_INFO {
         cbSize = Marshal.SizeOf(typeof(CREDUI_INFO)),
         pszCaptionText = System.IdentityModel.SR.GetString("SspiLoginPromptHeaderMessage"),
         pszMessageText = ""
     };
     return System.IdentityModel.NativeMethods.SspiPromptForCredentials(targetName, ref pUiInfo, 0, packageName, IntPtr.Zero, out ppAuthIdentity, ref saveCredentials, 0);
 }
Пример #5
0
        public static unsafe uint SspiPromptForCredential(string targetName, string packageName, out IntPtr ppAuthIdentity, ref bool saveCredentials)
        {
            CREDUI_INFO credui_Info = new CREDUI_INFO();
            credui_Info.cbSize = Marshal.SizeOf(typeof(CREDUI_INFO));

            credui_Info.pszCaptionText = SR.GetString(SR.SspiLoginPromptHeaderMessage); // Login
            credui_Info.pszMessageText = "";
            uint retCode = uint.MaxValue;
            retCode = NativeMethods.SspiPromptForCredentials(targetName, ref credui_Info, 0, packageName, IntPtr.Zero, out ppAuthIdentity, ref saveCredentials, 0);
            return retCode;
        }
Пример #6
0
 internal unsafe static extern uint SspiPromptForCredentials(
    string pszTargetName,
    ref CREDUI_INFO pUiInfo,
    uint dwAuthError,
    string pszPackage,
    IntPtr authIdentity,
    out IntPtr ppAuthIdentity,
    [MarshalAs(UnmanagedType.Bool)] ref bool pfSave,
    uint dwFlags
     );