MCPcopy Create free account
hub / github.com/LibreVR/Revive / LoadRenderDoc

Function LoadRenderDoc

Revive/REV_CAPI.cpp:64–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64bool LoadRenderDoc()
65{
66 LONG error = ERROR_SUCCESS;
67
68 // Open the libraries key
69 char keyPath[MAX_PATH] = { "RenderDoc.RDCCapture.1\\DefaultIcon" };
70 HKEY iconKey;
71 error = RegOpenKeyExA(HKEY_CLASSES_ROOT, keyPath, 0, KEY_READ, &iconKey);
72 if (error != ERROR_SUCCESS)
73 return false;
74
75 // Get the default library
76 char path[MAX_PATH];
77 DWORD length = MAX_PATH;
78 error = RegQueryValueExA(iconKey, "", NULL, NULL, (PBYTE)path, &length);
79 RegCloseKey(iconKey);
80 if (error != ERROR_SUCCESS)
81 return false;
82
83 if (path[0] == '\0')
84 return false;
85
86 strcpy(strrchr(path, '\\') + 1, "renderdoc.dll");
87 return LoadLibraryA(path) != NULL;
88}
89
90void AttachDetours();
91void DetachDetours();

Callers 1

ovr_InitializeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected