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

Function watcher_windows_wait_pid

tests/test_watcher.c:773–795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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