MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / watcher_windows_wait_pid

Function watcher_windows_wait_pid

tests/test_watcher.c:934–956  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934static bool watcher_windows_wait_pid(const char *marker, uint64_t deadline_ms,
935 uint64_t *process_id_out) {
936 if (process_id_out) {
937 *process_id_out = 0;
938 }
939 while (cbm_now_ms() < deadline_ms) {
940 FILE *file = cbm_fopen(marker, "rb");
941 unsigned long long parsed = 0;
942 bool valid = file && fscanf(file, "%llu", &parsed) == 1 && parsed > 1 &&
943 parsed <= MAXDWORD && parsed != (unsigned long long)GetCurrentProcessId();
944 if (file) {
945 (void)fclose(file);
946 }
947 if (valid) {
948 if (process_id_out) {
949 *process_id_out = (uint64_t)parsed;
950 }
951 return true;
952 }
953 cbm_usleep(1000);
954 }
955 return false;
956}
957
958static HANDLE watcher_windows_open_exact_process(uint64_t process_id,
959 const watcher_windows_image_identity_t *expected) {

Callers 1

test_watcher.cFile · 0.85

Calls 2

cbm_now_msFunction · 0.85
cbm_fopenFunction · 0.85

Tested by

no test coverage detected