{"record":{"id":"3d774c9ffcd1dc9c","repo":"Orbmu2k/nvidiaProfileInspector","slug":"nvapi-profile-not-found","errorCode":"NVAPI_PROFILE_NOT_FOUND","errorMessage":"DRS_GetCurrentGlobalProfile","messagePattern":"DRS_GetCurrentGlobalProfile","errorType":"error_code","errorClass":"NvapiException","httpStatus":null,"severity":"error","filePath":"nvidiaProfileInspector/Common/DrsSettingsServiceBase.cs","lineNumber":66,"sourceCode":"                return true;\n            }, forceNonGlobalSession: forceNonGlobalSession, preventLoadSettings: preventLoadSettings);\n        }\n\n        protected T DrsSession<T>(Func<IntPtr, T> action, bool forceDedicatedScope = false)\n        {\n            return DrsSessionScope.DrsSession<T>(action, forceDedicatedScope);\n        }\n\n        protected IntPtr GetProfileHandle(IntPtr hSession, string profileName)\n        {\n            var hProfile = IntPtr.Zero;\n\n            if (string.IsNullOrEmpty(profileName))\n            {\n                var nvRes = nvw.Instance.DRS_GetCurrentGlobalProfile(hSession, ref hProfile);\n\n                if (hProfile == IntPtr.Zero)\n                    throw new NvapiException(\"DRS_GetCurrentGlobalProfile\", NvAPI_Status.NVAPI_PROFILE_NOT_FOUND);\n\n                if (nvRes != NvAPI_Status.NVAPI_OK)\n                    throw new NvapiException(\"DRS_GetCurrentGlobalProfile\", nvRes);\n            }\n            else\n            {\n                var nvRes = nvw.Instance.DRS_FindProfileByName(hSession, new StringBuilder(profileName), ref hProfile);\n\n                if (nvRes == NvAPI_Status.NVAPI_PROFILE_NOT_FOUND)\n                    return IntPtr.Zero;\n\n                if (nvRes != NvAPI_Status.NVAPI_OK)\n                    throw new NvapiException(\"DRS_FindProfileByName\", nvRes);\n            }\n            return hProfile;\n        }\n\n        protected IntPtr CreateProfile(IntPtr hSession, string profileName)","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/Orbmu2k/nvidiaProfileInspector/blob/2f50c388b3a4d661cade66b32746bec096d1eee1/nvidiaProfileInspector/Common/DrsSettingsServiceBase.cs#L48-L84","documentation":"Sentinel guard in GetProfileHandle: after DRS_GetCurrentGlobalProfile returns NVAPI_OK, the resulting hProfile is checked for IntPtr.Zero and a manually constructed NvapiException named \"DRS_GetCurrentGlobalProfile\" is thrown. This is a generic guard, not a driver-reported status: the driver claimed success but returned no global profile handle, typically when no NVIDIA driver or global driver profile is available. The input at fault is the empty/null profileName path that requests the current global profile.","triggerScenarios":"Thrown at nvidiaProfileInspector/Common/DrsSettingsServiceBase.cs:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the NVIDIA driver is installed and functioning before requesting the global profile.","Catch NvapiException in callers and treat it as \"no driver profile available\" rather than a hard failure.","Provide a named profile instead of empty string so the predefined global profile path is not required.","Retry after driver initialization, e.g. when the app starts before the driver service is ready."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2f50c388b3a4d661cade66b32746bec096d1eee1","analyzedAt":"2026-09-15T05:23:52.218Z","contentChangedAt":"2026-09-15T05:23:52.218Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}