MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ddio_GetFullPath

Function ddio_GetFullPath

ddio/winfile.cpp:518–531  ·  view source on GitHub ↗

Finds a full path from a relative path Parameters: full_path - filled in with the fully-specified path. Buffer must be at least _MAX_PATH bytes long rel_path - a path specification, either relative or absolute Returns TRUE if successful, FALSE if an error

Source from the content-addressed store, hash-verified

516// rel_path - a path specification, either relative or absolute
517// Returns TRUE if successful, FALSE if an error
518bool ddio_GetFullPath(char *full_path, const char *rel_path) {
519 char old_path[_MAX_PATH];
520
521 ddio_GetWorkingDir(old_path, sizeof(old_path)); // save old directory
522
523 if (!ddio_SetWorkingDir(rel_path)) // try switching to new directory
524 return 0; // couldn't switch, so return error
525
526 ddio_GetWorkingDir(full_path, _MAX_PATH); // get path from the OS
527
528 ddio_SetWorkingDir(old_path); // now restore old path
529
530 return 1;
531}
532
533bool ddio_CheckProcess(int pid) {
534 HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);

Callers

nothing calls this directly

Calls 2

ddio_GetWorkingDirFunction · 0.70
ddio_SetWorkingDirFunction · 0.70

Tested by

no test coverage detected