Exemplo n.º 1
0
        /// <summary>
        ///     This API adds an executable name to a profile.
        /// </summary>
        /// <param name="sessionHandle">Input to the session handle.</param>
        /// <param name="profileHandle">Input profile handle.</param>
        /// <param name="application">Input <see cref="IDRSApplication" /> instance containing the executable name.</param>
        /// <returns>The newly created instance of <see cref="IDRSApplication" />.</returns>
        public static IDRSApplication CreateApplication(
            DRSSessionHandle sessionHandle,
            DRSProfileHandle profileHandle,
            IDRSApplication application)
        {
            using (var applicationReference = ValueTypeReference.FromValueType(application, application.GetType()))
            {
                var status = DelegateFactory.GetDelegate <Delegates.DRS.NvAPI_DRS_CreateApplication>()(
                    sessionHandle,
                    profileHandle,
                    applicationReference
                    );

                if (status == Status.IncompatibleStructureVersion)
                {
                    throw new NVIDIANotSupportedException("This operation is not supported.");
                }

                if (status != Status.Ok)
                {
                    throw new NVIDIAApiException(status);
                }

                return(applicationReference.ToValueType <IDRSApplication>(application.GetType()));
            }
        }
Exemplo n.º 2
0
 internal ProfileApplication(IDRSApplication application, DriverSettingsProfile profile)
 {
     Profile      = profile;
     _application = application;
 }