Skip to content

Commit

Permalink
FEAT: throwing error if QUERY on INPUT port fails from some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Dec 18, 2018
1 parent a21eecc commit 32732d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/core/p-console.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@
Set_Block(D_RET, Get_Object_Words(spec));
return R_RET;
}
if (OS_DO_DEVICE(req, RDC_QUERY) < 0) return R_NONE;
if (OS_DO_DEVICE(req, RDC_QUERY) < 0) {
SET_INTEGER(arg, req->error);
Trap1(RE_PROTOCOL, arg);
//return R_NONE;
}

Ret_Query_Console(req, D_RET, D_ARG(ARG_QUERY_FIELD), spec);
break;
Expand Down
5 changes: 4 additions & 1 deletion src/os/win32/dev-stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,10 @@ static void close_stdio(void)
***********************************************************************/
{
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
GetConsoleScreenBufferInfo(Std_Out, &csbiInfo);
if(0 == GetConsoleScreenBufferInfo(Std_Out, &csbiInfo)) {
req->error = GetLastError();
return DR_ERROR;
}
req->console.buffer_rows = csbiInfo.dwSize.Y;
req->console.buffer_cols = csbiInfo.dwSize.X;
req->console.window_rows = csbiInfo.srWindow.Bottom - csbiInfo.srWindow.Top + 1;
Expand Down

0 comments on commit 32732d4

Please sign in to comment.