MCPcopy Create free account
hub / github.com/DFHack/dfhack / waitForDF

Function waitForDF

package/launchdf.cpp:185–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185bool waitForDF(bool nowait) {
186 DWORD df_pid = findDwarfFortressProcess();
187
188 if (df_pid == -1)
189 return false;
190
191 if (nowait)
192 return true;
193
194 HANDLE hDF = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, df_pid);
195
196 // in the future open an IPC connection so that we can proxy SteamAPI calls for the DFSteam module
197
198 // this will eventually need to become a loop with a WaitForMultipleObjects call
199 WaitForSingleObject(hDF, INFINITE);
200
201 CloseHandle(hDF);
202
203 return true;
204}
205
206#else
207

Callers 1

mainFunction · 0.85

Calls 1

findDwarfFortressProcessFunction · 0.85

Tested by

no test coverage detected