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
| 516 | // rel_path - a path specification, either relative or absolute |
| 517 | // Returns TRUE if successful, FALSE if an error |
| 518 | bool 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 | |
| 533 | bool ddio_CheckProcess(int pid) { |
| 534 | HANDLE proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid); |
nothing calls this directly
no test coverage detected