Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
# Run tests
- name: Test
run: |
dotnet test Tests/NetEx.IO.Tests/NetEx.IO.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore /p:Version=${{ env.VERSION_NUMBER }}
dotnet test Tests/NetEx.IO.Tests/NetEx.IO.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
working-directory: src

# Upload build artifacts.
Expand Down
18 changes: 7 additions & 11 deletions src/NetEx.Dialogs.WinForms/CredentialDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,12 @@ private void ParseUsername(StringBuilder username)
private int RunDialogOld(CREDUI_INFO credUiInfo)
{
// Begin setting the flags to be used to display the classic credential dialog. We know
// that we do not want the credentials entered to be stored in the Credential Manager so
// we can immediately set this flag.
var flags = CREDUI_FLAGS.CREDUI_FLAGS_DO_NOT_PERSIST;
// that we do not want the credentials entered to be stored in the Credential Manager,
// and we always want to show a UI rather than retrieve existing credentials, so we
// immediately set these flags.
var flags = CREDUI_FLAGS.CREDUI_FLAGS_DO_NOT_PERSIST |
CREDUI_FLAGS.CREDUI_FLAGS_GENERIC_CREDENTIALS |
CREDUI_FLAGS.CREDUI_FLAGS_ALWAYS_SHOW_UI;

// Set the flag to determine whether to show the "Incorrect Password" prompt to the user
if (IncorrectPasswordPrompt)
Expand Down Expand Up @@ -485,21 +488,14 @@ private int RunDialogOld(CREDUI_INFO credUiInfo)
private int RunDialogVista(CREDUI_INFO credUiInfo)
{
// Create a variable to store our calculated flags.
CREDUIWIN flags = 0;
CREDUIWIN flags = CREDUIWIN.CREDUIWIN_GENERIC;

// Set the flag to determine whether the "Save Password" checkbox is shown.
if (ShowSave)
{
flags |= CREDUIWIN.CREDUIWIN_CHECKBOX;
}

// Check the value of our CredentialFilter enum and set the flag to display only the
// usernames requested by the user.
if (CredentialFilter == CredentialFilter.AdministratorsOnly)
{
flags |= CREDUIWIN.CREDUIWIN_ENUMERATE_ADMINS;
}

// A variable for storing the result code from showing the dialog.
int resultCode;

Expand Down
5 changes: 4 additions & 1 deletion src/NetEx.Dialogs.WinForms/CredentialFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ public enum CredentialFilter
/// <summary>
/// Populate the <see cref="CredentialDialog"/> with local administrators only.
/// </summary>
/// <remarks>On Windows XP Home Edition this flag will filter out the well-known Administrator account. On Windows Vista and later this value is intended for User Account Control (UAC) purposes only. We recommend that external callers not set this flag.</remarks>
/// <remarks>
/// <para>This option is only applicable on Windows XP and Windows Server 2003, or on later version of Windows when using the <see cref="CredentialDialog"/> with <see cref="CredentialDialog.AutoUpgradeEnabled"/> set to false.</para>
/// <para>On Windows XP Home Edition this flag will filter out the well-known Administrator account.</para>
/// </remarks>
AdministratorsOnly = 1,
/// <summary>
/// Populate the <see cref="CredentialDialog"/> with usernames only. This option will not display certificates or smart cards in the <see cref="CredentialDialog"/>.
Expand Down
30 changes: 21 additions & 9 deletions src/NetEx.Dialogs.WinForms/Interop/CREDUIWIN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace NetEx.Dialogs.WinForms.Interop
[Flags]
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "UnusedMember.Global")]
internal enum CREDUIWIN
internal enum CREDUIWIN : uint
{
/// <summary>
/// The caller is requesting that the credential provider return the user name and password in plain text.
Expand All @@ -22,41 +22,53 @@ internal enum CREDUIWIN
/// </summary>
CREDUIWIN_CHECKBOX = 0x2,
/// <summary>
/// Only credential providers that support the authentication package specified by the pulAuthPackage parameter should be enumerated.
/// Only credential providers that support the authentication package specified by the pulAuthPackage parameter should be enumerated.
/// <para>This value cannot be combined with CREDUIWIN_IN_CRED_ONLY.</para>
/// </summary>
[SuppressMessage("ReSharper", "IdentifierTypo")]
CREDUIWIN_AUTHPACKAGE_ONLY = 0x10,
/// <summary>
/// Only the credentials specified by the pvInAuthBuffer parameter for the authentication package specified by the pulAuthPackage parameter should be enumerated.
/// Only the credentials specified by the pvInAuthBuffer parameter for the authentication package specified by the pulAuthPackage parameter should be enumerated.
/// <para>If this flag is set, and the pvInAuthBuffer parameter is NULL, the function fails.</para>
/// <para>This value cannot be combined with CREDUIWIN_AUTHPACKAGE_ONLY.</para>
/// </summary>
[SuppressMessage("ReSharper", "CommentTypo")]
CREDUIWIN_IN_CRED_ONLY = 0x20,
/// <summary>
/// Credential providers should enumerate only administrators. This value is intended for User Account Control (UAC) purposes only. We recommend that external callers not set this flag.
/// Credential providers should enumerate only administrators. This value is intended for User Account Control (UAC) purposes only. We recommend that external callers not set this flag.
/// </summary>
CREDUIWIN_ENUMERATE_ADMINS = 0x100,
/// <summary>
/// Only the incoming credentials for the authentication package specified by the pulAuthPackage parameter should be enumerated.
/// Only the incoming credentials for the authentication package specified by the pulAuthPackage parameter should be enumerated.
/// </summary>
CREDUIWIN_ENUMERATE_CURRENT_USER = 0x200,
/// <summary>
/// The credential dialog box should be displayed on the secure desktop. This value cannot be combined with CREDUIWIN_GENERIC.
/// The credential dialog box should be displayed on the secure desktop. This value cannot be combined with CREDUIWIN_GENERIC.
/// <para>Windows Vista: This value is supported beginning with Windows Vista with SP1.</para>
/// </summary>
CREDUIWIN_SECURE_PROMPT = 0x1000,
/// <summary>
/// The credential dialog box is invoked by the SspiPromptForCredentials function, and the client is prompted before a prior handshake. If SSPIPFC_NO_CHECKBOX is passed in the pvInAuthBuffer parameter, then the credential provider should not display the check box.
/// The credential dialog box is invoked by the SspiPromptForCredentials function, and the client is prompted before a prior handshake. If SSPIPFC_NO_CHECKBOX is passed in the pvInAuthBuffer parameter, then the credential provider should not display the check box.
/// <para>Windows Vista: This value is supported beginning with Windows Vista with SP1.</para>
/// </summary>
[SuppressMessage("ReSharper", "CommentTypo")]
[SuppressMessage("ReSharper", "IdentifierTypo")]
CREDUIWIN_PREPROMPTING = 0x2000,
/// <summary>
/// The credential provider should align the credential BLOB pointed to by the ppvOutAuthBuffer parameter to a 32-bit boundary, even if the provider is running on a 64-bit system.
/// The credential provider will not pack the AAD authority name. This is only applied to Azure AD joined devices.
/// <para>Windows 10, version 1607: This value is supported beginning with Windows 10, version 1607.</para>
/// </summary>
CREDUIWIN_PACK_32_WOW = 0x10000000
/// <remarks>This value does not have an explicit name defined in the original enum, so the name is generated for this library.</remarks>
CREDUIWIN_DO_NOT_PACK_AAD_AUTHORITY_NAME = 0x40000,
/// <summary>
/// The credential provider should align the credential BLOB pointed to by the ppvOutAuthBuffer parameter to a 32-bit boundary, even if the provider is running on a 64-bit system.
/// </summary>
CREDUIWIN_PACK_32_WOW = 0x10000000,
/// <summary>
/// Windows Hello credentials will be packed in a smart card auth buffer. This only applies to the face, fingerprint, and PIN credential providers.
/// <para>Windows 10, version 1809: This value is supported beginning with Windows 10, version 1809.</para>
/// </summary>
/// <remarks>This value does not have an explicit name defined in the original enum, so the name is generated for this library.</remarks>
CREDUIWIN_PACK_WINDOWS_HELLO = 0x80000000
}
}
6 changes: 3 additions & 3 deletions src/NetEx.Dialogs.WinForms/Interop/CREDUI_FLAGS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ namespace NetEx.Dialogs.WinForms.Interop
internal enum CREDUI_FLAGS
{
/// <summary>
/// Specifies that a user interface will be shown even if the credentials can be returned from an existing credential in credential manager. This flag is permitted only if CREDUI_FLAGS_GENERIC_CREDENTIALS is also specified.
/// Specifies that a user interface will be shown even if the credentials can be returned from an existing credential in credential manager. This flag is permitted only if CREDUI_FLAGS_GENERIC_CREDENTIALS is also specified.
/// </summary>
CREDUI_FLAGS_ALWAYS_SHOW_UI = 0x00080,
/// <summary>
/// Populate the combo box with the prompt for a user name.
/// </summary>
CREDUI_FLAGS_COMPLETE_USERNAME = 0x00800,
/// <summary>
/// Do not store credentials or display check boxes. You can pass CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX with this flag to display the Save check box only, and the result is returned in the pfSave output parameter.
/// Do not store credentials or display check boxes. You can pass CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX with this flag to display the Save check box only, and the result is returned in the pfSave output parameter.
/// </summary>
CREDUI_FLAGS_DO_NOT_PERSIST = 0x00002,
/// <summary>
Expand All @@ -37,7 +37,7 @@ internal enum CREDUI_FLAGS
/// </summary>
CREDUI_FLAGS_GENERIC_CREDENTIALS = 0x40000,
/// <summary>
/// Notify the user of insufficient credentials by displaying the "Logon unsuccessful" balloon tip.
/// Notify the user of insufficient credentials by displaying the "Logon unsuccessful" balloon tip.
/// </summary>
CREDUI_FLAGS_INCORRECT_PASSWORD = 0x00001,
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NetEx.Dialogs.WinForms/NetEx.Dialogs.WinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>NetEx.Dialogs.WinForms</PackageId>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/Peckmore/NetEx</PackageProjectUrl>
<PackageProjectUrl>https://peckmore.github.io/NetEx</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>Please refer to GitHub for changes.</PackageReleaseNotes>
<PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/NetEx.Dialogs.WinForms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Currently Supported Types:

## Documentation

Documentation is available [here](https://peckmore.github.io/NetEx)
Documentation is available [here](https://peckmore.github.io/NetEx.
2 changes: 1 addition & 1 deletion src/NetEx.Hooks/NetEx.Hooks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>NetEx.Hooks</PackageId>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/Peckmore/NetEx</PackageProjectUrl>
<PackageProjectUrl>https://peckmore.github.io/NetEx</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>Please refer to GitHub for changes.</PackageReleaseNotes>
<PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/NetEx.Hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Currently Supported Types:

## Documentation

Documentation is available [here](https://peckmore.github.io/NetEx)
Documentation is available [here](https://peckmore.github.io/NetEx).
2 changes: 1 addition & 1 deletion src/NetEx.IO/NetEx.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>NetEx.IO</PackageId>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://github.com/Peckmore/NetEx</PackageProjectUrl>
<PackageProjectUrl>https://peckmore.github.io/NetEx</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>Please refer to GitHub for changes.</PackageReleaseNotes>
<PackageTags>
Expand Down
2 changes: 1 addition & 1 deletion src/NetEx.IO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Currently Supported Types:

## Documentation

Documentation is available [here](https://peckmore.github.io/NetEx)
Documentation is available [here](https://peckmore.github.io/NetEx).
Loading