MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / VR_GetRuntimePath

Function VR_GetRuntimePath

src/openvr_api_public.cpp:286–317  ·  view source on GitHub ↗

Returns where OpenVR runtime is installed. */

Source from the content-addressed store, hash-verified

284
285/** Returns where OpenVR runtime is installed. */
286bool VR_GetRuntimePath( char *pchPathBuffer, uint32_t unBufferSize, uint32_t *punRequiredBufferSize )
287{
288 // otherwise we need to do a bit more work
289 std::string sRuntimePath;
290
291 *punRequiredBufferSize = 0;
292
293 bool bReadPathRegistry = CVRPathRegistry_Public::GetPaths( &sRuntimePath, nullptr, nullptr, nullptr, nullptr );
294 if ( !bReadPathRegistry )
295 {
296 return false;
297 }
298
299 // figure out where we're going to look for vrclient.dll
300 // see if the specified path actually exists.
301 if ( !Path_IsDirectory( sRuntimePath ) )
302 {
303 return false;
304 }
305
306 *punRequiredBufferSize = (uint32_t)sRuntimePath.size() + 1;
307 if ( sRuntimePath.size() >= unBufferSize )
308 {
309 *pchPathBuffer = '\0';
310 }
311 else
312 {
313 strcpy_safe( pchPathBuffer, unBufferSize, sRuntimePath.c_str() );
314 }
315
316 return true;
317}
318
319
320/** Returns the symbol version of an HMD error. */

Callers 1

VR_RuntimePathFunction · 0.85

Calls 3

sizeMethod · 0.80
Path_IsDirectoryFunction · 0.50
strcpy_safeFunction · 0.50

Tested by

no test coverage detected