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

Function GetOculusBasePath

ReviveInjector/main.cpp:20–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18FILE* g_LogFile = NULL;
19
20bool GetOculusBasePath(PWCHAR path, DWORD length)
21{
22 LONG error = ERROR_SUCCESS;
23
24 HKEY oculusKey;
25 error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Oculus VR, LLC\\Oculus", 0, KEY_READ | KEY_WOW64_32KEY, &oculusKey);
26 if (error != ERROR_SUCCESS)
27 {
28 LOG("Unable to open Oculus key.");
29 return false;
30 }
31 error = RegQueryValueEx(oculusKey, L"Base", NULL, NULL, (PBYTE)path, &length);
32 if (error != ERROR_SUCCESS)
33 {
34 LOG("Unable to read Base path.");
35 return false;
36 }
37 RegCloseKey(oculusKey);
38
39 return true;
40}
41
42bool GetLibraryPath(PWCHAR path, DWORD length, PWCHAR guid)
43{

Callers 1

wmainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected