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

Function LoadRenderDoc

ReviveXR/REV_CAPI.cpp:29–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using namespace std::chrono_literals;
28
29bool LoadRenderDoc()
30{
31 LONG error = ERROR_SUCCESS;
32
33 // Open the libraries key
34 char keyPath[MAX_PATH] = { "RenderDoc.RDCCapture.1\\DefaultIcon" };
35 HKEY iconKey;
36 error = RegOpenKeyExA(HKEY_CLASSES_ROOT, keyPath, 0, KEY_READ, &iconKey);
37 if (error != ERROR_SUCCESS)
38 return false;
39
40 // Get the default library
41 char path[MAX_PATH];
42 DWORD length = MAX_PATH;
43 error = RegQueryValueExA(iconKey, "", NULL, NULL, (PBYTE)path, &length);
44 RegCloseKey(iconKey);
45 if (error != ERROR_SUCCESS)
46 return false;
47
48 if (path[0] == '\0')
49 return false;
50
51 strcpy(strrchr(path, '\\') + 1, "renderdoc.dll");
52 return LoadLibraryA(path) != NULL;
53}
54
55void AttachDetours();
56void DetachDetours();

Callers 1

ovr_InitializeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected