Ejemplo n.º 1
0
        protected List <NVDRS_SETTING> GetProfileSettings(IntPtr hSession, IntPtr hProfile)
        {
            uint settingCount = 512;
            var  settings     = new NVDRS_SETTING[512];

            settings[0].version = NvapiDrsWrapper.NVDRS_SETTING_VER;

            var esRes = NvapiDrsWrapper.DRS_EnumSettings(hSession, hProfile, 0, ref settingCount, ref settings);

            if (esRes == NvAPI_Status.NVAPI_END_ENUMERATION)
            {
                return(new List <NVDRS_SETTING>());
            }

            if (esRes != NvAPI_Status.NVAPI_OK)
            {
                throw new NvapiException("DRS_EnumSettings", esRes);
            }

            if (decrypter != null)
            {
                var profile = GetProfileInfo(hSession, hProfile);
                for (int i = 0; i < settingCount; i++)
                {
                    decrypter.DecryptSettingIfNeeded(profile.profileName, ref settings[i]);
                }
            }

            return(settings.ToList());
        }
Ejemplo n.º 2
0
        protected List <NVDRS_APPLICATION_V3> GetProfileApplications(IntPtr hSession, IntPtr hProfile)
        {
            uint appCount = 512;
            var  apps     = new NVDRS_APPLICATION_V3[512];

            apps[0].version = NvapiDrsWrapper.NVDRS_APPLICATION_VER_V3;

            var esRes = NvapiDrsWrapper.DRS_EnumApplications(hSession, hProfile, 0, ref appCount, ref apps);

            if (esRes == NvAPI_Status.NVAPI_END_ENUMERATION)
            {
                return(new List <NVDRS_APPLICATION_V3>());
            }

            if (esRes != NvAPI_Status.NVAPI_OK)
            {
                throw new NvapiException("DRS_EnumApplications", esRes);
            }

            return(apps.ToList());
        }