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

Function watcher_windows_wait_pid

tests/test_watcher.c:772–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770}
771
772static bool watcher_windows_wait_pid(const char *marker, uint64_t deadline_ms,
773 uint64_t *process_id_out) {
774 if (process_id_out) {
775 *process_id_out = 0;
776 }
777 while (cbm_now_ms() < deadline_ms) {
778 FILE *file = cbm_fopen(marker, "rb");
779 unsigned long long parsed = 0;
780 bool valid = file && fscanf(file, "%llu", &parsed) == 1 && parsed > 1 &&
781 parsed <= MAXDWORD && parsed != (unsigned long long)GetCurrentProcessId();
782 if (file) {
783 (void)fclose(file);
784 }
785 if (valid) {
786 if (process_id_out) {
787 *process_id_out = (uint64_t)parsed;
788 }
789 return true;
790 }
791 cbm_usleep(1000);
792 }
793 return false;
794}
795
796static HANDLE watcher_windows_open_exact_process(uint64_t process_id,
797 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