Commit 9445866c authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Ignore VDD WriteFile() failures if the child process has terminated

If the child process (e.g. door game) has terminated, don't log errors if/when WriteFile() to the mailslot fails. This would be expected as the mailslot is created/owen-by sbbsexec.dll which would also terminate along with the process, thus closing the mailslot. 

Hopefully resolves the errors reported by DesotoFireflite (VALHALLA).
parent 06ee54c4
Pipeline #2631 passed with stage
in 9 minutes and 27 seconds
......@@ -694,11 +694,13 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
if(wrslot==INVALID_HANDLE_VALUE)
lprintf(LOG_WARNING,"VDD Open failed (not loaded yet?)");
else if(!WriteFile(wrslot,bp,wr,&len,NULL)) {
lprintf(LOG_ERR,"!VDD WriteFile(0x%x, %u) FAILURE (Error=%u)", wrslot, wr, GetLastError());
if(GetMailslotInfo(wrslot,&wr,NULL,NULL,NULL))
lprintf(LOG_DEBUG,"!VDD MailSlot max_msg_size=%u", wr);
else
lprintf(LOG_DEBUG,"!GetMailslotInfo(0x%x)=%u", wrslot, GetLastError());
if(WaitForSingleObject(process_info.hProcess, 0) != WAIT_OBJECT_0) { // Process still running?
lprintf(LOG_ERR,"!VDD WriteFile(0x%x, %u) FAILURE (Error=%u)", wrslot, wr, GetLastError());
if(GetMailslotInfo(wrslot,&wr,NULL,NULL,NULL))
lprintf(LOG_DEBUG,"!VDD MailSlot max_msg_size=%u", wr);
else
lprintf(LOG_DEBUG,"!GetMailslotInfo(0x%x)=%u", wrslot, GetLastError());
}
} else {
if(len!=wr)
lprintf(LOG_WARNING,"VDD short write (%u instead of %u)", len,wr);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment