#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved //----------------------------------------------------------------------------- // Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved // Web: https://www.technosoftware.com // // The source code in this file is covered under a dual-license scenario: // - Owner of a purchased license: SCLA 1.0 // - GPL V3: everybody else // // SCLA license terms accompanied with this source code. // See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf // // GNU General Public License as published by the Free Software Foundation; // version 3 of the License are accompanied with this source code. // See https://technosoftware.com/license/GPLv3License.txt // // This source code is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. //----------------------------------------------------------------------------- #endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved #region Using Directives using System; #endregion namespace Technosoftware.DaAeHdaClient.Com { /// /// Manages the license to enable the different product versions. /// public partial class ApplicationInstance { #region Nested Enums /// /// The possible authentication levels. /// [Flags] public enum AuthenticationLevel : uint { /// /// Tells DCOM to choose the authentication level using its normal security blanket negotiation algorithm. /// Default = 0, /// /// Performs no authentication. /// None = 1, /// /// Authenticates the credentials of the client only when the client establishes a relationship with the server. Datagram transports always use Packet instead. /// Connect = 2, /// /// Authenticates only at the beginning of each remote procedure call when the server receives the request. Datagram transports use Packet instead. /// Call = 3, /// /// Authenticates that all data received is from the expected client. /// Packet = 4, /// /// Authenticates and verifies that none of the data transferred between client and server has been modified. /// Integrity = 5, /// /// Authenticates all previous levels and encrypts the argument value of each remote procedure call. /// Privacy = 6, } #endregion #region Public Methods /// /// Initializes COM security. This should be called directly at the beginning of an application and can only be called once. /// /// The default authentication level for the process. Both servers and clients use this parameter when they call CoInitializeSecurity. With the Windows Update KB5004442 a higher authentication level of Integrity must be used. public static void InitializeSecurity(AuthenticationLevel authenticationLevel) { if (!InitializeSecurityCalled) { Com.Interop.InitializeSecurity((uint)authenticationLevel); InitializeSecurityCalled = true; } } #endregion #region Internal Fields internal static bool InitializeSecurityCalled; #endregion } }