| 662 | } runtime_windows_process_image_snapshot_t; |
| 663 | |
| 664 | static bool runtime_windows_process_image_snapshot( |
| 665 | HANDLE process, runtime_windows_process_image_snapshot_t *snapshot) { |
| 666 | if (!process || !snapshot) { |
| 667 | return false; |
| 668 | } |
| 669 | memset(snapshot, 0, sizeof(*snapshot)); |
| 670 | FILETIME exit_time; |
| 671 | FILETIME kernel_time; |
| 672 | FILETIME user_time; |
| 673 | DWORD exit_code = 0; |
| 674 | DWORD path_length = (DWORD)(sizeof(snapshot->path) / sizeof(snapshot->path[0])); |
| 675 | bool ok = GetProcessTimes(process, &snapshot->creation_time, &exit_time, &kernel_time, |
| 676 | &user_time) != 0 && |
| 677 | GetExitCodeProcess(process, &exit_code) != 0 && exit_code == STILL_ACTIVE && |
| 678 | QueryFullProcessImageNameW(process, 0, snapshot->path, &path_length) != 0 && |
| 679 | path_length > 0 && |
| 680 | path_length < (DWORD)(sizeof(snapshot->path) / sizeof(snapshot->path[0])); |
| 681 | if (ok) { |
| 682 | snapshot->path[path_length] = L'\0'; |
| 683 | } |
| 684 | return ok; |
| 685 | } |
| 686 | |
| 687 | static bool runtime_windows_process_image_snapshot_same( |
| 688 | const runtime_windows_process_image_snapshot_t *first, |
no outgoing calls
no test coverage detected