From a2abc48738bef98d0a2c61edf572801fb1bce5b0 Mon Sep 17 00:00:00 2001 From: Simon Peckmore <11754624+Peckmore@users.noreply.github.com> Date: Thu, 21 Aug 2025 08:50:34 +0100 Subject: [PATCH 1/4] fix: correct package project url for all packages --- src/NetEx.Dialogs.WinForms/NetEx.Dialogs.WinForms.csproj | 2 +- src/NetEx.Hooks/NetEx.Hooks.csproj | 2 +- src/NetEx.IO/NetEx.IO.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NetEx.Dialogs.WinForms/NetEx.Dialogs.WinForms.csproj b/src/NetEx.Dialogs.WinForms/NetEx.Dialogs.WinForms.csproj index 58ef4be..40c49ab 100644 --- a/src/NetEx.Dialogs.WinForms/NetEx.Dialogs.WinForms.csproj +++ b/src/NetEx.Dialogs.WinForms/NetEx.Dialogs.WinForms.csproj @@ -32,7 +32,7 @@ true NetEx.Dialogs.WinForms icon.png - https://github.com/Peckmore/NetEx + https://peckmore.github.io/NetEx README.md Please refer to GitHub for changes. diff --git a/src/NetEx.Hooks/NetEx.Hooks.csproj b/src/NetEx.Hooks/NetEx.Hooks.csproj index 0bffe9e..4571275 100644 --- a/src/NetEx.Hooks/NetEx.Hooks.csproj +++ b/src/NetEx.Hooks/NetEx.Hooks.csproj @@ -30,7 +30,7 @@ true NetEx.Hooks icon.png - https://github.com/Peckmore/NetEx + https://peckmore.github.io/NetEx README.md Please refer to GitHub for changes. diff --git a/src/NetEx.IO/NetEx.IO.csproj b/src/NetEx.IO/NetEx.IO.csproj index ea0b1dd..e1180bd 100644 --- a/src/NetEx.IO/NetEx.IO.csproj +++ b/src/NetEx.IO/NetEx.IO.csproj @@ -31,7 +31,7 @@ true NetEx.IO icon.png - https://github.com/Peckmore/NetEx + https://peckmore.github.io/NetEx README.md Please refer to GitHub for changes. From 0aa3383afee0106f10f1858f68cdf0024ed3a772 Mon Sep 17 00:00:00 2001 From: Simon Peckmore <11754624+Peckmore@users.noreply.github.com> Date: Thu, 21 Aug 2025 08:51:38 +0100 Subject: [PATCH 2/4] docs: correct missing punctuation in package readme files --- src/NetEx.Dialogs.WinForms/README.md | 2 +- src/NetEx.Hooks/README.md | 2 +- src/NetEx.IO/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NetEx.Dialogs.WinForms/README.md b/src/NetEx.Dialogs.WinForms/README.md index 73fd7de..825947e 100644 --- a/src/NetEx.Dialogs.WinForms/README.md +++ b/src/NetEx.Dialogs.WinForms/README.md @@ -8,4 +8,4 @@ Currently Supported Types: ## Documentation -Documentation is available [here](https://peckmore.github.io/NetEx) \ No newline at end of file +Documentation is available [here](https://peckmore.github.io/NetEx. \ No newline at end of file diff --git a/src/NetEx.Hooks/README.md b/src/NetEx.Hooks/README.md index b109fc9..6cd9e4f 100644 --- a/src/NetEx.Hooks/README.md +++ b/src/NetEx.Hooks/README.md @@ -11,4 +11,4 @@ Currently Supported Types: ## Documentation -Documentation is available [here](https://peckmore.github.io/NetEx) \ No newline at end of file +Documentation is available [here](https://peckmore.github.io/NetEx). \ No newline at end of file diff --git a/src/NetEx.IO/README.md b/src/NetEx.IO/README.md index 076735b..5b51668 100644 --- a/src/NetEx.IO/README.md +++ b/src/NetEx.IO/README.md @@ -8,4 +8,4 @@ Currently Supported Types: ## Documentation -Documentation is available [here](https://peckmore.github.io/NetEx) \ No newline at end of file +Documentation is available [here](https://peckmore.github.io/NetEx). \ No newline at end of file From d71bc58575adbde1221860db8dd0d2192b76dfe4 Mon Sep 17 00:00:00 2001 From: Simon Peckmore <11754624+Peckmore@users.noreply.github.com> Date: Thu, 21 Aug 2025 09:52:55 +0100 Subject: [PATCH 3/4] fix(credentialdialog): `CredentialDialog` crashes when shown on a system with Windows Hello #8 `CredentialDialog` now calls the modern dialog with the "Generic Credentials" flag, which fixes the crash when used on a system with Windows Hello. Fix: #8 --- .../CredentialDialog.cs | 18 +++++------ .../CredentialFilter.cs | 5 +++- .../Interop/CREDUIWIN.cs | 30 +++++++++++++------ .../Interop/CREDUI_FLAGS.cs | 6 ++-- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/NetEx.Dialogs.WinForms/CredentialDialog.cs b/src/NetEx.Dialogs.WinForms/CredentialDialog.cs index 08277e5..8ae0efe 100644 --- a/src/NetEx.Dialogs.WinForms/CredentialDialog.cs +++ b/src/NetEx.Dialogs.WinForms/CredentialDialog.cs @@ -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) @@ -485,7 +488,7 @@ 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) @@ -493,13 +496,6 @@ private int RunDialogVista(CREDUI_INFO credUiInfo) 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; diff --git a/src/NetEx.Dialogs.WinForms/CredentialFilter.cs b/src/NetEx.Dialogs.WinForms/CredentialFilter.cs index 266c208..72f79c2 100644 --- a/src/NetEx.Dialogs.WinForms/CredentialFilter.cs +++ b/src/NetEx.Dialogs.WinForms/CredentialFilter.cs @@ -12,7 +12,10 @@ public enum CredentialFilter /// /// Populate the with local administrators only. /// - /// 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. + /// + /// This option is only applicable on Windows XP and Windows Server 2003, or on later version of Windows when using the with set to false. + /// On Windows XP Home Edition this flag will filter out the well-known Administrator account. + /// AdministratorsOnly = 1, /// /// Populate the with usernames only. This option will not display certificates or smart cards in the . diff --git a/src/NetEx.Dialogs.WinForms/Interop/CREDUIWIN.cs b/src/NetEx.Dialogs.WinForms/Interop/CREDUIWIN.cs index a63c810..b3152cb 100644 --- a/src/NetEx.Dialogs.WinForms/Interop/CREDUIWIN.cs +++ b/src/NetEx.Dialogs.WinForms/Interop/CREDUIWIN.cs @@ -10,7 +10,7 @@ namespace NetEx.Dialogs.WinForms.Interop [Flags] [SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "UnusedMember.Global")] - internal enum CREDUIWIN + internal enum CREDUIWIN : uint { /// /// The caller is requesting that the credential provider return the user name and password in plain text. @@ -22,41 +22,53 @@ internal enum CREDUIWIN /// CREDUIWIN_CHECKBOX = 0x2, /// - /// 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. /// This value cannot be combined with CREDUIWIN_IN_CRED_ONLY. /// [SuppressMessage("ReSharper", "IdentifierTypo")] CREDUIWIN_AUTHPACKAGE_ONLY = 0x10, /// - /// 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. /// If this flag is set, and the pvInAuthBuffer parameter is NULL, the function fails. /// This value cannot be combined with CREDUIWIN_AUTHPACKAGE_ONLY. /// [SuppressMessage("ReSharper", "CommentTypo")] CREDUIWIN_IN_CRED_ONLY = 0x20, /// - /// 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. /// CREDUIWIN_ENUMERATE_ADMINS = 0x100, /// - /// 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. /// CREDUIWIN_ENUMERATE_CURRENT_USER = 0x200, /// - /// 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. /// Windows Vista: This value is supported beginning with Windows Vista with SP1. /// CREDUIWIN_SECURE_PROMPT = 0x1000, /// - /// 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. /// Windows Vista: This value is supported beginning with Windows Vista with SP1. /// [SuppressMessage("ReSharper", "CommentTypo")] [SuppressMessage("ReSharper", "IdentifierTypo")] CREDUIWIN_PREPROMPTING = 0x2000, /// - /// 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. + /// Windows 10, version 1607: This value is supported beginning with Windows 10, version 1607. /// - CREDUIWIN_PACK_32_WOW = 0x10000000 + /// This value does not have an explicit name defined in the original enum, so the name is generated for this library. + CREDUIWIN_DO_NOT_PACK_AAD_AUTHORITY_NAME = 0x40000, + /// + /// 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. + /// + CREDUIWIN_PACK_32_WOW = 0x10000000, + /// + /// Windows Hello credentials will be packed in a smart card auth buffer. This only applies to the face, fingerprint, and PIN credential providers. + /// Windows 10, version 1809: This value is supported beginning with Windows 10, version 1809. + /// + /// This value does not have an explicit name defined in the original enum, so the name is generated for this library. + CREDUIWIN_PACK_WINDOWS_HELLO = 0x80000000 } } \ No newline at end of file diff --git a/src/NetEx.Dialogs.WinForms/Interop/CREDUI_FLAGS.cs b/src/NetEx.Dialogs.WinForms/Interop/CREDUI_FLAGS.cs index f5c4c08..9b77dcd 100644 --- a/src/NetEx.Dialogs.WinForms/Interop/CREDUI_FLAGS.cs +++ b/src/NetEx.Dialogs.WinForms/Interop/CREDUI_FLAGS.cs @@ -13,7 +13,7 @@ namespace NetEx.Dialogs.WinForms.Interop internal enum CREDUI_FLAGS { /// - /// 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. /// CREDUI_FLAGS_ALWAYS_SHOW_UI = 0x00080, /// @@ -21,7 +21,7 @@ internal enum CREDUI_FLAGS /// CREDUI_FLAGS_COMPLETE_USERNAME = 0x00800, /// - /// 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. /// CREDUI_FLAGS_DO_NOT_PERSIST = 0x00002, /// @@ -37,7 +37,7 @@ internal enum CREDUI_FLAGS /// CREDUI_FLAGS_GENERIC_CREDENTIALS = 0x40000, /// - /// 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. /// CREDUI_FLAGS_INCORRECT_PASSWORD = 0x00001, /// From 1c3baa84a402876a743ea5ab819ad140e768bd75 Mon Sep 17 00:00:00 2001 From: Simon Peckmore <11754624+Peckmore@users.noreply.github.com> Date: Thu, 21 Aug 2025 10:38:30 +0100 Subject: [PATCH 4/4] chore(pr): correct test run in build workflow --- .github/workflows/build-libraries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-libraries.yml b/.github/workflows/build-libraries.yml index a696948..3fbe7af 100644 --- a/.github/workflows/build-libraries.yml +++ b/.github/workflows/build-libraries.yml @@ -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.