protected void DeleteApplication(IntPtr hSession, IntPtr hProfile, NVDRS_APPLICATION_V3 application) { var caRes = nvw.DRS_DeleteApplicationEx(hSession, hProfile, ref application); if (caRes != NvAPI_Status.NVAPI_OK) { throw new NvapiException("DRS_DeleteApplication", caRes); } }
protected void AddApplication(IntPtr hSession, IntPtr hProfile, string applicationName) { var newApp = new NVDRS_APPLICATION_V3() { version = nvw.NVDRS_APPLICATION_VER_V3, appName = applicationName, }; var caRes = nvw.DRS_CreateApplication(hSession, hProfile, ref newApp); if (caRes != NvAPI_Status.NVAPI_OK) { throw new NvapiException("DRS_CreateApplication", caRes); } }
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()); }
private string GetApplicationFingerprint(NVDRS_APPLICATION_V3 application) { return($"{application.appName}|{application.fileInFolder}|{application.userFriendlyName}|{application.launcher}"); }