Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jp7677/dxvk-nvapi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Peters <jp7677@gmail.com>2022-02-11 11:43:54 +0300
committerJens Peters <jp7677@gmail.com>2022-02-11 19:04:39 +0300
commit7488f5b71e30d8774608afb1d8aaca26e84edb12 (patch)
tree81b997226fe4137429a19068cfed015d3a405303
parent54ffc120b2f9ed2c5aaa59e8764880dd20daec2a (diff)
nvapi-drs: Log setting name
-rw-r--r--src/nvapi_drs.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/nvapi_drs.cpp b/src/nvapi_drs.cpp
index 0e2441a..4bfb5da 100644
--- a/src/nvapi_drs.cpp
+++ b/src/nvapi_drs.cpp
@@ -1,3 +1,4 @@
+#include "../inc/NvApiDriverSettings.c"
#include "nvapi_private.h"
#include "util/util_statuscode.h"
@@ -5,8 +6,11 @@ extern "C" {
using namespace dxvk;
NvAPI_Status __cdecl NvAPI_DRS_CreateSession(NvDRSSessionHandle *phSession) {
+ constexpr auto n = __func__;
+
*phSession = reinterpret_cast<NvDRSSessionHandle>(nvapiAdapterRegistry->GetAdapter()); // Just another opaque pointer, we don't use it anywhere
- return Ok(__func__);
+
+ return Ok(n);
}
NvAPI_Status __cdecl NvAPI_DRS_LoadSettings(NvDRSSessionHandle hSession) {
@@ -18,16 +22,38 @@ extern "C" {
}
NvAPI_Status __cdecl NvAPI_DRS_FindApplicationByName(NvDRSSessionHandle hSession, NvAPI_UnicodeString appName, NvDRSProfileHandle *phProfile, __inout NVDRS_APPLICATION *pApplication) {
- return ExecutableNotFound(str::format(__func__, " (", str::fromnvs(appName), ")"));
+ constexpr auto n = __func__;
+
+ return ExecutableNotFound(str::format(n, " (", str::fromnvs(appName), ")"));
}
NvAPI_Status __cdecl NvAPI_DRS_GetBaseProfile(NvDRSSessionHandle hSession, NvDRSProfileHandle *phProfile) {
+ constexpr auto n = __func__;
+
*phProfile = reinterpret_cast<NvDRSProfileHandle>(nvapiAdapterRegistry->GetAdapter()); // Just another opaque pointer, we don't use it anywhere
- return Ok(__func__);
+
+ return Ok(n);
}
NvAPI_Status __cdecl NvAPI_DRS_GetSetting(NvDRSSessionHandle hSession, NvDRSProfileHandle hProfile, NvU32 settingId, NVDRS_SETTING *pSetting) {
- return SettingNotFound(str::format(__func__, " (", settingId, ")"));
+ constexpr auto n = __func__;
+
+ auto name = str::format("0x", std::hex, settingId);
+ auto itD = std::find_if(
+ std::begin(mapSettingDWORD),
+ std::end(mapSettingDWORD),
+ [&settingId](const auto& item) { return item.settingId == settingId; });
+ if (itD != std::end(mapSettingDWORD))
+ name = str::fromws(itD->settingNameString);
+
+ auto itW = std::find_if(
+ std::begin(mapSettingWSTRING),
+ std::end(mapSettingWSTRING),
+ [&settingId](const auto& item) { return item.settingId == settingId; });
+ if (itW != std::end(mapSettingWSTRING))
+ name = str::fromws(itW->settingNameString);
+
+ return SettingNotFound(str::format(n, " (", name, ")"));
}
NvAPI_Status __cdecl NvAPI_DRS_DestroySession(NvDRSSessionHandle hSession) {